Improved error handling if firewall does not allow to open http server

This commit is contained in:
Vakaris 2018-08-30 15:42:07 +03:00
parent c8e131d913
commit f27f5cd919
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)
if not firewall.listen_allowed():
LOG.error("Firewall is not allowed to listen for incomming ports. Aborting")
return None, None
httpd = LockedHTTPServer(local_ip, local_port, src_path, lock)

View File

@ -95,7 +95,7 @@ class WebRCE(HostExploiter):
# Upload the right monkey to target
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
# Change permissions to transform monkey into executable file
@ -341,6 +341,10 @@ class WebRCE(HostExploiter):
http_thread.join(DOWNLOAD_TIMEOUT)
http_thread.stop()
LOG.info("Uploading process finished")
# 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):