forked from p15670423/monkey
Agent: Make publish methods private
This commit is contained in:
parent
8e161f0fd9
commit
b94002a984
|
@ -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,
|
||||||
|
|
|
@ -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__
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue