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 bd9219c2..e45333e5 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 @@ -191,7 +191,7 @@ class AbstractC2(Application): """ return self._handle_c2_payload(payload, session_id) - def _send_keep_alive(self) -> bool: + def _send_keep_alive(self, session_id: Optional[str]) -> bool: """Sends a C2 keep alive payload to the self.remote_connection IPv4 Address.""" # Checking that the c2 application is capable of performing both actions and has an enabled NIC # (Using NOT to improve code readability) @@ -217,6 +217,7 @@ class AbstractC2(Application): dest_ip_address=self.c2_remote_connection, port=self.current_masquerade_port, protocol=self.current_masquerade_protocol, + session_id=session_id, ): self.sys_log.info(f"{self.name}: Keep Alive sent to {self.c2_remote_connection}") self.sys_log.debug(f"{self.name}: on {self.current_masquerade_port} via {self.current_masquerade_protocol}") 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 bee00c5d..e0ad30f8 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 @@ -261,7 +261,7 @@ class C2Beacon(AbstractC2): def _check_c2_connection(self, timestep) -> bool: - """Checks the C2 Server connection. If a connection cannot be confirmed then the c2 beacon will halt and close.""" + """Checks the C2 Server connection. If a connection cannot be confirmed then this method will return false otherwise true.""" if self.keep_alive_inactivity > self.keep_alive_frequency: self.sys_log.info(f"{self.name}: Keep Alive sent to {self.c2_remote_connection} at timestep {timestep}.") self._send_keep_alive() 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 5f8824cd..05ff30d9 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 @@ -11,3 +11,4 @@ class C2Server(AbstractC2): def _handle_command_output(payload): """Abstract Method: Used in C2 server to parse and receive the output of commands sent to the c2 beacon.""" pass + \ No newline at end of file