forked from p15670423/monkey
Agent: Remove disused HostExploiter._TARGET_OS_TYPE
This commit is contained in:
parent
ddbe5b463f
commit
8737a3df89
|
@ -15,8 +15,6 @@ logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class HostExploiter:
|
class HostExploiter:
|
||||||
_TARGET_OS_TYPE = []
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def _EXPLOITED_SERVICE(self):
|
def _EXPLOITED_SERVICE(self):
|
||||||
|
@ -44,9 +42,6 @@ class HostExploiter:
|
||||||
def set_finish_time(self):
|
def set_finish_time(self):
|
||||||
self.exploit_info["finished"] = datetime.now().isoformat()
|
self.exploit_info["finished"] = datetime.now().isoformat()
|
||||||
|
|
||||||
def is_os_supported(self):
|
|
||||||
return self.host.os.get("type") in self._TARGET_OS_TYPE
|
|
||||||
|
|
||||||
def report_login_attempt(self, result, user, password="", lm_hash="", ntlm_hash="", ssh_key=""):
|
def report_login_attempt(self, result, user, password="", lm_hash="", ntlm_hash="", ssh_key=""):
|
||||||
self.exploit_attempts.append(
|
self.exploit_attempts.append(
|
||||||
{
|
{
|
||||||
|
|
|
@ -19,7 +19,6 @@ logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class DrupalExploiter(WebRCE):
|
class DrupalExploiter(WebRCE):
|
||||||
_TARGET_OS_TYPE = ["linux", "windows"]
|
|
||||||
_EXPLOITED_SERVICE = "Drupal Server"
|
_EXPLOITED_SERVICE = "Drupal Server"
|
||||||
|
|
||||||
def __init__(self, host):
|
def __init__(self, host):
|
||||||
|
|
|
@ -25,7 +25,6 @@ from infection_monkey.utils.commands import build_monkey_commandline
|
||||||
|
|
||||||
|
|
||||||
class HadoopExploiter(WebRCE):
|
class HadoopExploiter(WebRCE):
|
||||||
_TARGET_OS_TYPE = ["linux", "windows"]
|
|
||||||
_EXPLOITED_SERVICE = "Hadoop"
|
_EXPLOITED_SERVICE = "Hadoop"
|
||||||
HADOOP_PORTS = [("8088", False)]
|
HADOOP_PORTS = [("8088", False)]
|
||||||
# How long we have our http server open for downloads in seconds
|
# How long we have our http server open for downloads in seconds
|
||||||
|
|
|
@ -27,7 +27,6 @@ logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class Log4ShellExploiter(WebRCE):
|
class Log4ShellExploiter(WebRCE):
|
||||||
_TARGET_OS_TYPE = ["linux", "windows"]
|
|
||||||
_EXPLOITED_SERVICE = "Log4j"
|
_EXPLOITED_SERVICE = "Log4j"
|
||||||
SERVER_SHUTDOWN_TIMEOUT = LONG_REQUEST_TIMEOUT
|
SERVER_SHUTDOWN_TIMEOUT = LONG_REQUEST_TIMEOUT
|
||||||
REQUEST_TO_VICTIM_TIMEOUT = MEDIUM_REQUEST_TIMEOUT
|
REQUEST_TO_VICTIM_TIMEOUT = MEDIUM_REQUEST_TIMEOUT
|
||||||
|
|
|
@ -23,7 +23,6 @@ logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
class MSSQLExploiter(HostExploiter):
|
class MSSQLExploiter(HostExploiter):
|
||||||
_EXPLOITED_SERVICE = "MSSQL"
|
_EXPLOITED_SERVICE = "MSSQL"
|
||||||
_TARGET_OS_TYPE = ["windows"]
|
|
||||||
LOGIN_TIMEOUT = LONG_REQUEST_TIMEOUT
|
LOGIN_TIMEOUT = LONG_REQUEST_TIMEOUT
|
||||||
QUERY_TIMEOUT = LONG_REQUEST_TIMEOUT
|
QUERY_TIMEOUT = LONG_REQUEST_TIMEOUT
|
||||||
# Time in seconds to wait between MSSQL queries.
|
# Time in seconds to wait between MSSQL queries.
|
||||||
|
|
|
@ -31,7 +31,6 @@ class RemoteAgentExecutionError(Exception):
|
||||||
|
|
||||||
|
|
||||||
class PowerShellExploiter(HostExploiter):
|
class PowerShellExploiter(HostExploiter):
|
||||||
_TARGET_OS_TYPE = ["windows"]
|
|
||||||
_EXPLOITED_SERVICE = "PowerShell Remoting (WinRM)"
|
_EXPLOITED_SERVICE = "PowerShell Remoting (WinRM)"
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|
|
@ -21,7 +21,6 @@ logger = getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class SMBExploiter(HostExploiter):
|
class SMBExploiter(HostExploiter):
|
||||||
_TARGET_OS_TYPE = ["windows"]
|
|
||||||
_EXPLOITED_SERVICE = "SMB"
|
_EXPLOITED_SERVICE = "SMB"
|
||||||
KNOWN_PROTOCOLS = {
|
KNOWN_PROTOCOLS = {
|
||||||
"139/SMB": (r"ncacn_np:%s[\pipe\svcctl]", 139),
|
"139/SMB": (r"ncacn_np:%s[\pipe\svcctl]", 139),
|
||||||
|
|
|
@ -31,7 +31,6 @@ TRANSFER_UPDATE_RATE = 15
|
||||||
|
|
||||||
|
|
||||||
class SSHExploiter(HostExploiter):
|
class SSHExploiter(HostExploiter):
|
||||||
_TARGET_OS_TYPE = ["linux", None]
|
|
||||||
_EXPLOITED_SERVICE = "SSH"
|
_EXPLOITED_SERVICE = "SSH"
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|
|
@ -20,7 +20,6 @@ DOWNLOAD_TIMEOUT = 300
|
||||||
|
|
||||||
|
|
||||||
class Struts2Exploiter(WebRCE):
|
class Struts2Exploiter(WebRCE):
|
||||||
_TARGET_OS_TYPE = ["linux", "windows"]
|
|
||||||
_EXPLOITED_SERVICE = "Struts2"
|
_EXPLOITED_SERVICE = "Struts2"
|
||||||
|
|
||||||
def __init__(self, host):
|
def __init__(self, host):
|
||||||
|
|
|
@ -29,7 +29,6 @@ HEADERS = {
|
||||||
|
|
||||||
|
|
||||||
class WebLogicExploiter(HostExploiter):
|
class WebLogicExploiter(HostExploiter):
|
||||||
_TARGET_OS_TYPE = ["linux", "windows"]
|
|
||||||
_EXPLOITED_SERVICE = "Weblogic"
|
_EXPLOITED_SERVICE = "Weblogic"
|
||||||
|
|
||||||
def _exploit_host(self):
|
def _exploit_host(self):
|
||||||
|
@ -58,7 +57,6 @@ class WebLogic201710271(WebRCE):
|
||||||
"/wls-wsat/RegistrationRequesterPortType11",
|
"/wls-wsat/RegistrationRequesterPortType11",
|
||||||
]
|
]
|
||||||
|
|
||||||
_TARGET_OS_TYPE = WebLogicExploiter._TARGET_OS_TYPE
|
|
||||||
_EXPLOITED_SERVICE = WebLogicExploiter._EXPLOITED_SERVICE
|
_EXPLOITED_SERVICE = WebLogicExploiter._EXPLOITED_SERVICE
|
||||||
|
|
||||||
def __init__(self, host):
|
def __init__(self, host):
|
||||||
|
@ -257,7 +255,6 @@ class WebLogic20192725(WebRCE):
|
||||||
URLS = ["_async/AsyncResponseServiceHttps"]
|
URLS = ["_async/AsyncResponseServiceHttps"]
|
||||||
DELAY_BEFORE_EXPLOITING_SECONDS = 5
|
DELAY_BEFORE_EXPLOITING_SECONDS = 5
|
||||||
|
|
||||||
_TARGET_OS_TYPE = WebLogicExploiter._TARGET_OS_TYPE
|
|
||||||
_EXPLOITED_SERVICE = WebLogicExploiter._EXPLOITED_SERVICE
|
_EXPLOITED_SERVICE = WebLogicExploiter._EXPLOITED_SERVICE
|
||||||
|
|
||||||
def __init__(self, host):
|
def __init__(self, host):
|
||||||
|
|
|
@ -22,7 +22,6 @@ logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class WmiExploiter(HostExploiter):
|
class WmiExploiter(HostExploiter):
|
||||||
_TARGET_OS_TYPE = ["windows"]
|
|
||||||
_EXPLOITED_SERVICE = "WMI (Windows Management Instrumentation)"
|
_EXPLOITED_SERVICE = "WMI (Windows Management Instrumentation)"
|
||||||
|
|
||||||
@WmiTools.impacket_user
|
@WmiTools.impacket_user
|
||||||
|
|
|
@ -33,7 +33,6 @@ logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class ZerologonExploiter(HostExploiter):
|
class ZerologonExploiter(HostExploiter):
|
||||||
_TARGET_OS_TYPE = ["windows"]
|
|
||||||
_EXPLOITED_SERVICE = "Netlogon"
|
_EXPLOITED_SERVICE = "Netlogon"
|
||||||
MAX_ATTEMPTS = 2000 # For 2000, expected average number of attempts needed: 256.
|
MAX_ATTEMPTS = 2000 # For 2000, expected average number of attempts needed: 256.
|
||||||
ERROR_CODE_ACCESS_DENIED = 0xC0000022
|
ERROR_CODE_ACCESS_DENIED = 0xC0000022
|
||||||
|
|
Loading…
Reference in New Issue