forked from p15670423/monkey
Add 'Two machines should not share any local admin.' report
This commit is contained in:
parent
e672e26f71
commit
b54eb89330
|
@ -49,6 +49,9 @@ SidTypeInvalid = 7
|
||||||
SidTypeUnknown = 8
|
SidTypeUnknown = 8
|
||||||
SidTypeComputer = 9
|
SidTypeComputer = 9
|
||||||
|
|
||||||
|
def is_group_sid_type(type):
|
||||||
|
return type in (SidTypeGroup, SidTypeAlias, SidTypeWellKnownGroup)
|
||||||
|
|
||||||
def myntlm(x):
|
def myntlm(x):
|
||||||
hash = hashlib.new('md4', x.encode('utf-16le')).digest()
|
hash = hashlib.new('md4', x.encode('utf-16le')).digest()
|
||||||
return str(binascii.hexlify(hash))
|
return str(binascii.hexlify(hash))
|
||||||
|
@ -299,7 +302,7 @@ class Machine(object):
|
||||||
if eval(group["Name"]) != group_name:
|
if eval(group["Name"]) != group_name:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if group["SIDType"] != SidTypeGroup:
|
if not is_group_sid_type(group["SIDType"]):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
return eval(group["SID"])
|
return eval(group["SID"])
|
||||||
|
@ -316,7 +319,7 @@ class Machine(object):
|
||||||
if eval(group_user["GroupComponent"]["SID"]) != sid:
|
if eval(group_user["GroupComponent"]["SID"]) != sid:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if group_user["GroupComponent"]["SIDType"] != SidTypeGroup:
|
if not is_group_sid_type(group_user["GroupComponent"]["SIDType"]):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if "PartComponent" not in group_user.keys():
|
if "PartComponent" not in group_user.keys():
|
||||||
|
|
Loading…
Reference in New Issue