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