From 280df4e67643f68848b4d88cd281f538022048b7 Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Mon, 29 Mar 2021 17:41:23 +0300 Subject: [PATCH] Fixed a bug in report backend --- monkey/monkey_island/cc/services/reporting/report.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/monkey/monkey_island/cc/services/reporting/report.py b/monkey/monkey_island/cc/services/reporting/report.py index 181b8616b..42adfd5a2 100644 --- a/monkey/monkey_island/cc/services/reporting/report.py +++ b/monkey/monkey_island/cc/services/reporting/report.py @@ -264,7 +264,7 @@ class ReportService: return exploiter_info @staticmethod - def get_exploits(): + def get_exploits() -> dict: query = [{'$match': {'telem_category': 'exploit', 'data.result': True}}, {'$group': {'_id': {'ip_address': '$data.machine.ip_addr'}, 'data': {'$first': '$$ROOT'}, @@ -274,7 +274,7 @@ class ReportService: for exploit in mongo.db.telemetry.aggregate(query): new_exploit = ReportService.process_exploit(exploit) if new_exploit not in exploits: - exploits.append(new_exploit) + exploits.append(new_exploit.__dict__) return exploits @staticmethod @@ -594,6 +594,7 @@ class ReportService: @staticmethod def get_issues(): + # Todo refactor these into separate files with a method signature -> dict ISSUE_GENERATORS = [ ReportService.get_exploits, ReportService.get_tunnels,