INNER CODE UNIT · Python

index

l4wio/CTF-challenges-by-me · 0x3004/100-ez/server.py:17

def index(options,value):
	options = '-'+options[:7]
	value = value[:10].replace('.','')
	print '[DEBUG] %s / %s' % (options,value)
	result = subprocess.Popen(['python',os.path.join(DIR,'ez.py'),options,os.path.join(DIR+'/data/',value)],stdout=subprocess.PIPE).communicate()
	resp = make_response(result[0])
	resp.headers['content-type'] = 'text/plain'
	return resp

if __name__ == "__main__":
	if(sys.argv[1]=='test'):
		app.run(host='0.0.0.0',port=4000,debug=True)
	else:
		PORT = 40000
		print '------------------------'
		print 'Running on port',int(PORT)
		WSGIServer(app, multithreaded=True,bindAddress=('0.0.0.0',int(PORT))).run()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…