Agent: Use logger variable instead of logging

This commit is contained in:
Ilija Lazoroski 2022-03-14 19:17:46 +01:00
parent d154d26fe9
commit e4d3cc8841
1 changed files with 5 additions and 5 deletions

View File

@ -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):