forked from osirislab/Hack-Night
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.py
More file actions
20 lines (17 loc) · 696 Bytes
/
Copy pathapp.py
File metadata and controls
20 lines (17 loc) · 696 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from flask import Flask, render_template, request
app = Flask(__name__)
# Try to print this out to you
flag = "flag{nice_you_won_:3}"
# If you get that, try to print out flag.txt
# HINT: If you get an error or debug page, read what it says
# HINT: you will have to use subprocess:
# http://stackoverflow.com/questions/4760215/running-shell-command-from-python-and-capturing-the-output
@app.route('/', methods=['GET', 'POST'])
def do_thing():
if request.method == 'POST':
out = eval(request.form["runme"])
return render_template('index.html', output=out)
else:
return render_template('index.html', output=None)
if __name__ == "__main__":
app.run(debug=True)