From f50f4cf71caa621af1b2532aba1ab11c95a678ed Mon Sep 17 00:00:00 2001 From: vakaris_zilius Date: Fri, 18 Mar 2022 15:19:14 +0000 Subject: [PATCH] Agent: Add interrupt error message to powershell results --- monkey/infection_monkey/exploit/powershell.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/monkey/infection_monkey/exploit/powershell.py b/monkey/infection_monkey/exploit/powershell.py index ede63daaf..9840ac7a7 100644 --- a/monkey/infection_monkey/exploit/powershell.py +++ b/monkey/infection_monkey/exploit/powershell.py @@ -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}")