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:
Mike Salvatore 2022-10-04 15:19:11 -04:00
parent 8e6a098a2e
commit 3172433410
1 changed files with 17 additions and 17 deletions

View File

@ -128,23 +128,6 @@ class HostExploiter:
powershell = True if "powershell" in cmd.lower() else False
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(
self,
target: str,
@ -161,3 +144,20 @@ class HostExploiter:
tags=frozenset(tags),
)
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)