diff --git a/monkey/infection_monkey/control.py b/monkey/infection_monkey/control.py index 0e6edd106..a9aa246cb 100644 --- a/monkey/infection_monkey/control.py +++ b/monkey/infection_monkey/control.py @@ -325,9 +325,10 @@ class ControlClient(object): return False @staticmethod - def should_monkey_run(port: str) -> bool: - if WormConfiguration.get_hop_count() > 1 and \ - ControlClient.can_island_see_port(port) and \ + def should_monkey_run(vulnerable_port: str) -> bool: + if vulnerable_port and \ + WormConfiguration.get_hop_count() > 1 and \ + ControlClient.can_island_see_port(vulnerable_port) and \ WormConfiguration.started_on_island: raise PlannedShutdownException("Monkey shouldn't run on current machine " "(it will be exploited later with more depth).") diff --git a/monkey/infection_monkey/exploit/hadoop.py b/monkey/infection_monkey/exploit/hadoop.py index 76124cac8..7b3fcabd3 100644 --- a/monkey/infection_monkey/exploit/hadoop.py +++ b/monkey/infection_monkey/exploit/hadoop.py @@ -74,7 +74,7 @@ class HadoopExploiter(WebRCE): def build_command(self, path, http_path): # Build command to execute monkey_cmd = build_monkey_commandline(self.host, get_monkey_depth() - 1, - vulnerable_port=HTTPTools.get_port_from_url(http_path)) + vulnerable_port=HadoopExploiter.HADOOP_PORTS[0][0]) if 'linux' in self.host.os['type']: base_command = HADOOP_LINUX_COMMAND else: