From b859b8820f5b666144831a08ff8c3f43ec79083c Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Wed, 23 Feb 2022 17:26:25 +0100 Subject: [PATCH] Island: Add HTTP_PORTS to exploiter common options --- monkey/monkey_island/cc/services/config.py | 2 ++ .../tests/unit_tests/monkey_island/cc/services/test_config.py | 1 + 2 files changed, 3 insertions(+) diff --git a/monkey/monkey_island/cc/services/config.py b/monkey/monkey_island/cc/services/config.py index 19a2a4497..0fc3af855 100644 --- a/monkey/monkey_island/cc/services/config.py +++ b/monkey/monkey_island/cc/services/config.py @@ -611,6 +611,8 @@ class ConfigService: ]: exploit_options[dropper_target] = config.get(dropper_target, "") + exploit_options["http_ports"] = sorted(config["HTTP_PORTS"]) + formatted_exploiters_config = { "options": exploit_options, "brute_force": [], diff --git a/monkey/tests/unit_tests/monkey_island/cc/services/test_config.py b/monkey/tests/unit_tests/monkey_island/cc/services/test_config.py index 58e762036..2ac3fbe6a 100644 --- a/monkey/tests/unit_tests/monkey_island/cc/services/test_config.py +++ b/monkey/tests/unit_tests/monkey_island/cc/services/test_config.py @@ -175,6 +175,7 @@ def test_format_config_for_agent__exploiters(flat_monkey_config): "dropper_target_path_linux": "/tmp/monkey", "dropper_target_path_win_32": r"C:\Windows\temp\monkey32.exe", "dropper_target_path_win_64": r"C:\Windows\temp\monkey64.exe", + "http_ports": [80, 443, 7001, 8008, 8080, 9200], }, "brute_force": [ {"name": "MSSQLExploiter", "options": {}},