Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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