From c51217507a3fe34ee606383518f6fe40043ff779 Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Mon, 5 Sep 2022 13:24:33 +0200 Subject: [PATCH] Agent: Pass servers to exploit_host in ExploiterWrapper.Inner --- .../exploit/exploiter_wrapper.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/monkey/infection_monkey/exploit/exploiter_wrapper.py b/monkey/infection_monkey/exploit/exploiter_wrapper.py index 8c8527afe..ac65a1d8d 100644 --- a/monkey/infection_monkey/exploit/exploiter_wrapper.py +++ b/monkey/infection_monkey/exploit/exploiter_wrapper.py @@ -1,5 +1,5 @@ import threading -from typing import Dict, List, Type +from typing import Dict, Sequence, Type from common.event_queue import IAgentEventQueue from infection_monkey.model import VictimHost @@ -24,21 +24,24 @@ class ExploiterWrapper: telemetry_messenger: ITelemetryMessenger, event_queue: IAgentEventQueue, agent_binary_repository: IAgentBinaryRepository, - servers: List[str], ): self._exploit_class = exploit_class self._telemetry_messenger = telemetry_messenger self._event_queue = event_queue self._agent_binary_repository = agent_binary_repository - self._servers = servers def exploit_host( - self, host: VictimHost, current_depth: int, options: Dict, interrupt: threading.Event + self, + host: VictimHost, + servers: Sequence[str], + current_depth: int, + options: Dict, + interrupt: threading.Event, ): exploiter = self._exploit_class() return exploiter.exploit_host( host, - self._servers, + servers, current_depth, self._telemetry_messenger, self._event_queue, @@ -52,12 +55,10 @@ class ExploiterWrapper: telemetry_messenger: ITelemetryMessenger, event_queue: IAgentEventQueue, agent_binary_repository: IAgentBinaryRepository, - servers: List[str], ): self._telemetry_messenger = telemetry_messenger self._event_queue = event_queue self._agent_binary_repository = agent_binary_repository - self._servers = servers def wrap(self, exploit_class: Type[HostExploiter]): return ExploiterWrapper.Inner( @@ -65,5 +66,4 @@ class ExploiterWrapper: self._telemetry_messenger, self._event_queue, self._agent_binary_repository, - self._servers, )