From d0ce419ae04672170e9a10e1df6434d84939fe66 Mon Sep 17 00:00:00 2001 From: Oran Nadler Date: Tue, 15 May 2018 13:07:19 +0300 Subject: [PATCH] add GetAttackersBySid --- monkey_island/cc/resources/pthmap.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/monkey_island/cc/resources/pthmap.py b/monkey_island/cc/resources/pthmap.py index a53277e5d..68a0c998e 100644 --- a/monkey_island/cc/resources/pthmap.py +++ b/monkey_island/cc/resources/pthmap.py @@ -831,6 +831,16 @@ class PassTheHashMap(object): return set(map(Machine, attackers)) + @cache + def GetAttackersBySid(self, sid): + machines = set() + + for m in self.machines: + if sid in self.GetCachedSids(m): + machines.add(m) + + return machines + @cache def GetVictimsByAttacker(self, attacker): if type(attacker) != unicode: @@ -1166,11 +1176,17 @@ def main():

Secret: '{secret}'

""".format(username=pth.GetUsernameBySid(sid), sid=sid, secret=pth.GetSecretBySid(sid), domain=pth.GetSidInfo(sid)["Domain"]) - print """

Attackable Machines

""" + print """

Possible Victims Machines

""" print """""" + + print """

Possible Attackers Machines

""" + print """""" for secret in pth.GetAllSecrets(): print """

Secret '{secret}'

""".format(secret=secret)