Agent: Publish events sooner

This commit is contained in:
Kekoa Kaaikala 2022-10-05 18:53:31 +00:00 committed by Ilija Lazoroski
parent 3e592cfa69
commit de5d365bb0
1 changed files with 4 additions and 12 deletions

View File

@ -57,11 +57,7 @@ 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:
self.exploit.error_message = f"No vulnerable urls has been found for {self.host}"
self._publish_exploitation_event(
False,
error_message=self.exploit_result.error_message,
)
self.exploit_result.error_message = f"No vulnerable urls has been found for {self.host}"
return self.exploit_result
monkey_path_on_victim = get_agent_dst_path(self.host)
@ -78,11 +74,6 @@ class HadoopExploiter(WebRCE):
self.exploit_result.exploitation_success = True
self.exploit_result.propagation_success = True
self._publish_propagation_event(True)
else:
error_message = f"Failed to exploit via {self.vulnerable_urls[0]}"
self._publish_exploitation_event(False, error_message=error_message)
self._publish_propagation_event(False, error_message=error_message)
except requests.RequestException as err:
error_message = str(err)
self._publish_exploitation_event(False, error_message=error_message)
@ -121,8 +112,9 @@ class HadoopExploiter(WebRCE):
)
success = resp.status_code == 202
if success:
self._publish_exploitation_event(True)
message = "" if success else f"Failed to exploit via {url}"
self._publish_exploitation_event(success, error_message=message)
self._publish_propagation_event(success, error_message=message)
return success
def check_if_exploitable(self, url):