From 4966c74214a83684d0484fa6b00f6ae8d19c97bf Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Wed, 10 Nov 2021 18:40:35 +0530 Subject: [PATCH 1/5] Agent: Remove kill file config option --- monkey/infection_monkey/config.py | 6 ------ monkey/infection_monkey/example.conf | 2 -- monkey/infection_monkey/main.py | 10 ---------- 3 files changed, 18 deletions(-) diff --git a/monkey/infection_monkey/config.py b/monkey/infection_monkey/config.py index 433f11541..8756926f1 100644 --- a/monkey/infection_monkey/config.py +++ b/monkey/infection_monkey/config.py @@ -96,12 +96,6 @@ class Configuration(object): dropper_target_path_win_64 = r"C:\Windows\temp\monkey64.exe" dropper_target_path_linux = "/tmp/monkey" - ########################### - # Kill file - ########################### - kill_file_path_windows = "%windir%\\monkey.not" - kill_file_path_linux = "/var/run/monkey.not" - ########################### # monkey config ########################### diff --git a/monkey/infection_monkey/example.conf b/monkey/infection_monkey/example.conf index d9acee9ed..1cd4dc9d5 100644 --- a/monkey/infection_monkey/example.conf +++ b/monkey/infection_monkey/example.conf @@ -26,8 +26,6 @@ "monkey_dir_name": "monkey_dir", - "kill_file_path_linux": "/var/run/monkey.not", - "kill_file_path_windows": "%windir%\\monkey.not", "dropper_try_move_first": true, "exploiter_classes": [ "SSHExploiter", diff --git a/monkey/infection_monkey/main.py b/monkey/infection_monkey/main.py index 07270a86e..291f35d32 100644 --- a/monkey/infection_monkey/main.py +++ b/monkey/infection_monkey/main.py @@ -78,16 +78,6 @@ def main(): formatted_config = pformat(WormConfiguration.hide_sensitive_info(WormConfiguration.as_dict())) print(f"Loaded Configuration:\n{formatted_config}") - # Make sure we're not in a machine that has the kill file - kill_path = ( - os.path.expandvars(WormConfiguration.kill_file_path_windows) - if sys.platform == "win32" - else WormConfiguration.kill_file_path_linux - ) - if os.path.exists(kill_path): - print("Kill path found, finished run") - return True - try: if MONKEY_ARG == monkey_mode: log_path = get_monkey_log_path() From 572797938318de9cd517b1df99bac7d8c07e7f80 Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Wed, 10 Nov 2021 18:42:12 +0530 Subject: [PATCH 2/5] Island: Remove kill file config option --- .../cc/services/config_schema/internal.py | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/monkey/monkey_island/cc/services/config_schema/internal.py b/monkey/monkey_island/cc/services/config_schema/internal.py index 84baa6ca5..df59d4054 100644 --- a/monkey/monkey_island/cc/services/config_schema/internal.py +++ b/monkey/monkey_island/cc/services/config_schema/internal.py @@ -213,24 +213,6 @@ INTERNAL = { } }, }, - "kill_file": { - "title": "Kill file", - "type": "object", - "properties": { - "kill_file_path_windows": { - "title": "Kill file path on Windows", - "type": "string", - "default": "%windir%\\monkey.not", - "description": "Path of file which kills monkey if it exists (on Windows)", - }, - "kill_file_path_linux": { - "title": "Kill file path on Linux", - "type": "string", - "default": "/var/run/monkey.not", - "description": "Path of file which kills monkey if it exists (on Linux)", - }, - }, - }, "dropper": { "title": "Dropper", "type": "object", From 0989134141432749467ef447ebbb7f0062368a1d Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Wed, 10 Nov 2021 18:44:36 +0530 Subject: [PATCH 3/5] UI: Remove kill file tab from config --- .../ui/src/components/configuration-components/InternalConfig.js | 1 - 1 file changed, 1 deletion(-) diff --git a/monkey/monkey_island/cc/ui/src/components/configuration-components/InternalConfig.js b/monkey/monkey_island/cc/ui/src/components/configuration-components/InternalConfig.js index 784931cbb..70f1e86fa 100644 --- a/monkey/monkey_island/cc/ui/src/components/configuration-components/InternalConfig.js +++ b/monkey/monkey_island/cc/ui/src/components/configuration-components/InternalConfig.js @@ -11,7 +11,6 @@ const sectionOrder = [ 'dropper', 'classes', 'general', - 'kill_file', 'testing' ]; const initialSection = sectionOrder[0]; From 45dcceff9e8715aaa93e345bf283abd68d679f0e Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Wed, 10 Nov 2021 18:45:05 +0530 Subject: [PATCH 4/5] UT: Remove kill file config option from unit test data's config --- .../data_for_tests/monkey_configs/monkey_config_standard.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/monkey/tests/data_for_tests/monkey_configs/monkey_config_standard.json b/monkey/tests/data_for_tests/monkey_configs/monkey_config_standard.json index c1857c639..709c8e2c8 100644 --- a/monkey/tests/data_for_tests/monkey_configs/monkey_config_standard.json +++ b/monkey/tests/data_for_tests/monkey_configs/monkey_config_standard.json @@ -114,10 +114,6 @@ "ElasticFinger" ] }, - "kill_file": { - "kill_file_path_windows": "%windir%\\monkey.not", - "kill_file_path_linux": "/var/run/monkey.not" - }, "dropper": { "dropper_set_date": true, "dropper_date_reference_path_windows": "%windir%\\system32\\kernel32.dll", From 124e9efe9141a03948e2a9e468ea9723b5242cf5 Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Wed, 10 Nov 2021 18:49:41 +0530 Subject: [PATCH 5/5] Changelog: Add entry for removing 'kill file' --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e8d60747..d7be9cde2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ Changelog](https://keepachangelog.com/en/1.0.0/). ### Removed - The VSFTPD exploiter. #1533 - Manual agent run command for CMD. #1570 +- "Kill file" option in the config. #1536 ### Fixed - A bug in network map page that caused delay of telemetry log loading. #1545