forked from p15670423/monkey
Island: Add smb_download_timeout to SMB and WMI exploiter options
This commit is contained in:
parent
6862ef39ee
commit
e76b46c8ca
|
@ -629,4 +629,18 @@ class ConfigService:
|
|||
|
||||
config.pop(flat_config_exploiter_classes_field, None)
|
||||
|
||||
return formatted_exploiters_config
|
||||
return ConfigService._add_smb_download_timeout_to_exploiters(
|
||||
config, formatted_exploiters_config
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def _add_smb_download_timeout_to_exploiters(
|
||||
flat_config: Dict, formatted_config: Dict
|
||||
) -> Dict[str, List[Dict[str, Any]]]:
|
||||
new_config = copy.deepcopy(formatted_config)
|
||||
uses_smb_timeout = {"SmbExploiter", "WmiExploiter"}
|
||||
|
||||
for exploiter in filter(lambda e: e["name"] in uses_smb_timeout, new_config["brute_force"]):
|
||||
exploiter["options"]["smb_download_timeout"] = flat_config["smb_download_timeout"]
|
||||
|
||||
return new_config
|
||||
|
|
|
@ -180,8 +180,8 @@ def test_format_config_for_agent__exploiters(flat_monkey_config):
|
|||
{"name": "MSSQLExploiter", "options": {}},
|
||||
{"name": "PowerShellExploiter", "options": {}},
|
||||
{"name": "SSHExploiter", "options": {}},
|
||||
{"name": "SmbExploiter", "options": {}},
|
||||
{"name": "WmiExploiter", "options": {}},
|
||||
{"name": "SmbExploiter", "options": {"smb_download_timeout": 300}},
|
||||
{"name": "WmiExploiter", "options": {"smb_download_timeout": 300}},
|
||||
],
|
||||
"vulnerability": [
|
||||
{"name": "DrupalExploiter", "options": {}},
|
||||
|
|
Loading…
Reference in New Issue