Agent: Fix WebRCE windows target path

This commit is contained in:
Ilija Lazoroski 2022-02-24 19:04:57 +01:00
parent 47306b0d38
commit 8a3a92182e
1 changed files with 4 additions and 6 deletions

View File

@ -34,7 +34,7 @@ class WebRCE(HostExploiter):
def __init__(self, monkey_target_paths=None):
"""
: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__()
self.monkey_target_paths = monkey_target_paths
@ -410,7 +410,7 @@ class WebRCE(HostExploiter):
"""
Gets destination path from one of WEB_RCE predetermined paths(self.monkey_target_paths).
: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
"""
if not url_to_monkey or ("linux" not in url_to_monkey and "windows" not in url_to_monkey):
@ -421,9 +421,7 @@ class WebRCE(HostExploiter):
try:
if "linux" in url_to_monkey:
return self.monkey_target_paths["linux"]
elif "windows-32" in url_to_monkey:
return self.monkey_target_paths["win32"]
elif "windows-64" in url_to_monkey:
elif "windows" in url_to_monkey:
return self.monkey_target_paths["win64"]
else:
logger.error(
@ -433,7 +431,7 @@ class WebRCE(HostExploiter):
return False
except KeyError:
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 "
"custom dict of monkey's destination paths"
)