Agent: Override `HostExploiter`'s `pre_exploit()` in `WebRCE`

This commit is contained in:
Shreya Malviya 2022-02-24 13:18:15 +05:30
parent 87547c4da1
commit eb9adc08c2
1 changed files with 11 additions and 9 deletions

View File

@ -38,15 +38,7 @@ class WebRCE(HostExploiter):
Dict in format {'linux': '/tmp/monkey.sh', 'win32': './monkey32.exe', 'win64':... }
"""
super(WebRCE, self).__init__()
if monkey_target_paths:
self.monkey_target_paths = monkey_target_paths
else:
self.monkey_target_paths = {
"linux": self.options["dropper_target_path_linux"],
"win32": self.options["dropper_target_path_win_32"],
"win64": self.options["dropper_target_path_win_64"],
}
self.HTTP = [str(port) for port in self.options["http_ports"]]
self.monkey_target_paths = monkey_target_paths
self.vulnerable_urls = []
self.target_url = None
@ -121,6 +113,16 @@ class WebRCE(HostExploiter):
return True
def pre_exploit(self):
if not self.monkey_target_paths:
self.monkey_target_paths = {
"linux": self.options["dropper_target_path_linux"],
"win32": self.options["dropper_target_path_win_32"],
"win64": self.options["dropper_target_path_win_64"],
}
self.HTTP = [str(port) for port in self.options["http_ports"]]
super().pre_exploit()
@abstractmethod
def exploit(self, url, command):
"""