Skip to content

Commit

Permalink
Merge pull request #132 from Pennyw0rth/neff-encode-errors
Browse files Browse the repository at this point in the history
  • Loading branch information
NeffIsBack authored Dec 23, 2023
2 parents 82e8c17 + 235d9e0 commit 6115185
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions nxc/protocols/smb.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,12 +359,7 @@ def plaintext_login(self, domain, username, password):
self.username = username
self.domain = domain

try:
self.conn.login(self.username, self.password, domain)
except UnicodeEncodeError:
self.logger.error(f"UnicodeEncodeError on: '{self.username}:{self.password}'. Trying again with a different encoding...")
self.create_conn_obj()
self.conn.login(self.username, self.password.encode().decode("latin-1"), domain)
self.conn.login(self.username, self.password, domain)

self.check_if_admin()
self.logger.debug(f"Adding credential: {domain}/{self.username}:{self.password}")
Expand Down

0 comments on commit 6115185

Please sign in to comment.