diff --git a/monkey/infection_monkey/exploit/smbexec.py b/monkey/infection_monkey/exploit/smbexec.py index 16ea4d0e1..d8d10bd57 100644 --- a/monkey/infection_monkey/exploit/smbexec.py +++ b/monkey/infection_monkey/exploit/smbexec.py @@ -148,16 +148,16 @@ class SMBExploiter(HostExploiter): else: # failed exploiting with this user/pass self.report_login_attempt(False, user, password, lm_hash, ntlm_hash) - message = f"Failed to login using SMB with {creds_for_log}" - self._publish_exploitation_event(timestamp, False, error_message=message) + error_message = f"Failed to login using SMB with {creds_for_log}" + self._publish_exploitation_event(timestamp, False, error_message=error_message) except Exception as exc: - message = ( + error_message = ( f"Error while trying to copy file using SMB to {self.host.ip_addr} with " f"{creds_for_log}:{exc}" ) - logger.error(message) - self._publish_exploitation_event(timestamp, False, error_message=message) + logger.error(error_message) + self._publish_exploitation_event(timestamp, False, error_message=error_message) continue return remote_full_path, SelectedCredentials(user, password, lm_hash, ntlm_hash), timestamp @@ -245,8 +245,8 @@ class SMBExploiter(HostExploiter): self._publish_propagation_event(start_time, True) status = ScanStatus.USED except Exception: - message = "Failed to start the service" - self._publish_propagation_event(start_time, False, error_message=message) + error_message = "Failed to start the service" + self._publish_propagation_event(start_time, False, error_message=error_message) status = ScanStatus.SCANNED self.telemetry_messenger.send_telemetry(T1035Telem(status, UsageEnum.SMB))