From e4d3cc884127b55c68ca93517b8bed6e50e0a75f Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Mon, 14 Mar 2022 19:17:46 +0100 Subject: [PATCH] Agent: Use logger variable instead of logging --- monkey/infection_monkey/exploit/powershell.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/monkey/infection_monkey/exploit/powershell.py b/monkey/infection_monkey/exploit/powershell.py index 9c34227ee..066dfc508 100644 --- a/monkey/infection_monkey/exploit/powershell.py +++ b/monkey/infection_monkey/exploit/powershell.py @@ -55,7 +55,7 @@ class PowerShellExploiter(HostExploiter): try: use_ssl = self._is_client_using_https() except PowerShellRemotingDisabledError as e: - logging.info(e) + logger.info(e) self.exploit_result.error_message = ( "PowerShell Remoting appears to be disabled on the remote host" ) @@ -91,22 +91,22 @@ class PowerShellExploiter(HostExploiter): def _is_client_using_https(self) -> bool: try: - logging.debug("Checking if powershell remoting is enabled over HTTP.") + logger.debug("Checking if powershell remoting is enabled over HTTP.") self._try_http() return False except AuthenticationError: return False except Exception as e: - logging.debug(f"Powershell remoting over HTTP seems disabled: {e}") + logger.debug(f"Powershell remoting over HTTP seems disabled: {e}") try: - logging.debug("Checking if powershell remoting is enabled over HTTPS.") + logger.debug("Checking if powershell remoting is enabled over HTTPS.") self._try_https() return True except AuthenticationError: return True except Exception as e: - logging.debug(f"Powershell remoting over HTTPS seems disabled: {e}") + logger.debug(f"Powershell remoting over HTTPS seems disabled: {e}") raise PowerShellRemotingDisabledError("Powershell remoting seems to be disabled.") def _try_http(self):