#2689 Addressed more PR comments & fixed an bug with command parsing in _command_terminal (c2 beacon)
This commit is contained in:
@@ -75,7 +75,7 @@ class AbstractC2(Application, identifier="AbstractC2"):
|
||||
keep_alive_inactivity: int = 0
|
||||
"""Indicates how many timesteps since the last time the c2 application received a keep alive."""
|
||||
|
||||
class _C2_Opts(BaseModel):
|
||||
class C2_Opts(BaseModel):
|
||||
"""A Pydantic Schema for the different C2 configuration options."""
|
||||
|
||||
keep_alive_frequency: int = Field(default=5, ge=1)
|
||||
@@ -87,7 +87,7 @@ class AbstractC2(Application, identifier="AbstractC2"):
|
||||
masquerade_port: Port = Field(default=Port.HTTP)
|
||||
"""The currently chosen port that the C2 traffic is masquerading as. Defaults at HTTP."""
|
||||
|
||||
c2_config: _C2_Opts = _C2_Opts()
|
||||
c2_config: C2_Opts = C2_Opts()
|
||||
"""
|
||||
Holds the current configuration settings of the C2 Suite.
|
||||
|
||||
|
||||
@@ -493,8 +493,9 @@ class C2Beacon(AbstractC2, identifier="C2Beacon"):
|
||||
)
|
||||
|
||||
# Converts a singular terminal command: [RequestFormat] into a list with one element [[RequestFormat]]
|
||||
# Checks the first element - if this element is a str then there must be multiple commands.
|
||||
command_opts.commands = (
|
||||
[command_opts.commands] if not isinstance(command_opts.commands, list) else command_opts.commands
|
||||
[command_opts.commands] if isinstance(command_opts.commands[0], str) else command_opts.commands
|
||||
)
|
||||
|
||||
for index, given_command in enumerate(command_opts.commands):
|
||||
|
||||
Reference in New Issue
Block a user