Agent: Make publish methods private

This commit is contained in:
Kekoa Kaaikala 2022-10-04 14:56:57 +00:00
parent 8e161f0fd9
commit b94002a984
2 changed files with 4 additions and 4 deletions

View File

@ -128,7 +128,7 @@ class HostExploiter:
powershell = True if "powershell" in cmd.lower() else False powershell = True if "powershell" in cmd.lower() else False
self.exploit_info["executed_cmds"].append({"cmd": cmd, "powershell": powershell}) self.exploit_info["executed_cmds"].append({"cmd": cmd, "powershell": powershell})
def publish_propagation_event( def _publish_propagation_event(
self, self,
target: str, target: str,
propagation_success: bool, propagation_success: bool,
@ -145,7 +145,7 @@ class HostExploiter:
) )
self.agent_event_queue.publish(propagation_event) self.agent_event_queue.publish(propagation_event)
def publish_exploitation_event( def _publish_exploitation_event(
self, self,
target: str, target: str,
exploitation_success: bool, exploitation_success: bool,

View File

@ -65,7 +65,7 @@ def test_publish_exploitation_event__uses_exploiter_name_by_default(
options={}, options={},
interrupt=threading.Event(), interrupt=threading.Event(),
) )
exploiter.publish_exploitation_event(target=str(TARGET), exploitation_success=True) exploiter._publish_exploitation_event(target=str(TARGET), exploitation_success=True)
expected_event = ExploitationEvent( expected_event = ExploitationEvent(
source=AGENT_ID, source=AGENT_ID,
target=TARGET, target=TARGET,
@ -92,7 +92,7 @@ def test_publish_propagation_event__uses_exploiter_name_by_default(
options={}, options={},
interrupt=threading.Event(), interrupt=threading.Event(),
) )
exploiter.publish_propagation_event(target=str(TARGET), propagation_success=True) exploiter._publish_propagation_event(target=str(TARGET), propagation_success=True)
expected_event = PropagationEvent( expected_event = PropagationEvent(
source=AGENT_ID, target=TARGET, success=True, exploiter_name=FakeExploiter.__name__ source=AGENT_ID, target=TARGET, success=True, exploiter_name=FakeExploiter.__name__
) )