Merge pull request #183 from VakarisZ/web_rce_bugfix

Improved error handling if firewall does not allow to open http server
This commit is contained in:
itaymmguardicore 2018-09-05 17:55:41 +03:00 committed by GitHub
commit 95ee92ff08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -407,6 +407,7 @@ class HTTPTools(object):
local_ip = get_interface_to_target(host.ip_addr) local_ip = get_interface_to_target(host.ip_addr)
if not firewall.listen_allowed(): if not firewall.listen_allowed():
LOG.error("Firewall is not allowed to listen for incomming ports. Aborting")
return None, None return None, None
httpd = LockedHTTPServer(local_ip, local_port, src_path, lock) httpd = LockedHTTPServer(local_ip, local_port, src_path, lock)

View File

@ -95,7 +95,7 @@ class WebRCE(HostExploiter):
# Upload the right monkey to target # Upload the right monkey to target
data = self.upload_monkey(self.vulnerable_urls[0], exploit_config['upload_commands']) data = self.upload_monkey(self.vulnerable_urls[0], exploit_config['upload_commands'])
if data is not False and data['response'] is False: if data is False:
return False return False
# Change permissions to transform monkey into executable file # Change permissions to transform monkey into executable file
@ -341,7 +341,11 @@ class WebRCE(HostExploiter):
http_thread.join(DOWNLOAD_TIMEOUT) http_thread.join(DOWNLOAD_TIMEOUT)
http_thread.stop() http_thread.stop()
LOG.info("Uploading process finished") LOG.info("Uploading process finished")
return {'response': resp, 'path': paths['dest_path']} # If response is false exploiter failed
if resp is False:
return resp
else:
return {'response': resp, 'path': paths['dest_path']}
def change_permissions(self, url, path, command=None): def change_permissions(self, url, path, command=None):
""" """