Fix bug in telemetry

This commit is contained in:
Itay Mizeretz 2018-01-19 13:00:38 +02:00
parent a76cf7e3f8
commit 74deebb280
1 changed files with 5 additions and 3 deletions

View File

@ -123,9 +123,11 @@ class Telemetry(flask_restful.Resource):
for attempt in telemetry_json['data']['attempts']: for attempt in telemetry_json['data']['attempts']:
if attempt['result']: if attempt['result']:
attempt.pop('result') found_creds = {'user': attempt['user']}
[attempt.pop(field) for field in ['password', 'lm_hash', 'ntlm_hash'] if len(attempt[field]) == 0] for field in ['password', 'lm_hash', 'ntlm_hash']:
NodeService.add_credentials_to_node(edge['to'], attempt) if len(attempt[field]) != 0:
found_creds[field] = attempt[field]
NodeService.add_credentials_to_node(edge['to'], found_creds)
@staticmethod @staticmethod
def process_scan_telemetry(telemetry_json): def process_scan_telemetry(telemetry_json):