From 8d2e530eaab3db9c602ce1ab9ff140dbebb8e9d0 Mon Sep 17 00:00:00 2001 From: Shreya Date: Sat, 27 Feb 2021 01:04:52 +0530 Subject: [PATCH] Show IP if domain name isn't available --- monkey/monkey_island/cc/services/reporting/report.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/monkey/monkey_island/cc/services/reporting/report.py b/monkey/monkey_island/cc/services/reporting/report.py index eabbfb051..fa3bd5f94 100644 --- a/monkey/monkey_island/cc/services/reporting/report.py +++ b/monkey/monkey_island/cc/services/reporting/report.py @@ -206,9 +206,11 @@ class ReportService: def _get_credentials_from_exploit_telems(): formatted_creds = [] for telem in mongo.db.telemetry.find({'telem_category': 'exploit', 'data.info.credentials': {'$exists': True}}, - {'data.info.credentials': 1, 'monkey_guid': 1}): + {'data.info.credentials': 1, 'data.machine': 1, 'monkey_guid': 1}): creds = telem['data']['info']['credentials'] - origin = telem['data']['machine']['domain_name'] + _domain_name = telem['data']['machine']['domain_name'] + _ip = telem['data']['machine']['ip_addr'] + origin = _domain_name if _domain_name else _ip formatted_creds.extend(ReportService._format_creds_for_reporting(telem, creds, origin)) return formatted_creds