forked from p15670423/monkey
Agent: Use logger variable instead of logging
This commit is contained in:
parent
d154d26fe9
commit
e4d3cc8841
|
@ -55,7 +55,7 @@ class PowerShellExploiter(HostExploiter):
|
||||||
try:
|
try:
|
||||||
use_ssl = self._is_client_using_https()
|
use_ssl = self._is_client_using_https()
|
||||||
except PowerShellRemotingDisabledError as e:
|
except PowerShellRemotingDisabledError as e:
|
||||||
logging.info(e)
|
logger.info(e)
|
||||||
self.exploit_result.error_message = (
|
self.exploit_result.error_message = (
|
||||||
"PowerShell Remoting appears to be disabled on the remote host"
|
"PowerShell Remoting appears to be disabled on the remote host"
|
||||||
)
|
)
|
||||||
|
@ -91,22 +91,22 @@ class PowerShellExploiter(HostExploiter):
|
||||||
|
|
||||||
def _is_client_using_https(self) -> bool:
|
def _is_client_using_https(self) -> bool:
|
||||||
try:
|
try:
|
||||||
logging.debug("Checking if powershell remoting is enabled over HTTP.")
|
logger.debug("Checking if powershell remoting is enabled over HTTP.")
|
||||||
self._try_http()
|
self._try_http()
|
||||||
return False
|
return False
|
||||||
except AuthenticationError:
|
except AuthenticationError:
|
||||||
return False
|
return False
|
||||||
except Exception as e:
|
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:
|
try:
|
||||||
logging.debug("Checking if powershell remoting is enabled over HTTPS.")
|
logger.debug("Checking if powershell remoting is enabled over HTTPS.")
|
||||||
self._try_https()
|
self._try_https()
|
||||||
return True
|
return True
|
||||||
except AuthenticationError:
|
except AuthenticationError:
|
||||||
return True
|
return True
|
||||||
except Exception as e:
|
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.")
|
raise PowerShellRemotingDisabledError("Powershell remoting seems to be disabled.")
|
||||||
|
|
||||||
def _try_http(self):
|
def _try_http(self):
|
||||||
|
|
Loading…
Reference in New Issue