forked from p15670423/monkey
Merge pull request #1745 from guardicore/1675-remove-32-bit-config-option
Remove dropper_target_path_win_32 bit config option
This commit is contained in:
commit
1ad79b9c96
|
@ -89,7 +89,6 @@ class Configuration(object):
|
||||||
dropper_set_date = True
|
dropper_set_date = True
|
||||||
dropper_date_reference_path_windows = r"%windir%\system32\kernel32.dll"
|
dropper_date_reference_path_windows = r"%windir%\system32\kernel32.dll"
|
||||||
dropper_date_reference_path_linux = "/bin/sh"
|
dropper_date_reference_path_linux = "/bin/sh"
|
||||||
dropper_target_path_win_32 = r"C:\Windows\temp\monkey32.exe"
|
|
||||||
dropper_target_path_win_64 = r"C:\Windows\temp\monkey64.exe"
|
dropper_target_path_win_64 = r"C:\Windows\temp\monkey64.exe"
|
||||||
dropper_target_path_linux = "/tmp/monkey"
|
dropper_target_path_linux = "/tmp/monkey"
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
"dropper_log_path_windows": "%temp%\\~df1562.tmp",
|
"dropper_log_path_windows": "%temp%\\~df1562.tmp",
|
||||||
"dropper_log_path_linux": "/tmp/user-1562",
|
"dropper_log_path_linux": "/tmp/user-1562",
|
||||||
"dropper_set_date": true,
|
"dropper_set_date": true,
|
||||||
"dropper_target_path_win_32": "C:\\Windows\\temp\\monkey32.exe",
|
|
||||||
"dropper_target_path_win_64": "C:\\Windows\\temp\\monkey64.exe",
|
"dropper_target_path_win_64": "C:\\Windows\\temp\\monkey64.exe",
|
||||||
"dropper_target_path_linux": "/tmp/monkey",
|
"dropper_target_path_linux": "/tmp/monkey",
|
||||||
|
|
||||||
|
|
|
@ -65,8 +65,6 @@ def get_monkey_dest_path(url_to_monkey):
|
||||||
try:
|
try:
|
||||||
if "linux" in url_to_monkey:
|
if "linux" in url_to_monkey:
|
||||||
return WormConfiguration.dropper_target_path_linux
|
return WormConfiguration.dropper_target_path_linux
|
||||||
elif "windows-32" in url_to_monkey:
|
|
||||||
return WormConfiguration.dropper_target_path_win_32
|
|
||||||
elif "windows-64" in url_to_monkey:
|
elif "windows-64" in url_to_monkey:
|
||||||
return WormConfiguration.dropper_target_path_win_64
|
return WormConfiguration.dropper_target_path_win_64
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -4,7 +4,6 @@ from posixpath import join
|
||||||
from typing import List, Tuple
|
from typing import List, Tuple
|
||||||
|
|
||||||
from common.utils.attack_utils import BITS_UPLOAD_STRING, ScanStatus
|
from common.utils.attack_utils import BITS_UPLOAD_STRING, ScanStatus
|
||||||
from infection_monkey.exploit.consts import WIN_ARCH_64
|
|
||||||
from infection_monkey.exploit.HostExploiter import HostExploiter
|
from infection_monkey.exploit.HostExploiter import HostExploiter
|
||||||
from infection_monkey.exploit.tools.helpers import get_monkey_depth, get_target_monkey
|
from infection_monkey.exploit.tools.helpers import get_monkey_depth, get_target_monkey
|
||||||
from infection_monkey.exploit.tools.http_tools import HTTPTools
|
from infection_monkey.exploit.tools.http_tools import HTTPTools
|
||||||
|
@ -35,7 +34,7 @@ class WebRCE(HostExploiter):
|
||||||
def __init__(self, monkey_target_paths=None):
|
def __init__(self, monkey_target_paths=None):
|
||||||
"""
|
"""
|
||||||
:param monkey_target_paths: Where to upload the monkey at the target host system.
|
:param monkey_target_paths: Where to upload the monkey at the target host system.
|
||||||
Dict in format {'linux': '/tmp/monkey.sh', 'win32': './monkey32.exe', 'win64':... }
|
Dict in format {'linux': '/tmp/monkey.sh', 'win64':... }
|
||||||
"""
|
"""
|
||||||
super(WebRCE, self).__init__()
|
super(WebRCE, self).__init__()
|
||||||
self.monkey_target_paths = monkey_target_paths
|
self.monkey_target_paths = monkey_target_paths
|
||||||
|
@ -117,7 +116,6 @@ class WebRCE(HostExploiter):
|
||||||
if not self.monkey_target_paths:
|
if not self.monkey_target_paths:
|
||||||
self.monkey_target_paths = {
|
self.monkey_target_paths = {
|
||||||
"linux": self.options["dropper_target_path_linux"],
|
"linux": self.options["dropper_target_path_linux"],
|
||||||
"win32": self.options["dropper_target_path_win_32"],
|
|
||||||
"win64": self.options["dropper_target_path_win_64"],
|
"win64": self.options["dropper_target_path_win_64"],
|
||||||
}
|
}
|
||||||
self.HTTP = [str(port) for port in self.options["http_ports"]]
|
self.HTTP = [str(port) for port in self.options["http_ports"]]
|
||||||
|
@ -412,7 +410,7 @@ class WebRCE(HostExploiter):
|
||||||
"""
|
"""
|
||||||
Gets destination path from one of WEB_RCE predetermined paths(self.monkey_target_paths).
|
Gets destination path from one of WEB_RCE predetermined paths(self.monkey_target_paths).
|
||||||
:param url_to_monkey: Hosted monkey's url. egz :
|
:param url_to_monkey: Hosted monkey's url. egz :
|
||||||
http://localserver:9999/monkey/windows-32.exe
|
http://localserver:9999/monkey/windows-64.exe
|
||||||
:return: Corresponding monkey path from self.monkey_target_paths
|
:return: Corresponding monkey path from self.monkey_target_paths
|
||||||
"""
|
"""
|
||||||
if not url_to_monkey or ("linux" not in url_to_monkey and "windows" not in url_to_monkey):
|
if not url_to_monkey or ("linux" not in url_to_monkey and "windows" not in url_to_monkey):
|
||||||
|
@ -423,9 +421,7 @@ class WebRCE(HostExploiter):
|
||||||
try:
|
try:
|
||||||
if "linux" in url_to_monkey:
|
if "linux" in url_to_monkey:
|
||||||
return self.monkey_target_paths["linux"]
|
return self.monkey_target_paths["linux"]
|
||||||
elif "windows-32" in url_to_monkey:
|
elif "windows" in url_to_monkey:
|
||||||
return self.monkey_target_paths["win32"]
|
|
||||||
elif "windows-64" in url_to_monkey:
|
|
||||||
return self.monkey_target_paths["win64"]
|
return self.monkey_target_paths["win64"]
|
||||||
else:
|
else:
|
||||||
logger.error(
|
logger.error(
|
||||||
|
@ -435,7 +431,7 @@ class WebRCE(HostExploiter):
|
||||||
return False
|
return False
|
||||||
except KeyError:
|
except KeyError:
|
||||||
logger.error(
|
logger.error(
|
||||||
'Unknown key was found. Please use "linux", "win32" and "win64" keys to '
|
'Unknown key was found. Please use "linux" and "win64" keys to '
|
||||||
"initialize "
|
"initialize "
|
||||||
"custom dict of monkey's destination paths"
|
"custom dict of monkey's destination paths"
|
||||||
)
|
)
|
||||||
|
@ -470,13 +466,7 @@ class WebRCE(HostExploiter):
|
||||||
if self.host.os["type"] == "linux":
|
if self.host.os["type"] == "linux":
|
||||||
return self.options["dropper_target_path_linux"]
|
return self.options["dropper_target_path_linux"]
|
||||||
if self.host.os["type"] == "windows":
|
if self.host.os["type"] == "windows":
|
||||||
try:
|
|
||||||
# remove now or when 32-bit binaries are removed?
|
|
||||||
if self.host.os["machine"] == WIN_ARCH_64:
|
|
||||||
return self.options["dropper_target_path_win_64"]
|
return self.options["dropper_target_path_win_64"]
|
||||||
except KeyError:
|
|
||||||
logger.debug("Target's machine type was not set. Using win-32 dropper path.")
|
|
||||||
return self.options["dropper_target_path_win_32"]
|
|
||||||
|
|
||||||
def get_target_url(self):
|
def get_target_url(self):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -606,7 +606,6 @@ class ConfigService:
|
||||||
|
|
||||||
for dropper_target in [
|
for dropper_target in [
|
||||||
"dropper_target_path_linux",
|
"dropper_target_path_linux",
|
||||||
"dropper_target_path_win_32",
|
|
||||||
"dropper_target_path_win_64",
|
"dropper_target_path_win_64",
|
||||||
]:
|
]:
|
||||||
exploit_options[dropper_target] = config.get(dropper_target, "")
|
exploit_options[dropper_target] = config.get(dropper_target, "")
|
||||||
|
|
|
@ -174,14 +174,6 @@ INTERNAL = {
|
||||||
"description": "Determines where should the dropper place the monkey on a "
|
"description": "Determines where should the dropper place the monkey on a "
|
||||||
"Linux machine",
|
"Linux machine",
|
||||||
},
|
},
|
||||||
"dropper_target_path_win_32": {
|
|
||||||
"title": "Dropper target path on Windows (32bit)",
|
|
||||||
"type": "string",
|
|
||||||
"default": "C:\\Windows\\temp\\monkey32.exe",
|
|
||||||
"description": "Determines where should the dropper place the monkey on a "
|
|
||||||
"Windows machine "
|
|
||||||
"(32bit)",
|
|
||||||
},
|
|
||||||
"dropper_target_path_win_64": {
|
"dropper_target_path_win_64": {
|
||||||
"title": "Dropper target path on Windows (64bit)",
|
"title": "Dropper target path on Windows (64bit)",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
"dropper_log_path_windows": "%temp%\\~df1562.tmp",
|
"dropper_log_path_windows": "%temp%\\~df1562.tmp",
|
||||||
"dropper_set_date": true,
|
"dropper_set_date": true,
|
||||||
"dropper_target_path_linux": "/tmp/monkey",
|
"dropper_target_path_linux": "/tmp/monkey",
|
||||||
"dropper_target_path_win_32": "C:\\Windows\\temp\\monkey32.exe",
|
|
||||||
"dropper_target_path_win_64": "C:\\Windows\\temp\\monkey64.exe",
|
"dropper_target_path_win_64": "C:\\Windows\\temp\\monkey64.exe",
|
||||||
"exploit_lm_hash_list": ["lm_hash_1", "lm_hash_2"],
|
"exploit_lm_hash_list": ["lm_hash_1", "lm_hash_2"],
|
||||||
"exploit_ntlm_hash_list": ["nt_hash_1", "nt_hash_2", "nt_hash_3"],
|
"exploit_ntlm_hash_list": ["nt_hash_1", "nt_hash_2", "nt_hash_3"],
|
||||||
|
|
|
@ -104,7 +104,6 @@
|
||||||
"dropper_date_reference_path_windows": "%windir%\\system32\\kernel32.dll",
|
"dropper_date_reference_path_windows": "%windir%\\system32\\kernel32.dll",
|
||||||
"dropper_date_reference_path_linux": "/bin/sh",
|
"dropper_date_reference_path_linux": "/bin/sh",
|
||||||
"dropper_target_path_linux": "/tmp/monkey",
|
"dropper_target_path_linux": "/tmp/monkey",
|
||||||
"dropper_target_path_win_32": "C:\\Windows\\temp\\monkey32.exe",
|
|
||||||
"dropper_target_path_win_64": "C:\\Windows\\temp\\monkey64.exe"
|
"dropper_target_path_win_64": "C:\\Windows\\temp\\monkey64.exe"
|
||||||
},
|
},
|
||||||
"logging": {
|
"logging": {
|
||||||
|
|
|
@ -26,7 +26,6 @@ Config = namedtuple(
|
||||||
"exploit_password_list",
|
"exploit_password_list",
|
||||||
"exploit_lm_hash_list",
|
"exploit_lm_hash_list",
|
||||||
"exploit_ntlm_hash_list",
|
"exploit_ntlm_hash_list",
|
||||||
"dropper_target_path_win_32",
|
|
||||||
"dropper_target_path_win_64",
|
"dropper_target_path_win_64",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
|
@ -173,7 +173,6 @@ def test_format_config_for_agent__exploiters(flat_monkey_config):
|
||||||
expected_exploiters_config = {
|
expected_exploiters_config = {
|
||||||
"options": {
|
"options": {
|
||||||
"dropper_target_path_linux": "/tmp/monkey",
|
"dropper_target_path_linux": "/tmp/monkey",
|
||||||
"dropper_target_path_win_32": r"C:\Windows\temp\monkey32.exe",
|
|
||||||
"dropper_target_path_win_64": r"C:\Windows\temp\monkey64.exe",
|
"dropper_target_path_win_64": r"C:\Windows\temp\monkey64.exe",
|
||||||
"http_ports": [80, 443, 7001, 8008, 8080, 9200],
|
"http_ports": [80, 443, 7001, 8008, 8080, 9200],
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue