Skip to content

Commit

Permalink
fix(smb errors): getErrorString only returns one item, not a tuple; f…
Browse files Browse the repository at this point in the history
…ixes #117
  • Loading branch information
Marshall-Hallenbeck committed Nov 13, 2023
1 parent 8879ccc commit 1784d55
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nxc/protocols/smb.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ def kerberos_login(self, domain, username, password="", ntlm_hash="", aesKey="",
used_ccache = f" through S4U with {username}"
self.logger.fail(f"{domain}\\{self.username}{used_ccache} {e}")
except (SessionError, Exception) as e:
error, desc = e.getErrorString()
error = e.getErrorString()
used_ccache = " from ccache" if useCache else f":{process_secret(kerb_pass)}"
if self.args.delegate:
used_ccache = f" through S4U with {username}"
Expand Down Expand Up @@ -500,7 +500,7 @@ def plaintext_login(self, domain, username, password):
self.create_conn_obj()
return True
except SessionError as e:
error, desc = e.getErrorString()
error = e.getErrorString()
self.logger.fail(
f'{domain}\\{self.username}:{process_secret(self.password)} {error} {f"({desc})" if self.args.verbose else ""}',
color="magenta" if error in smb_error_status else "red",
Expand Down Expand Up @@ -563,7 +563,7 @@ def hash_login(self, domain, username, ntlm_hash):
self.create_conn_obj()
return True
except SessionError as e:
error, desc = e.getErrorString()
error = e.getErrorString()
self.logger.fail(
f"{domain}\\{self.username}:{process_secret(self.hash)} {error} {f'({desc})' if self.args.verbose else ''}",
color="magenta" if error in smb_error_status else "red",
Expand Down Expand Up @@ -920,7 +920,7 @@ def disks(self):
for disk in disks:
self.logger.highlight(disk.disk)
except Exception as e:
error, desc = e.getErrorString()
error = e.getErrorString()
self.logger.fail(
f"Error enumerating disks: {error}",
color="magenta" if error in smb_error_status else "red",
Expand Down

0 comments on commit 1784d55

Please sign in to comment.