From 1ad74a4bff4cd0b7b695cdc30aae2ba5d2e8aceb Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Tue, 26 Oct 2021 17:14:02 +0300 Subject: [PATCH] BB: fix zerologon test to check propagation via SMB as well ZeroLogon doesn't propagate to the machine it only steals the credentials. It's best to make sure that propagation is also possible by running SMB exploiter --- envs/monkey_zoo/blackbox/config_templates/zerologon.py | 2 +- envs/monkey_zoo/blackbox/test_blackbox.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/envs/monkey_zoo/blackbox/config_templates/zerologon.py b/envs/monkey_zoo/blackbox/config_templates/zerologon.py index 93ebd5301..0c0266857 100644 --- a/envs/monkey_zoo/blackbox/config_templates/zerologon.py +++ b/envs/monkey_zoo/blackbox/config_templates/zerologon.py @@ -10,7 +10,7 @@ class Zerologon(ConfigTemplate): config_values.update( { - "basic.exploiters.exploiter_classes": ["ZerologonExploiter"], + "basic.exploiters.exploiter_classes": ["ZerologonExploiter", "SmbExploiter"], "basic_network.scope.subnet_scan_list": ["10.2.2.25"], # Empty list to make sure ZeroLogon adds "Administrator" username "basic.credentials.exploit_user_list": [], diff --git a/envs/monkey_zoo/blackbox/test_blackbox.py b/envs/monkey_zoo/blackbox/test_blackbox.py index cc4d6ba97..3b74f8961 100644 --- a/envs/monkey_zoo/blackbox/test_blackbox.py +++ b/envs/monkey_zoo/blackbox/test_blackbox.py @@ -221,7 +221,10 @@ class TestMonkeyBlackbox: "2864b62ea4496934a5d6e86f50b834a5", ] raw_config = IslandConfigParser.get_raw_config(Zerologon, island_client) - analyzer = ZerologonAnalyzer(island_client, expected_creds) + zero_logon_analyzer = ZerologonAnalyzer(island_client, expected_creds) + communication_analyzer = CommunicationAnalyzer( + island_client, IslandConfigParser.get_ips_of_targets(raw_config) + ) log_handler = TestLogsHandler( test_name, island_client, TestMonkeyBlackbox.get_log_dir_path() ) @@ -229,7 +232,7 @@ class TestMonkeyBlackbox: name=test_name, island_client=island_client, raw_config=raw_config, - analyzers=[analyzer], + analyzers=[zero_logon_analyzer, communication_analyzer], timeout=DEFAULT_TIMEOUT_SECONDS, log_handler=log_handler, ).run()