Merge pull request #2010 from guardicore/1995-remove-smb_download_timeout

Remove smb_download_timeout
This commit is contained in:
VakarisZ 2022-06-10 10:01:20 +03:00 committed by GitHub
commit 63a772e781
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 19 deletions

View File

@ -52,6 +52,8 @@ SENSITIVE_SSH_KEY_FIELDS = [
SensitiveField(path="public_key", field_encryptor=StringEncryptor),
]
SMB_DOWNLOAD_TIMEOUT = 30
class ConfigService:
default_config = None
@ -584,19 +586,19 @@ class ConfigService:
config.pop(flat_config_exploiter_classes_field, None)
formatted_exploiters_config = ConfigService._add_smb_download_timeout_to_exploiters(
config, formatted_exploiters_config
formatted_exploiters_config
)
return ConfigService._add_supported_os_to_exploiters(formatted_exploiters_config)
@staticmethod
def _add_smb_download_timeout_to_exploiters(
flat_config: Dict, formatted_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"]
exploiter["options"]["smb_download_timeout"] = SMB_DOWNLOAD_TIMEOUT
return new_config

View File

@ -165,19 +165,6 @@ INTERNAL = {
"items": {"type": "string"},
"description": "List of SSH key pairs to use, when trying to ssh into servers",
},
"smb_service": {
"title": "SMB service",
"type": "object",
"properties": {
"smb_download_timeout": {
"title": "SMB download timeout",
"type": "integer",
"default": 30,
"description": "Timeout (in seconds) for SMB download operation (used "
"in various exploits using SMB)",
},
},
},
},
},
"testing": {

View File

@ -82,7 +82,6 @@
"readme": true
}
},
"smb_download_timeout": 300,
"subnet_scan_list": ["192.168.1.50", "192.168.56.0/24", "10.0.33.0/30"],
"system_info_collector_classes": [
"MimikatzCollector"

View File

@ -195,12 +195,12 @@ def test_format_config_for_agent__exploiters():
{
"name": "SmbExploiter",
"supported_os": ["windows"],
"options": {"smb_download_timeout": 300},
"options": {"smb_download_timeout": 30},
},
{
"name": "WmiExploiter",
"supported_os": ["windows"],
"options": {"smb_download_timeout": 300},
"options": {"smb_download_timeout": 30},
},
],
"vulnerability": [