From b56f05335ba4815e06a1b0cc87f0014a2db3e901 Mon Sep 17 00:00:00 2001 From: Oran Nadler Date: Tue, 6 Mar 2018 23:36:04 -0800 Subject: [PATCH] fix todo --- monkey_island/cc/resources/pthmap.py | 29 ++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/monkey_island/cc/resources/pthmap.py b/monkey_island/cc/resources/pthmap.py index db3952e17..c4a770f51 100644 --- a/monkey_island/cc/resources/pthmap.py +++ b/monkey_island/cc/resources/pthmap.py @@ -1,9 +1,9 @@ -import flask_restful - -from cc.auth import jwt_required -from cc.services.edge import EdgeService -from cc.services.node import NodeService -from cc.database import mongo +#import flask_restful +# +#from cc.auth import jwt_required +#from cc.services.edge import EdgeService +#from cc.services.node import NodeService +#from cc.database import mongo import hashlib import binascii @@ -521,7 +521,13 @@ class PassTheHashMap(object): return machines def GetAttackersByVictim(self, victim): - assert False, "TODO, get information from the graph" + attackers = set() + + for atck, vic in self.edge: + if vic == victim: + attackers.add(atck) + + return attackers def main(): pth = PassTheHashMap() @@ -585,15 +591,22 @@ def main():

Hostname '{hostname}'

""".format{ip=m.GetIp(), hostname=m.GetHostName()} print """

Cached SIDs

""" + print """

SIDs cached on this machine

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

Possible Attackers

""" - print """

TODO. see graph.

""" # pth.GetAttackersByVictim(m) + print """

Machines that can attack this machine

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

Admins

""" + print """

Users that have admin rights on this machine

""" print """