diff --git a/monkey/infection_monkey/exploit/powershell.py b/monkey/infection_monkey/exploit/powershell.py index d3c9b12f7..b8efce04b 100644 --- a/monkey/infection_monkey/exploit/powershell.py +++ b/monkey/infection_monkey/exploit/powershell.py @@ -121,13 +121,14 @@ class PowerShellExploiter(HostExploiter): try: client = PowerShellClient(self.host.ip_addr, creds, opts) + connect_timestamp = time() client.connect() logger.info( f"Successfully logged into {self.host.ip_addr} using Powershell. User: " f"{creds.username}, Secret Type: {creds.secret_type.name}" ) - self._publish_exploitation_event(success=True) + self._publish_exploitation_event(time=connect_timestamp, success=True) self.exploit_result.exploitation_success = True self._report_login_attempt(True, creds) @@ -138,7 +139,9 @@ class PowerShellExploiter(HostExploiter): f"{creds.username}, SecretType: {creds.secret_type.name} -- Error: {ex}" ) logger.debug(error_message) - self._publish_exploitation_event(success=False, error_message=error_message) + self._publish_exploitation_event( + time=connect_timestamp, success=False, error_message=error_message + ) self._report_login_attempt(False, creds) return None