From 2a09d54ed12587eaf6ed6c69397a500d638b49ae Mon Sep 17 00:00:00 2001 From: Shay Nehmad Date: Sun, 19 Jan 2020 21:45:31 +0200 Subject: [PATCH] Fixed dict bugs + server config --- monkey/monkey_island/cc/server_config.json | 2 +- .../cc/services/telemetry/processing/system_info.py | 3 ++- .../telemetry/processing/system_info_collectors/environment.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/monkey/monkey_island/cc/server_config.json b/monkey/monkey_island/cc/server_config.json index 7bf106194..420f1b303 100644 --- a/monkey/monkey_island/cc/server_config.json +++ b/monkey/monkey_island/cc/server_config.json @@ -1,4 +1,4 @@ { - "server_config": "testing", + "server_config": "standard", "deployment": "develop" } diff --git a/monkey/monkey_island/cc/services/telemetry/processing/system_info.py b/monkey/monkey_island/cc/services/telemetry/processing/system_info.py index 6734c6725..d4368469e 100644 --- a/monkey/monkey_island/cc/services/telemetry/processing/system_info.py +++ b/monkey/monkey_island/cc/services/telemetry/processing/system_info.py @@ -117,4 +117,5 @@ def process_mimikatz_and_wmi_info(telemetry_json): def update_db_with_new_hostname(telemetry_json): - Monkey.get_single_monkey_by_guid(telemetry_json['monkey_guid']).set_hostname(telemetry_json['data']['hostname']) + if 'hostname' in telemetry_json['data']: + Monkey.get_single_monkey_by_guid(telemetry_json['monkey_guid']).set_hostname(telemetry_json['data']['hostname']) diff --git a/monkey/monkey_island/cc/services/telemetry/processing/system_info_collectors/environment.py b/monkey/monkey_island/cc/services/telemetry/processing/system_info_collectors/environment.py index 9ddee70ce..4c685a01b 100644 --- a/monkey/monkey_island/cc/services/telemetry/processing/system_info_collectors/environment.py +++ b/monkey/monkey_island/cc/services/telemetry/processing/system_info_collectors/environment.py @@ -7,6 +7,6 @@ logger = logging.getLogger(__name__) def process_environment_telemetry(collector_results, monkey_guid): relevant_monkey = Monkey.get_single_monkey_by_guid(monkey_guid) - relevant_monkey.environment = collector_results + relevant_monkey.environment = collector_results["environment"] relevant_monkey.save() logger.debug("Updated Monkey {} with env {}".format(str(relevant_monkey), collector_results))