@app.route('/read') defread(): try: url = request.args.get('url') m = re.findall('^file.*', url, re.IGNORECASE) n = re.findall('flag', url, re.IGNORECASE) if m or n: return'No Hack' res = urllib.urlopen(url) return res.read() except Exception as ex: print(str(ex)) return'no response'
@app.route('/flag') defflag(): if session and session['username'] == 'fuck': returnopen('/flag.txt').read() else: return'Access denied'
if __name__ == '__main__': app.run(debug=True, host="0.0.0.0")