Fix status being sent in report data

This commit is contained in:
Shreya 2020-06-22 02:09:47 +05:30
parent 3819041632
commit 37d37b6f9f
1 changed files with 5 additions and 4 deletions

View File

@ -18,14 +18,13 @@ class T1158(AttackTechnique):
data = {'title': T1158.technique_title(), 'info': []} data = {'title': T1158.technique_title(), 'info': []}
scanned_nodes = ReportService.get_scanned() scanned_nodes = ReportService.get_scanned()
status = ScanStatus.UNSCANNED.value status = []
for node in scanned_nodes: for node in scanned_nodes:
if node['pba_results'] != 'None': if node['pba_results'] != 'None':
for pba in node['pba_results']: for pba in node['pba_results']:
if pba['name'] == POST_BREACH_HIDDEN_FILES: if pba['name'] == POST_BREACH_HIDDEN_FILES:
status = ScanStatus.USED.value if pba['result'][1]\ status.append(pba['result'][1])
else ScanStatus.SCANNED.value
data['info'].append({ data['info'].append({
'machine': { 'machine': {
'hostname': pba['hostname'], 'hostname': pba['hostname'],
@ -33,5 +32,7 @@ class T1158(AttackTechnique):
}, },
'result': pba['result'][0] '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 return data