diff --git a/monkey/infection_monkey/exploit/web_rce.py b/monkey/infection_monkey/exploit/web_rce.py index b1b01697c..312ac3b57 100644 --- a/monkey/infection_monkey/exploit/web_rce.py +++ b/monkey/infection_monkey/exploit/web_rce.py @@ -38,15 +38,7 @@ class WebRCE(HostExploiter): Dict in format {'linux': '/tmp/monkey.sh', 'win32': './monkey32.exe', 'win64':... } """ super(WebRCE, self).__init__() - if monkey_target_paths: - self.monkey_target_paths = monkey_target_paths - else: - self.monkey_target_paths = { - "linux": self.options["dropper_target_path_linux"], - "win32": self.options["dropper_target_path_win_32"], - "win64": self.options["dropper_target_path_win_64"], - } - self.HTTP = [str(port) for port in self.options["http_ports"]] + self.monkey_target_paths = monkey_target_paths self.vulnerable_urls = [] self.target_url = None @@ -121,6 +113,16 @@ class WebRCE(HostExploiter): return True + def pre_exploit(self): + if not self.monkey_target_paths: + self.monkey_target_paths = { + "linux": self.options["dropper_target_path_linux"], + "win32": self.options["dropper_target_path_win_32"], + "win64": self.options["dropper_target_path_win_64"], + } + self.HTTP = [str(port) for port in self.options["http_ports"]] + super().pre_exploit() + @abstractmethod def exploit(self, url, command): """