Database Manipulation Bot bug fixes

This commit is contained in:
Jake Walker
2023-11-24 11:10:34 +00:00
parent 4e104a4d99
commit ff8b773c10
9 changed files with 124 additions and 83 deletions

View File

@@ -140,7 +140,12 @@ def arcd_uc2_network() -> Network:
network.connect(endpoint_b=client_1.ethernet_port[1], endpoint_a=switch_2.switch_ports[1])
client_1.software_manager.install(DataManipulationBot)
db_manipulation_bot: DataManipulationBot = client_1.software_manager.software["DataManipulationBot"]
db_manipulation_bot.configure(server_ip_address=IPv4Address("192.168.1.14"), payload="DELETE")
db_manipulation_bot.configure(
server_ip_address=IPv4Address("192.168.1.14"),
payload="DELETE",
port_scan_p_of_success=1.0,
data_manipulation_p_of_success=1.0,
)
# Client 2
client_2 = Computer(

View File

@@ -129,9 +129,9 @@ class DatabaseClient(Application):
)
return self._query(sql=sql, query_id=query_id, is_reattempt=True)
def execute(self) -> None:
def run(self) -> None:
"""Run the DatabaseClient."""
super().execute()
super().run()
if self.operating_state == ApplicationOperatingState.RUNNING:
self.connect()

View File

@@ -50,7 +50,7 @@ class DataManipulationBot(DatabaseClient):
def _init_request_manager(self) -> RequestManager:
rm = super()._init_request_manager()
rm.add_request(name="execute", request_type=RequestType(func=lambda request, context: self.execute()))
rm.add_request(name="execute", request_type=RequestType(func=lambda request, context: self.run()))
return rm
@@ -139,13 +139,13 @@ class DataManipulationBot(DatabaseClient):
self.sys_log.info(f"{self.name}: Data manipulation failed")
self.attack_stage = DataManipulationAttackStage.FAILED
def execute(self):
def run(self):
"""
Execute the Data Manipulation Bot.
Run the Data Manipulation Bot.
Calls the parent classes execute method before starting the application loop.
"""
super().execute()
super().run()
self._application_loop()
def _application_loop(self):