Skip to content

Commit 506486f

Browse files
authored
Merge branch 'Pennyw0rth:main' into main
2 parents b4612ea + a28c441 commit 506486f

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

nxc/connection.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ def __init__(self, args, db, target):
167167
except Exception as e:
168168
if "ERROR_DEPENDENT_SERVICES_RUNNING" in str(e):
169169
self.logger.error(f"Exception while calling proto_flow() on target {target}: {e}")
170+
# Catching impacket SMB specific exceptions, which should not be imported due to performance reasons
171+
elif e.__class__.__name__ in ["NetBIOSTimeout", "NetBIOSError"]:
172+
self.logger.error(f"{e.__class__.__name__} on target {target}: {e}")
170173
else:
171174
self.logger.exception(f"Exception while calling proto_flow() on target {target}: {e}")
172175
finally:

nxc/protocols/smb.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,8 @@ def check_if_admin(self):
581581
try:
582582
# 0xF003F - SC_MANAGER_ALL_ACCESS
583583
# http://msdn.microsoft.com/en-us/library/windows/desktop/ms685981(v=vs.85).aspx
584-
scmr.hROpenSCManagerW(dce, f"{self.host}\x00", "ServicesActive\x00", 0xF003F)
584+
scmrobj = scmr.hROpenSCManagerW(dce, f"{self.host}\x00", "ServicesActive\x00", 0xF003F)
585+
scmr.hREnumServicesStatusW(dce, scmrobj["lpScHandle"])
585586
self.logger.debug(f"User is admin on {self.host}!")
586587
self.admin_privs = True
587588
except scmr.DCERPCException:

0 commit comments

Comments
 (0)