From 31724334109bc144da59ad4f16edd88d21109577 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Tue, 4 Oct 2022 15:19:11 -0400 Subject: [PATCH] Agent: Swap order of _publish_{propagation,exploitation}_event() Putting _publish_exploitation_event() first puts the methods in both alphabetical and chronological order. --- .../infection_monkey/exploit/HostExploiter.py | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/monkey/infection_monkey/exploit/HostExploiter.py b/monkey/infection_monkey/exploit/HostExploiter.py index 2e0faad36..915a8c50e 100644 --- a/monkey/infection_monkey/exploit/HostExploiter.py +++ b/monkey/infection_monkey/exploit/HostExploiter.py @@ -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)