diff --git a/monkey/infection_monkey/exploit/mssqlexec.py b/monkey/infection_monkey/exploit/mssqlexec.py index 72a250983..a6f8fd5ce 100644 --- a/monkey/infection_monkey/exploit/mssqlexec.py +++ b/monkey/infection_monkey/exploit/mssqlexec.py @@ -144,13 +144,12 @@ class MSSQLExploiter(HostExploiter): self.add_vuln_port(MSSQLExploiter.SQL_DEFAULT_TCP_PORT) self._report_login_attempt(timestamp, True, user, password) cursor = conn.cursor() + return cursor except pymssql.OperationalError as err: error_message = f"Connection to MSSQL failed: {err}" logger.info(error_message) self._report_login_attempt(timestamp, False, user, password, error_message) - # Combo didn't work, hopping to the next one - pass logger.warning( "No user/password combo was able to connect to host: {0}:{1}, "