Add 'Two machines should not share any local admin.' report

This commit is contained in:
Oran Nadler 2018-05-15 11:10:32 +03:00
parent e672e26f71
commit b54eb89330
1 changed files with 6 additions and 3 deletions

View File

@ -49,6 +49,9 @@ SidTypeInvalid = 7
SidTypeUnknown = 8
SidTypeComputer = 9
def is_group_sid_type(type):
return type in (SidTypeGroup, SidTypeAlias, SidTypeWellKnownGroup)
def myntlm(x):
hash = hashlib.new('md4', x.encode('utf-16le')).digest()
return str(binascii.hexlify(hash))
@ -299,7 +302,7 @@ class Machine(object):
if eval(group["Name"]) != group_name:
continue
if group["SIDType"] != SidTypeGroup:
if not is_group_sid_type(group["SIDType"]):
continue
return eval(group["SID"])
@ -316,7 +319,7 @@ class Machine(object):
if eval(group_user["GroupComponent"]["SID"]) != sid:
continue
if group_user["GroupComponent"]["SIDType"] != SidTypeGroup:
if not is_group_sid_type(group_user["GroupComponent"]["SIDType"]):
continue
if "PartComponent" not in group_user.keys():