diff --git a/monkey/infection_monkey/exploit/HostExploiter.py b/monkey/infection_monkey/exploit/HostExploiter.py index 17bbee2a3..09a6d274e 100644 --- a/monkey/infection_monkey/exploit/HostExploiter.py +++ b/monkey/infection_monkey/exploit/HostExploiter.py @@ -15,8 +15,6 @@ logger = logging.getLogger(__name__) class HostExploiter: - _TARGET_OS_TYPE = [] - @property @abstractmethod def _EXPLOITED_SERVICE(self): @@ -44,9 +42,6 @@ class HostExploiter: def set_finish_time(self): 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=""): self.exploit_attempts.append( { diff --git a/monkey/infection_monkey/exploit/drupal.py b/monkey/infection_monkey/exploit/drupal.py index a07b99403..a0842383e 100644 --- a/monkey/infection_monkey/exploit/drupal.py +++ b/monkey/infection_monkey/exploit/drupal.py @@ -19,7 +19,6 @@ logger = logging.getLogger(__name__) class DrupalExploiter(WebRCE): - _TARGET_OS_TYPE = ["linux", "windows"] _EXPLOITED_SERVICE = "Drupal Server" def __init__(self, host): diff --git a/monkey/infection_monkey/exploit/hadoop.py b/monkey/infection_monkey/exploit/hadoop.py index 689120f59..c704f9814 100644 --- a/monkey/infection_monkey/exploit/hadoop.py +++ b/monkey/infection_monkey/exploit/hadoop.py @@ -25,7 +25,6 @@ from infection_monkey.utils.commands import build_monkey_commandline class HadoopExploiter(WebRCE): - _TARGET_OS_TYPE = ["linux", "windows"] _EXPLOITED_SERVICE = "Hadoop" HADOOP_PORTS = [("8088", False)] # How long we have our http server open for downloads in seconds diff --git a/monkey/infection_monkey/exploit/log4shell.py b/monkey/infection_monkey/exploit/log4shell.py index 0a70d6e01..e967ee6cb 100644 --- a/monkey/infection_monkey/exploit/log4shell.py +++ b/monkey/infection_monkey/exploit/log4shell.py @@ -27,7 +27,6 @@ logger = logging.getLogger(__name__) class Log4ShellExploiter(WebRCE): - _TARGET_OS_TYPE = ["linux", "windows"] _EXPLOITED_SERVICE = "Log4j" SERVER_SHUTDOWN_TIMEOUT = LONG_REQUEST_TIMEOUT REQUEST_TO_VICTIM_TIMEOUT = MEDIUM_REQUEST_TIMEOUT diff --git a/monkey/infection_monkey/exploit/mssqlexec.py b/monkey/infection_monkey/exploit/mssqlexec.py index b93b18649..f6b44471a 100644 --- a/monkey/infection_monkey/exploit/mssqlexec.py +++ b/monkey/infection_monkey/exploit/mssqlexec.py @@ -23,7 +23,6 @@ logger = logging.getLogger(__name__) class MSSQLExploiter(HostExploiter): _EXPLOITED_SERVICE = "MSSQL" - _TARGET_OS_TYPE = ["windows"] LOGIN_TIMEOUT = LONG_REQUEST_TIMEOUT QUERY_TIMEOUT = LONG_REQUEST_TIMEOUT # Time in seconds to wait between MSSQL queries. diff --git a/monkey/infection_monkey/exploit/powershell.py b/monkey/infection_monkey/exploit/powershell.py index f95b21df7..d711bec19 100644 --- a/monkey/infection_monkey/exploit/powershell.py +++ b/monkey/infection_monkey/exploit/powershell.py @@ -31,7 +31,6 @@ class RemoteAgentExecutionError(Exception): class PowerShellExploiter(HostExploiter): - _TARGET_OS_TYPE = ["windows"] _EXPLOITED_SERVICE = "PowerShell Remoting (WinRM)" def __init__(self): diff --git a/monkey/infection_monkey/exploit/smbexec.py b/monkey/infection_monkey/exploit/smbexec.py index 2afc74439..10b7009b0 100644 --- a/monkey/infection_monkey/exploit/smbexec.py +++ b/monkey/infection_monkey/exploit/smbexec.py @@ -21,7 +21,6 @@ logger = getLogger(__name__) class SMBExploiter(HostExploiter): - _TARGET_OS_TYPE = ["windows"] _EXPLOITED_SERVICE = "SMB" KNOWN_PROTOCOLS = { "139/SMB": (r"ncacn_np:%s[\pipe\svcctl]", 139), diff --git a/monkey/infection_monkey/exploit/sshexec.py b/monkey/infection_monkey/exploit/sshexec.py index aa4ec8b54..0e6a9c038 100644 --- a/monkey/infection_monkey/exploit/sshexec.py +++ b/monkey/infection_monkey/exploit/sshexec.py @@ -31,7 +31,6 @@ TRANSFER_UPDATE_RATE = 15 class SSHExploiter(HostExploiter): - _TARGET_OS_TYPE = ["linux", None] _EXPLOITED_SERVICE = "SSH" def __init__(self): diff --git a/monkey/infection_monkey/exploit/struts2.py b/monkey/infection_monkey/exploit/struts2.py index 5efb7a64d..c576a5fbd 100644 --- a/monkey/infection_monkey/exploit/struts2.py +++ b/monkey/infection_monkey/exploit/struts2.py @@ -20,7 +20,6 @@ DOWNLOAD_TIMEOUT = 300 class Struts2Exploiter(WebRCE): - _TARGET_OS_TYPE = ["linux", "windows"] _EXPLOITED_SERVICE = "Struts2" def __init__(self, host): diff --git a/monkey/infection_monkey/exploit/weblogic.py b/monkey/infection_monkey/exploit/weblogic.py index b2747a3f2..6c2d7d327 100644 --- a/monkey/infection_monkey/exploit/weblogic.py +++ b/monkey/infection_monkey/exploit/weblogic.py @@ -29,7 +29,6 @@ HEADERS = { class WebLogicExploiter(HostExploiter): - _TARGET_OS_TYPE = ["linux", "windows"] _EXPLOITED_SERVICE = "Weblogic" def _exploit_host(self): @@ -58,7 +57,6 @@ class WebLogic201710271(WebRCE): "/wls-wsat/RegistrationRequesterPortType11", ] - _TARGET_OS_TYPE = WebLogicExploiter._TARGET_OS_TYPE _EXPLOITED_SERVICE = WebLogicExploiter._EXPLOITED_SERVICE def __init__(self, host): @@ -257,7 +255,6 @@ class WebLogic20192725(WebRCE): URLS = ["_async/AsyncResponseServiceHttps"] DELAY_BEFORE_EXPLOITING_SECONDS = 5 - _TARGET_OS_TYPE = WebLogicExploiter._TARGET_OS_TYPE _EXPLOITED_SERVICE = WebLogicExploiter._EXPLOITED_SERVICE def __init__(self, host): diff --git a/monkey/infection_monkey/exploit/wmiexec.py b/monkey/infection_monkey/exploit/wmiexec.py index 9d2af2e32..753dc511b 100644 --- a/monkey/infection_monkey/exploit/wmiexec.py +++ b/monkey/infection_monkey/exploit/wmiexec.py @@ -22,7 +22,6 @@ logger = logging.getLogger(__name__) class WmiExploiter(HostExploiter): - _TARGET_OS_TYPE = ["windows"] _EXPLOITED_SERVICE = "WMI (Windows Management Instrumentation)" @WmiTools.impacket_user diff --git a/monkey/infection_monkey/exploit/zerologon.py b/monkey/infection_monkey/exploit/zerologon.py index 8fe9cb52b..df5b7b4c6 100644 --- a/monkey/infection_monkey/exploit/zerologon.py +++ b/monkey/infection_monkey/exploit/zerologon.py @@ -33,7 +33,6 @@ logger = logging.getLogger(__name__) class ZerologonExploiter(HostExploiter): - _TARGET_OS_TYPE = ["windows"] _EXPLOITED_SERVICE = "Netlogon" MAX_ATTEMPTS = 2000 # For 2000, expected average number of attempts needed: 256. ERROR_CODE_ACCESS_DENIED = 0xC0000022