INNER CODE UNIT · Python
index
Adamkadaban/CTFs · 1.CTFs/CSAW Red 2020/web/jwt/app.py:16
def index():
# if GET request return html
if request.method == 'GET':
return """
<h2>Request access</h2>
<form method=POST>
<input name=filename placeholder=filename>
<input type=submit>
</form>
<a href="flag.txt">flag.txt</a>
<a href="meme.jpg">meme.jpg</a>
<a href="hints.txt">hints.txt</a>
"""
# if post request set cookie
filename = request.form['filename']
# dont allow requesting access to flag