Extracted relevant config parameters for each BB test and made templates from those

This commit is contained in:
VakarisZ 2021-03-01 17:11:23 +02:00
parent b652e0d851
commit edc8fff0a7
17 changed files with 423 additions and 0 deletions

View File

@ -0,0 +1,19 @@
from envs.monkey_zoo.blackbox.island_configs.config_templates.config_template import ConfigTemplate, \
ConfigValueDescriptor
# Disables a lot of config values not required for a specific feature test
class BaseTemplate(ConfigTemplate):
@staticmethod
def should_run(class_name: str) -> bool:
return False
config_value_list = [
ConfigValueDescriptor("basic.exploiters.exploiter_classes", []),
ConfigValueDescriptor("basic_network.scope.local_network_scan", False),
ConfigValueDescriptor("internal.classes.finger_classes",
["PingScanner", "HTTPFinger"]),
ConfigValueDescriptor("internal.monkey.system_info.system_info_collector_classes",
["EnvironmentCollector", "HostnameCollector"])
]

View File

@ -0,0 +1,32 @@
from abc import ABC, abstractmethod
from dataclasses import dataclass
from typing import Any, List
import envs.monkey_zoo.blackbox.island_configs.config_templates
from infection_monkey.utils.plugins.plugin import Plugin
@dataclass
class ConfigValueDescriptor:
path: str # Dot separated config path. E.g. monkey.pba.actions.create_user
content: Any # Contents of config value. Depends on the type of config value.
class ConfigTemplate(Plugin, ABC):
@staticmethod
def base_package_name():
return envs.monkey_zoo.blackbox.island_configs.config_templates.__package__
@staticmethod
def base_package_file():
return envs.monkey_zoo.blackbox.island_configs.config_templates.__file__
@abstractmethod
@property
def config_value_list(self) -> List[ConfigValueDescriptor]:
pass
@staticmethod
def should_run(class_name: str) -> bool:
return False

View File

@ -0,0 +1,14 @@
from envs.monkey_zoo.blackbox.island_configs.config_templates.base_template import BaseTemplate
from envs.monkey_zoo.blackbox.island_configs.config_templates.config_template import ConfigValueDescriptor
class Elastic(BaseTemplate):
@staticmethod
def should_run(class_name: str) -> bool:
return True
config_value_list = [
ConfigValueDescriptor("basic.exploiters.exploiter_classes", ["ElasticGroovyExploiter"]),
ConfigValueDescriptor("basic_network.scope.subnet_scan_list", ["10.2.2.4", "10.2.2.5"])
]

View File

@ -0,0 +1,14 @@
from envs.monkey_zoo.blackbox.island_configs.config_templates.base_template import BaseTemplate
from envs.monkey_zoo.blackbox.island_configs.config_templates.config_template import ConfigValueDescriptor
class Hadoop(BaseTemplate):
@staticmethod
def should_run(class_name: str) -> bool:
return True
config_value_list = [
ConfigValueDescriptor("basic.exploiters.exploiter_classes", ["HadoopExploiter"]),
ConfigValueDescriptor("basic_network.scope.subnet_scan_list", ["10.2.2.2", "10.2.2.3"])
]

View File

@ -0,0 +1,25 @@
from envs.monkey_zoo.blackbox.island_configs.config_templates.base_template import BaseTemplate
from envs.monkey_zoo.blackbox.island_configs.config_templates.config_template import ConfigValueDescriptor
class Mssql(BaseTemplate):
@staticmethod
def should_run(class_name: str) -> bool:
return True
config_value_list = [
ConfigValueDescriptor("basic.exploiters.exploiter_classes", ["MSSQLExploiter"]),
ConfigValueDescriptor("basic_network.scope.subnet_scan_list", ["10.2.2.16"]),
ConfigValueDescriptor("basic.credentials.exploit_password_list",
["Password1!",
"Xk8VDTsC",
"password",
"12345678"
]),
ConfigValueDescriptor("basic.credentials.exploit_user_list",
["Administrator",
"m0nk3y",
"user"
])
]

View File

