Skip to content

Commit

Permalink
moving flask template into here
Browse files Browse the repository at this point in the history
  • Loading branch information
zardus committed Jan 16, 2025
1 parent 4101bc6 commit 2ae1cd1
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions pwnshop/templates/base/flask.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/opt/pwn.college/python

{% block imports %}
{% endblock %}
import flask
import os

app = flask.Flask(__name__)

{% block handlers %}
{% endblock %}
{% block initialization %}
{% endblock %}

{% if challenge.reset_uid %}
os.setuid(os.geteuid())
{% endif %}
{% if challenge.reset_path %}
os.environ["PATH"] = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
{% endif %}
app.secret_key = os.urandom(8)
{% if challenge.flask_host %}
app.config['SERVER_NAME'] = f"{{challenge.flask_host}}:{{challenge.flask_port or 80}}"
{% endif %}
app.run("{{challenge.flask_host or "0.0.0.0"}}", {{challenge.flask_port}})

0 comments on commit 2ae1cd1

Please sign in to comment.