From 176828d458584436e3e6dc3c688ce8bfcc2b7344 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Wed, 25 Aug 2021 14:18:43 -0400 Subject: [PATCH] Agent: Log exception if PowerShellExploiter fails to copy agent --- monkey/infection_monkey/exploit/powershell.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monkey/infection_monkey/exploit/powershell.py b/monkey/infection_monkey/exploit/powershell.py index 6f0a27ac4..f109724da 100644 --- a/monkey/infection_monkey/exploit/powershell.py +++ b/monkey/infection_monkey/exploit/powershell.py @@ -134,8 +134,8 @@ class PowerShellExploiter(HostExploiter): self.client.copy(TEMP_MONKEY_BINARY_FILEPATH, dest) LOG.info(f"Successfully copied the monkey agent binary to {self.host.ip_addr}") return True - except Exception: - LOG.warning(f"Failed to copy the monkey agent binary to {self.host.ip_addr}") + except Exception as ex: + LOG.error(f"Failed to copy the monkey agent binary to {self.host.ip_addr}: {ex}") return False finally: os.remove(TEMP_MONKEY_BINARY_FILEPATH)