@ -0,0 +1,71 @@
from envs.monkey_zoo.blackbox.island_configs.config_templates.config_template import ConfigValueDescriptor, \
ConfigTemplate
class Performance(ConfigTemplate):
@staticmethod
def should_run(class_name: str) -> bool:
return True
config_value_list = [
ConfigValueDescriptor("basic.credentials.exploit_password_list",
["Xk8VDTsC",
"^NgDvY59~8",
"Ivrrw5zEzs",
"3Q=(Ge(+&w]*",
"`))jU7L(w}",
"t67TC5ZDmz"
]),
ConfigValueDescriptor("basic.credentials.exploit_user_list",
["m0nk3y"
]),
ConfigValueDescriptor("basic.exploiters.exploiter_classes",
["SmbExploiter",
"WmiExploiter",
"SSHExploiter",
"ShellShockExploiter",
"SambaCryExploiter",
"ElasticGroovyExploiter",
"Struts2Exploiter",
"WebLogicExploiter",
"HadoopExploiter",
"VSFTPDExploiter",
"MSSQLExploiter",
"ZerologonExploiter"
]),
ConfigValueDescriptor("basic_network.network_analysis.inaccessible_subnets",
["10.2.2.0/30",
"10.2.2.8/30",
"10.2.2.24/32",
"10.2.2.23/32",
"10.2.2.21/32",
"10.2.2.19/32",
"10.2.2.18/32",
"10.2.2.17/32"
]),
ConfigValueDescriptor("basic_network.scope.subnet_scan_list",
["10.2.2.2",
"10.2.2.3",
"10.2.2.4",
"10.2.2.5",
"10.2.2.8",
"10.2.2.9",
"10.2.1.10",
"10.2.0.11",
"10.2.0.12",
"10.2.2.11",
"10.2.2.12",
"10.2.2.14",
"10.2.2.15",
"10.2.2.16",
"10.2.2.18",
"10.2.2.19",
"10.2.2.20",
"10.2.2.21",
"10.2.2.23",
"10.2.2.24",
"10.2.2.25",
])
]

View File

@ -0,0 +1,14 @@
from envs.monkey_zoo.blackbox.island_configs.config_templates.base_template import BaseTemplate
from envs.monkey_zoo.blackbox.island_configs.config_templates.config_template import ConfigValueDescriptor
class ShellShock(BaseTemplate):
@staticmethod
def should_run(class_name: str) -> bool:
return True
config_value_list = [
ConfigValueDescriptor("basic.exploiters.exploiter_classes", ["ShellShockExploiter"]),
ConfigValueDescriptor("basic_network.scope.subnet_scan_list", ["10.2.2.8"])
]

View File

@ -0,0 +1,36 @@
from envs.monkey_zoo.blackbox.island_configs.config_templates.base_template import BaseTemplate
from envs.monkey_zoo.blackbox.island_configs.config_templates.config_template import ConfigValueDescriptor
class SmbMimikatz(BaseTemplate):
@staticmethod
def should_run(class_name: str) -> bool:
return True
config_value_list = [
ConfigValueDescriptor("basic.exploiters.exploiter_classes", ["SmbExploiter"]),
ConfigValueDescriptor("basic_network.scope.subnet_scan_list",
["10.2.2.14",
"10.2.2.15"]),
ConfigValueDescriptor("basic.credentials.exploit_password_list",
["Password1!",
"Ivrrw5zEzs"
]),
ConfigValueDescriptor("basic.credentials.exploit_user_list",
["Administrator",
"m0nk3y",
"user"
]),
ConfigValueDescriptor("internal.classes.finger_classes",
["SMBFinger",
"PingScanner",
"HTTPFinger"
]),
ConfigValueDescriptor("monkey.system_info.system_info_collector_classes",
["EnvironmentCollector",
"HostnameCollector",
"ProcessListCollector",
"MimikatzCollector"
])
]

View File

@ -0,0 +1,33 @@
from envs.monkey_zoo.blackbox.island_configs.config_templates.base_template import BaseTemplate
from envs.monkey_zoo.blackbox.island_configs.config_templates.config_template import ConfigValueDescriptor
class SmbPth(BaseTemplate):
@staticmethod
def should_run(class_name: str) -> bool:
return True
config_value_list = [
ConfigValueDescriptor("basic.exploiters.exploiter_classes", ["SmbExploiter"]),
ConfigValueDescriptor("basic_network.scope.subnet_scan_list",
["10.2.2.15"]),
ConfigValueDescriptor("basic.credentials.exploit_password_list",
["Password1!",
"Ivrrw5zEzs"
]),
ConfigValueDescriptor("basic.credentials.exploit_user_list",
["Administrator",
"m0nk3y",
"user"
]),
ConfigValueDescriptor("internal.classes.finger_classes",
["SMBFinger",
"PingScanner",
"HTTPFinger"
]),
ConfigValueDescriptor("internal.classes.exploits.exploit_ntlm_hash_list",
["5da0889ea2081aa79f6852294cba4a5e",
"50c9987a6bf1ac59398df9f911122c9b"
])
]

View File

@ -0,0 +1,31 @@
from envs.monkey_zoo.blackbox.island_configs.config_templates.base_template import BaseTemplate
from envs.monkey_zoo.blackbox.island_configs.config_templates.config_template import ConfigValueDescriptor
class Ssh(BaseTemplate):
@staticmethod
def should_run(class_name: str) -> bool:
return True
config_value_list = [
ConfigValueDescriptor("basic.exploiters.exploiter_classes", ["SSHExploiter"]),
ConfigValueDescriptor("basic_network.scope.subnet_scan_list",
["10.2.2.11",
"10.2.2.12"]),
ConfigValueDescriptor("basic.credentials.exploit_password_list",
["Password1!",
"12345678",
"^NgDvY59~8"
]),
ConfigValueDescriptor("basic.credentials.exploit_user_list",
["Administrator",
"m0nk3y",
"user"
]),
ConfigValueDescriptor("internal.classes.finger_classes",
["SSHFinger",
"PingScanner",
"HTTPFinger"
])
]

