Fix configure actions that were accidentally combined
This commit is contained in:
@@ -19,7 +19,7 @@ __all__ = (
|
||||
)
|
||||
|
||||
|
||||
class ConfigureRansomwareScriptAction(AbstractAction, identifier="c2_server_ransomware_configure"):
|
||||
class ConfigureRansomwareScriptAction(AbstractAction, identifier="configure_ransomware_script"):
|
||||
"""Action which sets config parameters for a ransomware script on a node."""
|
||||
|
||||
config: "ConfigureRansomwareScriptAction.ConfigSchema"
|
||||
@@ -45,6 +45,17 @@ class ConfigureRansomwareScriptAction(AbstractAction, identifier="c2_server_rans
|
||||
return ["network", "node", config.node_name, "application", "RansomwareScript", "configure", data]
|
||||
|
||||
|
||||
class RansomwareConfigureC2ServerAction(ConfigureRansomwareScriptAction, identifier="c2_server_ransomware_configure"):
|
||||
"""Action which causes a C2 server to send a command to set options on a ransomware script remotely."""
|
||||
|
||||
@classmethod
|
||||
def form_request(cls, config: ConfigureRansomwareScriptAction.ConfigSchema) -> RequestFormat:
|
||||
data = dict(
|
||||
server_ip_address=config.server_ip_address, server_password=config.server_password, payload=config.payload
|
||||
)
|
||||
return ["network", "node", config.node_name, "application", "C2Server", "ransomware_configure", data]
|
||||
|
||||
|
||||
class ConfigureDoSBotAction(AbstractAction, identifier="configure_dos_bot"):
|
||||
"""Action which sets config parameters for a DoS bot on a node."""
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ agents:
|
||||
node_name: client_1
|
||||
server_password: correct_password
|
||||
6:
|
||||
action: c2_server_ransomware_configure
|
||||
action: configure_ransomware_script
|
||||
options:
|
||||
node_name: client_2
|
||||
server_ip_address: 10.0.0.5
|
||||
|
||||
@@ -30,7 +30,6 @@ agents:
|
||||
options:
|
||||
source_node: client_1
|
||||
target_ip_address: 192.168.10.0/24
|
||||
target_protocol: tcp
|
||||
target_port:
|
||||
- 21
|
||||
- 53
|
||||
|
||||
@@ -122,7 +122,7 @@ class TestConfigureRansomwareScriptAction:
|
||||
old_payload = ransomware_script.payload
|
||||
|
||||
action = (
|
||||
"c2_server_ransomware_configure",
|
||||
"configure_ransomware_script",
|
||||
{"node_name": "client_1", **config},
|
||||
)
|
||||
agent.store_action(action)
|
||||
@@ -145,7 +145,7 @@ class TestConfigureRansomwareScriptAction:
|
||||
client_1.software_manager.install(RansomwareScript)
|
||||
ransomware_script: RansomwareScript = client_1.software_manager.software["RansomwareScript"]
|
||||
action = (
|
||||
"c2_server_ransomware_configure",
|
||||
"configure_ransomware_script",
|
||||
{
|
||||
"node_name": "client_1",
|
||||
"config": {"server_password": "admin123", "bad_option": 70},
|
||||
|
||||
Reference in New Issue
Block a user