Agent: Use updated publish methods

This commit is contained in:
Kekoa Kaaikala 2022-10-05 12:51:59 +00:00 committed by Ilija Lazoroski
parent 2cd9d0086b
commit 33230e85f7
1 changed files with 6 additions and 4 deletions

View File

@ -52,10 +52,12 @@ class MSSQLExploiter(HostExploiter):
try:
self.cursor = self._brute_force(self.host.ip_addr, self.SQL_DEFAULT_TCP_PORT, creds)
except FailedExploitationError:
logger.info(
error_message = (
f"Failed brute-forcing of MSSQL server on {self.host},"
f" no credentials were successful"
)
logger.error(error_message)
self._publish_exploitation_event(self.host.ip_addr, False, error_message=error_message)
return self.exploit_result
if self._is_interrupted():
@ -72,12 +74,12 @@ class MSSQLExploiter(HostExploiter):
)
logger.error(error_message)
self.publish_propagation_event(self.host.ip_addr, False, error_message=error_message)
self._publish_propagation_event(self.host.ip_addr, False, error_message=error_message)
self.exploit_result.error_message = error_message
return self.exploit_result
self.publish_propagation_event(self.host.ip_addr, True)
self._publish_propagation_event(self.host.ip_addr, True)
self.exploit_result.propagation_success = True
return self.exploit_result
@ -145,7 +147,7 @@ class MSSQLExploiter(HostExploiter):
def _report_login_attempt(
self, success: bool, host: str, user, password: str, message: str = ""
):
self.publish_exploitation_event(host, success, error_message=message)
self._publish_exploitation_event(host, success, error_message=message)
self.report_login_attempt(success, user, password)
def _upload_agent(self, agent_path_on_victim: PureWindowsPath):