View File

@ -0,0 +1,16 @@
from envs.monkey_zoo.blackbox.island_configs.config_templates.base_template import BaseTemplate
from envs.monkey_zoo.blackbox.island_configs.config_templates.config_template import ConfigValueDescriptor
class Struts2(BaseTemplate):
@staticmethod
def should_run(class_name: str) -> bool:
return True
config_value_list = [
ConfigValueDescriptor("basic.exploiters.exploiter_classes", ["Struts2Exploiter"]),
ConfigValueDescriptor("basic_network.scope.subnet_scan_list",
["10.2.2.23",
"10.2.2.24"])
]

View File

@ -0,0 +1,41 @@
from envs.monkey_zoo.blackbox.island_configs.config_templates.base_template import BaseTemplate
from envs.monkey_zoo.blackbox.island_configs.config_templates.config_template import ConfigValueDescriptor
class Tunneling(BaseTemplate):
@staticmethod
def should_run(class_name: str) -> bool:
return True
config_value_list = [
ConfigValueDescriptor("basic.exploiters.exploiter_classes",
["SmbExploiter",
"WmiExploiter",
"SSHExploiter"
]),
ConfigValueDescriptor("basic_network.scope.subnet_scan_list",
["10.2.2.9",
"10.2.1.10",
"10.2.0.11",
"10.2.0.12"
]),
ConfigValueDescriptor("basic.credentials.exploit_password_list",
["Password1!",
"3Q=(Ge(+&w]*",
"`))jU7L(w}",
"t67TC5ZDmz",
"12345678"
]),
ConfigValueDescriptor("basic.credentials.exploit_user_list",
["Administrator",
"m0nk3y",
"user"
]),
ConfigValueDescriptor("internal.classes.finger_classes",
["SSHFinger",
"PingScanner",
"HTTPFinger",
"SMBFinger",
])
]

View File

@ -0,0 +1,16 @@
from envs.monkey_zoo.blackbox.island_configs.config_templates.base_template import BaseTemplate
from envs.monkey_zoo.blackbox.island_configs.config_templates.config_template import ConfigValueDescriptor
class Weblogic(BaseTemplate):
@staticmethod
def should_run(class_name: str) -> bool:
return True
config_value_list = [
ConfigValueDescriptor("basic.exploiters.exploiter_classes", ["WebLogicExploiter"]),
ConfigValueDescriptor("basic_network.scope.subnet_scan_list",
["10.2.2.18",
"10.2.2.19"])
]

View File

@ -0,0 +1,31 @@
from envs.monkey_zoo.blackbox.island_configs.config_templates.base_template import BaseTemplate
from envs.monkey_zoo.blackbox.island_configs.config_templates.config_template import ConfigValueDescriptor
class WmiMimikatz(BaseTemplate):
@staticmethod
def should_run(class_name: str) -> bool:
return True
config_value_list = [
ConfigValueDescriptor("basic.exploiters.exploiter_classes", ["WmiExploiter"]),
ConfigValueDescriptor("basic_network.scope.subnet_scan_list",
["10.2.2.14",
"10.2.2.15"]),
ConfigValueDescriptor("basic.credentials.exploit_password_list",
["Password1!",
"Ivrrw5zEzs"
]),
ConfigValueDescriptor("basic.credentials.exploit_user_list",
["Administrator",
"m0nk3y",
"user"
]),
ConfigValueDescriptor("monkey.system_info.system_info_collector_classes",
["EnvironmentCollector",
"HostnameCollector",
"ProcessListCollector",
"MimikatzCollector"
])
]

View File

@ -0,0 +1,29 @@
from envs.monkey_zoo.blackbox.island_configs.config_templates.base_template import BaseTemplate
from envs.monkey_zoo.blackbox.island_configs.config_templates.config_template import ConfigValueDescriptor
class WmiPth(BaseTemplate):
@staticmethod
def should_run(class_name: str) -> bool:
return True
config_value_list = [
ConfigValueDescriptor("basic.exploiters.exploiter_classes", ["WmiExploiter"]),
ConfigValueDescriptor("basic_network.scope.subnet_scan_list",
["10.2.2.15"]),
ConfigValueDescriptor("basic.credentials.exploit_password_list",
["Password1!"]),
ConfigValueDescriptor("basic.credentials.exploit_user_list",
["Administrator",
"m0nk3y",
"user"
]),
ConfigValueDescriptor("internal.classes.finger_classes",
["PingScanner",
"HTTPFinger"
]),
ConfigValueDescriptor("internal.classes.exploits.exploit_ntlm_hash_list",
["5da0889ea2081aa79f6852294cba4a5e",
"50c9987a6bf1ac59398df9f911122c9b"])
]

View File

@ -0,0 +1 @@
.