forked from p15670423/monkey
* WIP added map edges and nodes generation
This commit is contained in:
parent
865bb3489d
commit
1b45029c5d
|
@ -1,4 +1,4 @@
|
||||||
from cc.services.pth_report_utils import PassTheHashReport
|
from cc.services.pth_report_utils import PassTheHashReport, Machine
|
||||||
|
|
||||||
|
|
||||||
class PTHReportService(object):
|
class PTHReportService(object):
|
||||||
|
@ -106,6 +106,14 @@ class PTHReportService(object):
|
||||||
strong_users_non_crit_list.append(machine)
|
strong_users_non_crit_list.append(machine)
|
||||||
return strong_users_non_crit_list
|
return strong_users_non_crit_list
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def generate_map_nodes(pth):
|
||||||
|
return [{"id": x, "label": Machine(x).GetIp()} for x in pth.vertices]
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def generate_map_edges(pth):
|
||||||
|
return [{"id": str(s) + str(t), "from": s, "to": t, "label": label} for s, t, label in pth.edges]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_report():
|
def get_report():
|
||||||
pth = PassTheHashReport()
|
pth = PassTheHashReport()
|
||||||
|
@ -121,7 +129,8 @@ class PTHReportService(object):
|
||||||
},
|
},
|
||||||
'map':
|
'map':
|
||||||
{
|
{
|
||||||
|
'nodes': PTHReportService.generate_map_nodes(pth),
|
||||||
|
'edges': PTHReportService.generate_map_edges(pth)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return report
|
return report
|
||||||
|
|
Loading…
Reference in New Issue