From 37d37b6f9f7b700afbb374566583bf97c3c0c8d8 Mon Sep 17 00:00:00 2001 From: Shreya Date: Mon, 22 Jun 2020 02:09:47 +0530 Subject: [PATCH] Fix status being sent in report data --- .../cc/services/attack/technique_reports/T1158.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/monkey/monkey_island/cc/services/attack/technique_reports/T1158.py b/monkey/monkey_island/cc/services/attack/technique_reports/T1158.py index d0818c07f..f3615c2ff 100644 --- a/monkey/monkey_island/cc/services/attack/technique_reports/T1158.py +++ b/monkey/monkey_island/cc/services/attack/technique_reports/T1158.py @@ -18,14 +18,13 @@ class T1158(AttackTechnique): data = {'title': T1158.technique_title(), 'info': []} scanned_nodes = ReportService.get_scanned() - status = ScanStatus.UNSCANNED.value + status = [] for node in scanned_nodes: if node['pba_results'] != 'None': for pba in node['pba_results']: if pba['name'] == POST_BREACH_HIDDEN_FILES: - status = ScanStatus.USED.value if pba['result'][1]\ - else ScanStatus.SCANNED.value + status.append(pba['result'][1]) data['info'].append({ 'machine': { 'hostname': pba['hostname'], @@ -33,5 +32,7 @@ class T1158(AttackTechnique): }, 'result': pba['result'][0] }) - data.update(T1158.get_base_data_by_status(status)) + status = (ScanStatus.USED.value if any(status) else ScanStatus.SCANNED.value)\ + if status else ScanStatus.UNSCANNEDvalue + data.update(T1158.get_base_data_by_status(status)) return data