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']:
if attempt['result']:
attempt.pop('result')
[attempt.pop(field) for field in ['password', 'lm_hash', 'ntlm_hash'] if len(attempt[field]) == 0]
NodeService.add_credentials_to_node(edge['to'], attempt)
found_creds = {'user': attempt['user']}
for field in ['password', 'lm_hash', 'ntlm_hash']:
if len(attempt[field]) != 0:
found_creds[field] = attempt[field]
NodeService.add_credentials_to_node(edge['to'], found_creds)
@staticmethod
def process_scan_telemetry(telemetry_json):