Agent, Island: Modify config to remove boolean propagator field

This commit is contained in:
Ilija Lazoroski 2022-02-18 09:29:53 +01:00 committed by Mike Salvatore
parent 0bfa0cd1ca
commit 915c58e8cc
5 changed files with 29 additions and 31 deletions

View File

@ -86,7 +86,7 @@ class Exploiter:
exploiter_results = self._run_exploiter(exploiter_name, victim_host, stop) exploiter_results = self._run_exploiter(exploiter_name, victim_host, stop)
results_callback(exploiter_name, victim_host, exploiter_results) results_callback(exploiter_name, victim_host, exploiter_results)
if exploiter["propagator"] and exploiter_results.success: if exploiter_name != "ZerologonExploiter" and exploiter_results.success:
break break
def _run_exploiter( def _run_exploiter(

View File

@ -611,9 +611,7 @@ class ConfigService:
else vulnerability_category else vulnerability_category
) )
formatted_exploiters_config[category].append( formatted_exploiters_config[category].append({"name": exploiter})
{"name": exploiter, "propagator": (exploiter != "ZerologonExploiter")}
)
config.pop(flat_config_exploiter_classes_field, None) config.pop(flat_config_exploiter_classes_field, None)

View File

@ -46,20 +46,20 @@
}, },
"exploiters": { "exploiters": {
"brute_force": [ "brute_force": [
{"name": "MSSQLExploiter", "propagator": true}, {"name": "MSSQLExploiter"},
{"name": "PowerShellExploiter", "propagator": true}, {"name": "PowerShellExploiter"},
{"name": "SmbExploiter", "propagator": true}, {"name": "SmbExploiter"},
{"name": "SSHExploiter", "propagator": true}, {"name": "SSHExploiter"},
{"name": "WmiExploiter", "propagator": true} {"name": "WmiExploiter"}
], ],
"vulnerability": [ "vulnerability": [
{"name": "DrupalExploiter", "propagator": true}, {"name": "DrupalExploiter"},
{"name": "ElasticGroovyExploiter", "propagator": true}, {"name": "ElasticGroovyExploiter"},
{"name": "HadoopExploiter", "propagator": true}, {"name": "HadoopExploiter"},
{"name": "ShellShockExploiter", "propagator": true}, {"name": "ShellShockExploiter"},
{"name": "Struts2Exploiter", "propagator": true}, {"name": "Struts2Exploiter"},
{"name": "WebLogicExploiter", "propagator": true}, {"name": "WebLogicExploiter"},
{"name": "ZerologonExploiter", "propagator": false} {"name": "ZerologonExploiter"}
] ]
} }
}, },

View File

@ -36,11 +36,11 @@ def callback():
def exploiter_config(): def exploiter_config():
return { return {
"brute_force": [ "brute_force": [
{"name": "PowerShellExploiter", "propagator": True}, {"name": "PowerShellExploiter"},
{"name": "SSHExploiter", "propagator": True}, {"name": "SSHExploiter"},
], ],
"vulnerability": [ "vulnerability": [
{"name": "ZerologonExploiter", "propagator": False}, {"name": "ZerologonExploiter"},
], ],
} }

View File

@ -172,20 +172,20 @@ def test_format_config_for_agent__network_scan(flat_monkey_config):
def test_format_config_for_agent__exploiters(flat_monkey_config): def test_format_config_for_agent__exploiters(flat_monkey_config):
expected_exploiters_config = { expected_exploiters_config = {
"brute_force": [ "brute_force": [
{"name": "MSSQLExploiter", "propagator": True}, {"name": "MSSQLExploiter"},
{"name": "PowerShellExploiter", "propagator": True}, {"name": "PowerShellExploiter"},
{"name": "SSHExploiter", "propagator": True}, {"name": "SSHExploiter"},
{"name": "SmbExploiter", "propagator": True}, {"name": "SmbExploiter"},
{"name": "WmiExploiter", "propagator": True}, {"name": "WmiExploiter"},
], ],
"vulnerability": [ "vulnerability": [
{"name": "DrupalExploiter", "propagator": True}, {"name": "DrupalExploiter"},
{"name": "ElasticGroovyExploiter", "propagator": True}, {"name": "ElasticGroovyExploiter"},
{"name": "HadoopExploiter", "propagator": True}, {"name": "HadoopExploiter"},
{"name": "ShellShockExploiter", "propagator": True}, {"name": "ShellShockExploiter"},
{"name": "Struts2Exploiter", "propagator": True}, {"name": "Struts2Exploiter"},
{"name": "WebLogicExploiter", "propagator": True}, {"name": "WebLogicExploiter"},
{"name": "ZerologonExploiter", "propagator": False}, {"name": "ZerologonExploiter"},
], ],
} }
ConfigService.format_flat_config_for_agent(flat_monkey_config) ConfigService.format_flat_config_for_agent(flat_monkey_config)