Skip to content

Commit a28c441

Browse files
authored
Merge pull request Pennyw0rth#378 from nikaiw/check_admin_false_positive
Fix check admin false positive on certain target (e.g Netapp)
2 parents 80d03ad + 7031913 commit a28c441

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

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)