From 52767897bf9508fd760fc64efd1a6c6a0a378513 Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Wed, 20 May 2020 12:28:14 +0300 Subject: [PATCH] Removed the mechanism of adding exploited machines to blocked machine list. This mechanism was good way to assess performance improvement, but it sacrificed coverage --- monkey/monkey_island/cc/services/config.py | 4 ---- .../telemetry/processing/system_info.py | 17 ----------------- 2 files changed, 21 deletions(-) diff --git a/monkey/monkey_island/cc/services/config.py b/monkey/monkey_island/cc/services/config.py index 68a9885cd..6aef36174 100644 --- a/monkey/monkey_island/cc/services/config.py +++ b/monkey/monkey_island/cc/services/config.py @@ -318,10 +318,6 @@ class ConfigService: def is_test_telem_export_enabled(): return ConfigService.get_config_value(['internal', 'testing', 'export_monkey_telems']) - @staticmethod - def add_blocked_ip(ip_): - ConfigService.append_to_config_array(['basic_network', 'general', 'blocked_ips'], ip_) - @staticmethod def set_started_on_island(value: bool): ConfigService.set_config_value(['internal', 'general', 'started_on_island'], value) 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 7f11c1fd3..844724163 100644 --- a/monkey/monkey_island/cc/services/telemetry/processing/system_info.py +++ b/monkey/monkey_island/cc/services/telemetry/processing/system_info.py @@ -18,7 +18,6 @@ def process_system_info_telemetry(telemetry_json): process_ssh_info, process_credential_info, process_mimikatz_and_wmi_info, - try_process_network_info, dispatcher.dispatch_collector_results_to_relevant_processors ] @@ -103,19 +102,3 @@ def process_mimikatz_and_wmi_info(telemetry_json): monkey_id = NodeService.get_monkey_by_guid(telemetry_json['monkey_guid']).get('_id') wmi_handler = WMIHandler(monkey_id, telemetry_json['data']['wmi'], users_secrets) wmi_handler.process_and_handle_wmi_info() - - -def try_process_network_info(telemetry_json): - try: - process_network_info(telemetry_json) - except KeyError: - pass - - -def process_network_info(telemetry_json): - interfaces = telemetry_json['data']['network_info']['networks'] - for interface in interfaces: - ip_ = ip_address(interface['addr']) - if not ip_.is_loopback: - ConfigService.add_blocked_ip(ip_.exploded) -