Added Host File
parent
d50a4793ae
commit
2a14ca1d3f
|
@ -110,6 +110,11 @@ class Listener:
|
|||
'Required' : True,
|
||||
'Value' : 'CF-RAY'
|
||||
},
|
||||
'HostPath' : {
|
||||
'Description' : 'Directory path for hosting files.',
|
||||
'Required' : False,
|
||||
'Value' : ''
|
||||
},
|
||||
'Headers' : {
|
||||
'Description' : 'Headers for the control server.',
|
||||
'Required' : True,
|
||||
|
@ -709,6 +714,18 @@ class Listener:
|
|||
except Exception as e:
|
||||
routingPacket = None
|
||||
|
||||
# handler hosting file
|
||||
static_dir = self.options['HostPath']['Value']
|
||||
|
||||
if static_dir != '':
|
||||
# make dynamic request uri
|
||||
host_file = request_uri.split('/')[-1]
|
||||
packages = static_dir + host_file
|
||||
|
||||
# host a packages file, will return valid file if exist
|
||||
if os.path.isfile(packages) and os.path.exists(packages):
|
||||
return send_from_directory(static_dir, host_file)
|
||||
|
||||
if routingPacket:
|
||||
# parse the routing packet and process the results
|
||||
dataResults = self.mainMenu.agents.handle_agent_data(stagingKey, routingPacket, listenerOptions, clientIP)
|
||||
|
|
Loading…
Reference in New Issue