From 76709e385ece439724ffb9b016c40277e8dc1659 Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Mon, 15 Nov 2021 16:39:12 +0100 Subject: [PATCH 1/4] Agent: Set constant monkey dir name --- monkey/infection_monkey/config.py | 3 --- monkey/infection_monkey/example.conf | 2 -- monkey/infection_monkey/utils/monkey_dir.py | 4 ++-- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/monkey/infection_monkey/config.py b/monkey/infection_monkey/config.py index d25ff7ebe..8d33af8fd 100644 --- a/monkey/infection_monkey/config.py +++ b/monkey/infection_monkey/config.py @@ -129,9 +129,6 @@ class Configuration(object): keep_tunnel_open_time = 60 - # Monkey files directory name - monkey_dir_name = "monkey_dir" - ########################### # scanners config ########################### diff --git a/monkey/infection_monkey/example.conf b/monkey/infection_monkey/example.conf index 7576b5095..556bdfcaa 100644 --- a/monkey/infection_monkey/example.conf +++ b/monkey/infection_monkey/example.conf @@ -23,8 +23,6 @@ "dropper_target_path_win_64": "C:\\Windows\\temp\\monkey64.exe", "dropper_target_path_linux": "/tmp/monkey", - "monkey_dir_name": "monkey_dir", - "exploiter_classes": [ "SSHExploiter", "SmbExploiter", diff --git a/monkey/infection_monkey/utils/monkey_dir.py b/monkey/infection_monkey/utils/monkey_dir.py index bb69dae5b..c705c233f 100644 --- a/monkey/infection_monkey/utils/monkey_dir.py +++ b/monkey/infection_monkey/utils/monkey_dir.py @@ -2,7 +2,7 @@ import os import shutil import tempfile -from infection_monkey.config import WormConfiguration +MONKEY_DIR_NAME = "monkey_dir" def create_monkey_dir(): @@ -26,4 +26,4 @@ def remove_monkey_dir(): def get_monkey_dir_path(): - return os.path.join(tempfile.gettempdir(), WormConfiguration.monkey_dir_name) + return os.path.join(tempfile.gettempdir(), MONKEY_DIR_NAME) From f9e73dc3e4de78cdc541ac6d03ad442f0f11c5fd Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Mon, 15 Nov 2021 16:39:52 +0100 Subject: [PATCH 2/4] Island: Remove monkey dir name input --- monkey/monkey_island/cc/services/config_schema/internal.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/monkey/monkey_island/cc/services/config_schema/internal.py b/monkey/monkey_island/cc/services/config_schema/internal.py index f90a545ef..86318eaf1 100644 --- a/monkey/monkey_island/cc/services/config_schema/internal.py +++ b/monkey/monkey_island/cc/services/config_schema/internal.py @@ -15,13 +15,6 @@ INTERNAL = { "description": "Time to keep tunnel open before going down after last exploit " "(in seconds)", }, - "monkey_dir_name": { - "title": "Monkey's directory name", - "type": "string", - "default": r"monkey_dir", - "description": "Directory name for the directory which will contain all of the" - " monkey files", - }, "started_on_island": { "title": "Started on island", "type": "boolean", From 8497748de042be0c005a1602a9c35236e28561d3 Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Mon, 15 Nov 2021 16:40:25 +0100 Subject: [PATCH 3/4] UT: Remove monkey dir name --- .../data_for_tests/monkey_configs/monkey_config_standard.json | 1 - 1 file changed, 1 deletion(-) 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 17239aa59..d27f142e7 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 @@ -45,7 +45,6 @@ "internal": { "general": { "keep_tunnel_open_time": 60, - "monkey_dir_name": "monkey_dir", "started_on_island": false }, "monkey": { From 729de3ae9ed93317a3e052a6c5a7de31f3fc1153 Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Mon, 15 Nov 2021 16:46:22 +0100 Subject: [PATCH 4/4] Changelog: Add entry for removing custom monkey dir name option --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 218e3af6a..02a9d386d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ Changelog](https://keepachangelog.com/en/1.0.0/). - Checkbox that gave the option to not try to first move the dropper file. #1537 - Custom singleton mutex name config option. #1589 - Azure credential collector, because it was broken (not gathering credentials). #1535 +- Custom monkey directory name config option. #1537 ### Fixed - A bug in network map page that caused delay of telemetry log loading. #1545