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():
""".format(username=pth.GetUsernameBySid(sid), sid=sid, secret=pth.GetSecretBySid(sid), domain=pth.GetSidInfo(sid)["Domain"])
- print """Attackable Machines
"""
+ print """Possible Victims Machines
"""
print """"""
for m in pth.GetVictimsBySid(sid):
print """- {ip} ({hostname})
""".format(ip=m.GetIp(), hostname=m.GetHostName())
print """
"""
+
+ print """Possible Attackers Machines
"""
+ print """"""
+ for m in pth.GetAttackersBySid(sid):
+ print """- {ip} ({hostname})
""".format(ip=m.GetIp(), hostname=m.GetHostName())
+ print """
"""
for secret in pth.GetAllSecrets():
print """Secret '{secret}'
""".format(secret=secret)