From a558948c5d0ca7093a7af34ff0be0709d783a0cd Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Fri, 7 Oct 2022 08:43:05 -0400 Subject: [PATCH] Agent: Remove unnecessary `pass` from MSSQLExploiter --- monkey/infection_monkey/exploit/mssqlexec.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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}, "