Skip to content

Commit

Permalink
FIX a bytes-like object is required, not str
Browse files Browse the repository at this point in the history
  • Loading branch information
Chocapikk committed Oct 20, 2024
1 parent c312367 commit d4a17c0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nxc/protocols/smb.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,9 @@ def enum_host_info(self):
except KeyError:
self.logger.debug("Error getting server information...")

if isinstance(self.server_os.lower(), bytes):
self.server_os = self.server_os.decode("utf-8")

if "Windows 6.1" in self.server_os and self.server_os_build == 0 and self.os_arch == 0:
self.server_os = "Unix - Samba"
elif self.server_os_build == 0 and self.os_arch == 0:
Expand All @@ -266,9 +269,6 @@ def enum_host_info(self):

self.logger.extra["hostname"] = self.hostname

if isinstance(self.server_os.lower(), bytes):
self.server_os = self.server_os.decode("utf-8")

try:
self.signing = self.conn.isSigningRequired() if self.smbv1 else self.conn._SMBConnection._Connection["RequireSigning"]
except Exception as e:
Expand Down

0 comments on commit d4a17c0

Please sign in to comment.