Skip to content

Commit

Permalink
Merge pull request #44 from exploide/timeout-error
Browse files Browse the repository at this point in the history
Show error when getting timeout during share enumeration
  • Loading branch information
cddmp authored Nov 2, 2023
2 parents 84fe683 + 186f4d3 commit f1e599e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions enum4linux-ng.py
Original file line number Diff line number Diff line change
Expand Up @@ -2449,6 +2449,9 @@ def check_access(self, share):

result = SambaSmbclient(['dir', f'{share}'], self.target, self.creds).run(log=f'Attempting to map share //{self.target.host}/{share}', error_filter=False)

if not result.retval:
return Result(None, f"Could not check share: {result.retmsg}")

if "NT_STATUS_BAD_NETWORK_NAME" in result.retmsg:
return Result(None, "Share doesn't exist")

Expand All @@ -2474,6 +2477,9 @@ def check_access(self, share):
if "NT_STATUS_INVALID_PARAMETER" in result.retmsg:
return Result(None, "Could not check share: STATUS_INVALID_PARAMETER")

if "NT_STATUS_IO_TIMEOUT" in result.retmsg:
return Result(None, "Could not check share: STATUS_IO_TIMEOUT")

if re.search(r"\n\s+\.\.\s+D.*\d{4}\n", result.retmsg) or re.search(r".*blocks\sof\ssize.*blocks\savailable.*", result.retmsg):
return Result({"mapping":"ok", "listing":"ok"}, "Mapping: OK, Listing: OK")

Expand Down

0 comments on commit f1e599e

Please sign in to comment.