From 96c9681bf1bd036df54038dbd90cbf3fa59abd90 Mon Sep 17 00:00:00 2001 From: Oran Nadler Date: Sat, 10 Mar 2018 23:58:51 -0800 Subject: [PATCH] eliminate some 'None'-s from the report --- monkey_island/cc/resources/pthmap.py | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/monkey_island/cc/resources/pthmap.py b/monkey_island/cc/resources/pthmap.py index 6caad92fc..4f2831d8e 100644 --- a/monkey_island/cc/resources/pthmap.py +++ b/monkey_island/cc/resources/pthmap.py @@ -95,6 +95,13 @@ class Machine(object): continue return eval(user["SID"]) + + if not self.IsDomainController(): + for dc in self.GetDomainControllers(): + sid = dc.GetSidByUsername(username) + + if sid != None: + return sid return None @@ -305,7 +312,12 @@ class Machine(object): SIDs = set() for username in doc["data"]["credentials"]: - SIDs.add(self.GetSidByUsername(username)) + sid = self.GetSidByUsername(username) + + if not sid: + sid = "__USERNAME__" + username + + SIDs.add(sid) return SIDs @@ -665,7 +677,12 @@ def main(): print """

SIDs cached on this machine

""" print """""" print """

Possible Attackers

""" @@ -691,7 +708,7 @@ def main(): print """

Matching SIDs

""" print """""" print "
"