Agent: Add interrupt error message to powershell results

This commit is contained in:
vakaris_zilius 2022-03-18 15:19:14 +00:00 committed by Mike Salvatore
parent 02154e38fd
commit f50f4cf71c
1 changed files with 2 additions and 0 deletions

View File

@ -70,6 +70,7 @@ class PowerShellExploiter(HostExploiter):
try:
self._client = self._authenticate_via_brute_force(credentials, auth_options)
except self.InterruptError:
self.exploit_result.error_message = "Exploiter has been interrupted"
return self.exploit_result
if not self._client:
@ -84,6 +85,7 @@ class PowerShellExploiter(HostExploiter):
self._execute_monkey_agent_on_victim()
self.exploit_result.propagation_success = True
except self.InterruptError:
self.exploit_result.error_message = "Exploiter has been interrupted"
return self.exploit_result
except Exception as ex:
logger.error(f"Failed to propagate to the remote host: {ex}")