From db5187fc7481606a9c6f175bd1e703d44bc25d0e Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Thu, 21 Jul 2022 13:30:02 +0530 Subject: [PATCH] BB: Remove config templates --- .../blackbox/config_templates/__init__.py | 0 .../config_templates/base_template.py | 15 ------ .../config_templates/config_template.py | 8 ---- .../blackbox/config_templates/depth_1_a.py | 42 ---------------- .../blackbox/config_templates/depth_2_a.py | 23 --------- .../blackbox/config_templates/depth_3_a.py | 48 ------------------- .../powershell_credentials_reuse.py | 21 -------- .../blackbox/config_templates/smb_pth.py | 24 ---------- .../blackbox/config_templates/wmi_mimikatz.py | 22 --------- .../blackbox/config_templates/zerologon.py | 20 -------- 10 files changed, 223 deletions(-) delete mode 100644 envs/monkey_zoo/blackbox/config_templates/__init__.py delete mode 100644 envs/monkey_zoo/blackbox/config_templates/base_template.py delete mode 100644 envs/monkey_zoo/blackbox/config_templates/config_template.py delete mode 100644 envs/monkey_zoo/blackbox/config_templates/depth_1_a.py delete mode 100644 envs/monkey_zoo/blackbox/config_templates/depth_2_a.py delete mode 100644 envs/monkey_zoo/blackbox/config_templates/depth_3_a.py delete mode 100644 envs/monkey_zoo/blackbox/config_templates/powershell_credentials_reuse.py delete mode 100644 envs/monkey_zoo/blackbox/config_templates/smb_pth.py delete mode 100644 envs/monkey_zoo/blackbox/config_templates/wmi_mimikatz.py delete mode 100644 envs/monkey_zoo/blackbox/config_templates/zerologon.py diff --git a/envs/monkey_zoo/blackbox/config_templates/__init__.py b/envs/monkey_zoo/blackbox/config_templates/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/envs/monkey_zoo/blackbox/config_templates/base_template.py b/envs/monkey_zoo/blackbox/config_templates/base_template.py deleted file mode 100644 index 5a1ce49a6..000000000 --- a/envs/monkey_zoo/blackbox/config_templates/base_template.py +++ /dev/null @@ -1,15 +0,0 @@ -from envs.monkey_zoo.blackbox.config_templates.config_template import ConfigTemplate - - -# Disables a lot of config values not required for a specific feature test -class BaseTemplate(ConfigTemplate): - - config_values = { - "basic.exploiters.exploiter_classes": [], - "basic_network.scope.local_network_scan": False, - "basic_network.scope.depth": 1, - "internal.classes.finger_classes": ["HTTPFinger"], - "internal.monkey.system_info.system_info_collector_classes": [], - "monkey.post_breach.post_breach_actions": [], - "internal.general.keep_tunnel_open_time": 0, - } diff --git a/envs/monkey_zoo/blackbox/config_templates/config_template.py b/envs/monkey_zoo/blackbox/config_templates/config_template.py deleted file mode 100644 index 915a0cc78..000000000 --- a/envs/monkey_zoo/blackbox/config_templates/config_template.py +++ /dev/null @@ -1,8 +0,0 @@ -from abc import ABC, abstractmethod - - -class ConfigTemplate(ABC): - @property - @abstractmethod - def config_values(self) -> dict: - pass diff --git a/envs/monkey_zoo/blackbox/config_templates/depth_1_a.py b/envs/monkey_zoo/blackbox/config_templates/depth_1_a.py deleted file mode 100644 index b09123566..000000000 --- a/envs/monkey_zoo/blackbox/config_templates/depth_1_a.py +++ /dev/null @@ -1,42 +0,0 @@ -from copy import copy - -from envs.monkey_zoo.blackbox.config_templates.base_template import BaseTemplate -from envs.monkey_zoo.blackbox.config_templates.config_template import ConfigTemplate - - -class Depth1A(ConfigTemplate): - config_values = copy(BaseTemplate.config_values) - # Tests: - # Hadoop (10.2.2.2, 10.2.2.3) - # Log4shell (10.2.3.55, 10.2.3.56, 10.2.3.49, 10.2.3.50, 10.2.3.51, 10.2.3.52) - # MSSQL (10.2.2.16) - # SMB mimikatz password stealing and brute force (10.2.2.14 and 10.2.2.15) - config_values.update( - { - "basic.exploiters.exploiter_classes": [ - "HadoopExploiter", - "Log4ShellExploiter", - "MSSQLExploiter", - "SmbExploiter", - "SSHExploiter", - ], - "basic_network.scope.subnet_scan_list": [ - "10.2.2.2", - "10.2.2.3", - "10.2.3.55", - "10.2.3.56", - "10.2.3.49", - "10.2.3.50", - "10.2.3.51", - "10.2.3.52", - "10.2.2.16", - "10.2.2.14", - "10.2.2.15", - ], - "basic.credentials.exploit_password_list": ["Ivrrw5zEzs", "Xk8VDTsC"], - "basic.credentials.exploit_user_list": ["m0nk3y"], - "monkey.system_info.system_info_collector_classes": [ - "MimikatzCollector", - ], - } - ) diff --git a/envs/monkey_zoo/blackbox/config_templates/depth_2_a.py b/envs/monkey_zoo/blackbox/config_templates/depth_2_a.py deleted file mode 100644 index d9f5168e2..000000000 --- a/envs/monkey_zoo/blackbox/config_templates/depth_2_a.py +++ /dev/null @@ -1,23 +0,0 @@ -from copy import copy - -from envs.monkey_zoo.blackbox.config_templates.base_template import BaseTemplate -from envs.monkey_zoo.blackbox.config_templates.config_template import ConfigTemplate - - -class Depth2A(ConfigTemplate): - config_values = copy(BaseTemplate.config_values) - # SSH password and key brute-force, key stealing (10.2.2.11, 10.2.2.12) - config_values.update( - { - "basic.exploiters.exploiter_classes": [ - "SSHExploiter", - ], - "basic_network.scope.subnet_scan_list": [ - "10.2.2.11", - "10.2.2.12", - ], - "basic_network.scope.depth": 2, - "basic.credentials.exploit_password_list": ["^NgDvY59~8"], - "basic.credentials.exploit_user_list": ["m0nk3y"], - } - ) diff --git a/envs/monkey_zoo/blackbox/config_templates/depth_3_a.py b/envs/monkey_zoo/blackbox/config_templates/depth_3_a.py deleted file mode 100644 index 7e74f8751..000000000 --- a/envs/monkey_zoo/blackbox/config_templates/depth_3_a.py +++ /dev/null @@ -1,48 +0,0 @@ -from copy import copy - -from envs.monkey_zoo.blackbox.config_templates.base_template import BaseTemplate -from envs.monkey_zoo.blackbox.config_templates.config_template import ConfigTemplate - - -class Depth3A(ConfigTemplate): - config_values = copy(BaseTemplate.config_values) - - # Tests: - # Powershell (10.2.3.45, 10.2.3.46, 10.2.3.47, 10.2.3.48) - # Tunneling (SSH brute force) (10.2.2.9, 10.2.1.10, 10.2.0.12, 10.2.0.11) - # WMI pass the hash (10.2.2.15) - config_values.update( - { - "basic.exploiters.exploiter_classes": [ - "PowerShellExploiter", - "SSHExploiter", - "WmiExploiter", - ], - "basic_network.scope.subnet_scan_list": [ - "10.2.2.9", - "10.2.3.45", - "10.2.3.46", - "10.2.3.47", - "10.2.3.48", - "10.2.1.10", - "10.2.0.12", - "10.2.0.11", - "10.2.2.15", - ], - "basic.credentials.exploit_password_list": [ - "Passw0rd!", - "3Q=(Ge(+&w]*", - "`))jU7L(w}", - "t67TC5ZDmz", - ], - "basic_network.scope.depth": 3, - "internal.general.keep_tunnel_open_time": 20, - "basic.credentials.exploit_user_list": ["m0nk3y", "m0nk3y-user"], - "internal.network.tcp_scanner.HTTP_PORTS": [], - "internal.exploits.exploit_ntlm_hash_list": [ - "d0f0132b308a0c4e5d1029cc06f48692", - "5da0889ea2081aa79f6852294cba4a5e", - "50c9987a6bf1ac59398df9f911122c9b", - ], - } - ) diff --git a/envs/monkey_zoo/blackbox/config_templates/powershell_credentials_reuse.py b/envs/monkey_zoo/blackbox/config_templates/powershell_credentials_reuse.py deleted file mode 100644 index 622cb6656..000000000 --- a/envs/monkey_zoo/blackbox/config_templates/powershell_credentials_reuse.py +++ /dev/null @@ -1,21 +0,0 @@ -from copy import copy - -from envs.monkey_zoo.blackbox.config_templates.base_template import BaseTemplate -from envs.monkey_zoo.blackbox.config_templates.config_template import ConfigTemplate - - -class PowerShellCredentialsReuse(ConfigTemplate): - config_values = copy(BaseTemplate.config_values) - - config_values.update( - { - "basic.exploiters.exploiter_classes": ["PowerShellExploiter"], - "basic_network.scope.subnet_scan_list": [ - "10.2.3.46", - ], - "basic_network.scope.depth": 2, - "internal.classes.finger_classes": [], - "internal.network.tcp_scanner.HTTP_PORTS": [], - "internal.network.tcp_scanner.tcp_target_ports": [5985, 5986], - } - ) diff --git a/envs/monkey_zoo/blackbox/config_templates/smb_pth.py b/envs/monkey_zoo/blackbox/config_templates/smb_pth.py deleted file mode 100644 index cd9fed272..000000000 --- a/envs/monkey_zoo/blackbox/config_templates/smb_pth.py +++ /dev/null @@ -1,24 +0,0 @@ -from copy import copy - -from envs.monkey_zoo.blackbox.config_templates.base_template import BaseTemplate -from envs.monkey_zoo.blackbox.config_templates.config_template import ConfigTemplate - - -class SmbPth(ConfigTemplate): - config_values = copy(BaseTemplate.config_values) - - config_values.update( - { - "basic.exploiters.exploiter_classes": ["SmbExploiter"], - "basic_network.scope.subnet_scan_list": ["10.2.2.15"], - "basic.credentials.exploit_password_list": ["Password1!", "Ivrrw5zEzs"], - "basic.credentials.exploit_user_list": ["Administrator", "m0nk3y", "user"], - "internal.classes.finger_classes": ["SMBFinger", "HTTPFinger"], - "internal.network.tcp_scanner.HTTP_PORTS": [], - "internal.network.tcp_scanner.tcp_target_ports": [445], - "internal.classes.exploits.exploit_ntlm_hash_list": [ - "5da0889ea2081aa79f6852294cba4a5e", - "50c9987a6bf1ac59398df9f911122c9b", - ], - } - ) diff --git a/envs/monkey_zoo/blackbox/config_templates/wmi_mimikatz.py b/envs/monkey_zoo/blackbox/config_templates/wmi_mimikatz.py deleted file mode 100644 index 430547a73..000000000 --- a/envs/monkey_zoo/blackbox/config_templates/wmi_mimikatz.py +++ /dev/null @@ -1,22 +0,0 @@ -from copy import copy - -from envs.monkey_zoo.blackbox.config_templates.base_template import BaseTemplate -from envs.monkey_zoo.blackbox.config_templates.config_template import ConfigTemplate - - -class WmiMimikatz(ConfigTemplate): - config_values = copy(BaseTemplate.config_values) - - config_values.update( - { - "basic.exploiters.exploiter_classes": ["WmiExploiter"], - "basic_network.scope.subnet_scan_list": ["10.2.2.14", "10.2.2.15"], - "basic.credentials.exploit_password_list": ["Password1!", "Ivrrw5zEzs"], - "basic.credentials.exploit_user_list": ["Administrator", "m0nk3y", "user"], - "internal.network.tcp_scanner.HTTP_PORTS": [], - "internal.network.tcp_scanner.tcp_target_ports": [135], - "monkey.system_info.system_info_collector_classes": [ - "MimikatzCollector", - ], - } - ) diff --git a/envs/monkey_zoo/blackbox/config_templates/zerologon.py b/envs/monkey_zoo/blackbox/config_templates/zerologon.py deleted file mode 100644 index 0c0266857..000000000 --- a/envs/monkey_zoo/blackbox/config_templates/zerologon.py +++ /dev/null @@ -1,20 +0,0 @@ -from copy import copy - -from envs.monkey_zoo.blackbox.config_templates.base_template import BaseTemplate -from envs.monkey_zoo.blackbox.config_templates.config_template import ConfigTemplate - - -class Zerologon(ConfigTemplate): - - config_values = copy(BaseTemplate.config_values) - - config_values.update( - { - "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": [], - "internal.network.tcp_scanner.HTTP_PORTS": [], - "internal.network.tcp_scanner.tcp_target_ports": [135, 445], - } - )