forked from p15670423/monkey
Agent: Swap order of _publish_{propagation,exploitation}_event()
Putting _publish_exploitation_event() first puts the methods in both alphabetical and chronological order.
This commit is contained in:
parent
8e6a098a2e
commit
3172433410
|
@ -128,23 +128,6 @@ 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(
|
|
||||||
self,
|
|
||||||
target: str,
|
|
||||||
propagation_success: bool,
|
|
||||||
tags: Tuple[str, ...] = tuple(),
|
|
||||||
error_message: str = "",
|
|
||||||
):
|
|
||||||
propagation_event = PropagationEvent(
|
|
||||||
source=get_agent_id(),
|
|
||||||
target=IPv4Address(target),
|
|
||||||
success=propagation_success,
|
|
||||||
exploiter_name=self.__class__.__name__,
|
|
||||||
error_message=error_message,
|
|
||||||
tags=frozenset(tags),
|
|
||||||
)
|
|
||||||
self.agent_event_queue.publish(propagation_event)
|
|
||||||
|
|
||||||
def _publish_exploitation_event(
|
def _publish_exploitation_event(
|
||||||
self,
|
self,
|
||||||
target: str,
|
target: str,
|
||||||
|
@ -161,3 +144,20 @@ class HostExploiter:
|
||||||
tags=frozenset(tags),
|
tags=frozenset(tags),
|
||||||
)
|
)
|
||||||
self.agent_event_queue.publish(exploitation_event)
|
self.agent_event_queue.publish(exploitation_event)
|
||||||
|
|
||||||
|
def _publish_propagation_event(
|
||||||
|
self,
|
||||||
|
target: str,
|
||||||
|
propagation_success: bool,
|
||||||
|
tags: Tuple[str, ...] = tuple(),
|
||||||
|
error_message: str = "",
|
||||||
|
):
|
||||||
|
propagation_event = PropagationEvent(
|
||||||
|
source=get_agent_id(),
|
||||||
|
target=IPv4Address(target),
|
||||||
|
success=propagation_success,
|
||||||
|
exploiter_name=self.__class__.__name__,
|
||||||
|
error_message=error_message,
|
||||||
|
tags=frozenset(tags),
|
||||||
|
)
|
||||||
|
self.agent_event_queue.publish(propagation_event)
|
||||||
|
|
Loading…
Reference in New Issue