shared users seems to work

This commit is contained in:
Oran Nadler 2018-04-30 18:15:10 +03:00
parent 8ab880340f
commit 9594fab1a2
1 changed files with 5 additions and 2 deletions

View File

@ -48,6 +48,9 @@ def cache(foo):
if type(o) in (int, float, str, unicode): if type(o) in (int, float, str, unicode):
return o return o
elif type(o) in (type(None),):
return "___None___"
elif type(o) in (list, tuple, set): elif type(o) in (list, tuple, set):
hashed = tuple([hash(x) for x in o]) hashed = tuple([hash(x) for x in o])
@ -465,7 +468,7 @@ class Machine(object):
domain_admins = set() domain_admins = set()
for dc in DCs: for dc in DCs:
domain_admins |= dc.GetUsersByGroupSid(self.GetGroupSidByGroupName("Domain Admins")) domain_admins |= set(dc.GetUsersByGroupSid(self.GetGroupSidByGroupName("Domain Admins")).keys())
return domain_admins return domain_admins
@ -899,7 +902,7 @@ def main():
print """<td><ul>""" print """<td><ul>"""
for sid in pth.GetThreateningUsersByVictim(m): for sid in pth.GetSharedAdmins(m):
print """<li><a href="#{sid}">{username}</a></li>""".format(sid=sid, username=pth.GetUsernameBySid(sid)) print """<li><a href="#{sid}">{username}</a></li>""".format(sid=sid, username=pth.GetUsernameBySid(sid))
print """</ul></td></tr>""" print """</ul></td></tr>"""