Skip to content

Commit cc65963

Browse files
committed
Merge branch 'main' into neff-drop-py-support
2 parents 46cd610 + d6e77d1 commit cc65963

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

nxc/modules/runasppl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def on_admin_login(self, context, connection):
1717
command = r"reg query HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\ /v RunAsPPL"
1818
context.log.debug(f"Executing command: {command}")
1919
p = connection.execute(command, True)
20-
if "The system was unable to find the specified registry key or value" in p:
20+
if not p or "The system was unable to find the specified registry key or value" in p:
2121
context.log.debug("Unable to find RunAsPPL Registry Key")
2222
else:
2323
context.log.highlight(p)

nxc/netexec.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ def main():
173173
for module in args.module:
174174
nxc_logger.display(f"{module} module options:\n{modules[module]['options']}")
175175
exit(0)
176+
elif args.show_module_options:
177+
nxc_logger.error(f"--options requires -M/--module")
178+
exit(1)
176179
elif args.module:
177180
# Check the modules for sanity before loading the protocol
178181
nxc_logger.debug(f"Modules to be Loaded for sanity check: {args.module}, {type(args.module)}")

nxc/protocols/smb.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,10 @@ def enum_host_info(self):
258258
except KeyError:
259259
self.logger.debug("Error getting server information...")
260260

261+
# Handle cases where server_os is returned as bytes, such as when accidentally scanning a machine running Responder
262+
if isinstance(self.server_os.lower(), bytes):
263+
self.server_os = self.server_os.decode("utf-8")
264+
261265
if "Windows 6.1" in self.server_os and self.server_os_build == 0 and self.os_arch == 0:
262266
self.server_os = "Unix - Samba"
263267
elif self.server_os_build == 0 and self.os_arch == 0:
@@ -266,9 +270,6 @@ def enum_host_info(self):
266270

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

269-
if isinstance(self.server_os.lower(), bytes):
270-
self.server_os = self.server_os.decode("utf-8")
271-
272273
try:
273274
self.signing = self.conn.isSigningRequired() if self.smbv1 else self.conn._SMBConnection._Connection["RequireSigning"]
274275
except Exception as e:

0 commit comments

Comments
 (0)