From 8a00a2a29d990c39dbc2dd130a7a1da15964a811 Mon Sep 17 00:00:00 2001 From: "Archer.Bowen" Date: Tue, 30 Jul 2024 13:10:23 +0100 Subject: [PATCH] #2689 Added TODOs for future reference. --- .../system/applications/red_applications/c2/abstract_c2.py | 7 +++++++ .../system/applications/red_applications/c2/c2_beacon.py | 7 +++++-- .../system/applications/red_applications/c2/c2_server.py | 5 ++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/primaite/simulator/system/applications/red_applications/c2/abstract_c2.py b/src/primaite/simulator/system/applications/red_applications/c2/abstract_c2.py index c7f90b9d..eabbf476 100644 --- a/src/primaite/simulator/system/applications/red_applications/c2/abstract_c2.py +++ b/src/primaite/simulator/system/applications/red_applications/c2/abstract_c2.py @@ -11,6 +11,13 @@ from primaite.simulator.network.transmission.network_layer import IPProtocol from primaite.simulator.network.transmission.transport_layer import Port from primaite.simulator.system.applications.application import Application +# TODO: +# Complete C2 Server and C2 Beacon TODOs +# Create test that leverage all the functionality needed for the different TAPs +# Create a .RST doc +# Potentially? A notebook which demonstrates a custom red agent using the c2 server for various means. + + class C2Command(Enum): """ Enumerations representing the different commands the C2 suite currently supports. diff --git a/src/primaite/simulator/system/applications/red_applications/c2/c2_beacon.py b/src/primaite/simulator/system/applications/red_applications/c2/c2_beacon.py index 822e6ba9..ab5f47d4 100644 --- a/src/primaite/simulator/system/applications/red_applications/c2/c2_beacon.py +++ b/src/primaite/simulator/system/applications/red_applications/c2/c2_beacon.py @@ -29,8 +29,11 @@ class C2Beacon(AbstractC2): keep_alive_frequency: int = 5 "The frequency at which ``Keep Alive`` packets are sent to the C2 Server from the C2 Beacon." - - # Uncomment the Import and this Property after terminal PR + # TODO: + # Implement the placeholder command methods + # Implement the keep alive frequency. + # Implement a command output method that sends the RequestResponse to the C2 server. + # Uncomment the terminal Import and the terminal property after terminal PR #@property #def _host_db_client(self) -> Terminal: diff --git a/src/primaite/simulator/system/applications/red_applications/c2/c2_server.py b/src/primaite/simulator/system/applications/red_applications/c2/c2_server.py index 648ace47..5f8824cd 100644 --- a/src/primaite/simulator/system/applications/red_applications/c2/c2_server.py +++ b/src/primaite/simulator/system/applications/red_applications/c2/c2_server.py @@ -4,7 +4,10 @@ from primaite.simulator.network.protocols.masquerade import C2Payload, Masquerad class C2Server(AbstractC2): + # TODO: + # Implement the request manager and agent actions. + # Implement the output handling methods. (These need to interface with the actions) def _handle_command_output(payload): - """Abstract Method: Used in C2 server to prase and receive the output of commands sent to the c2 beacon.""" + """Abstract Method: Used in C2 server to parse and receive the output of commands sent to the c2 beacon.""" pass