Managing challenges for CTFs can be an ordeal. Our hosted challenge platform makes it easy to automatically deploy and manage challenges with technologies you're already familiar with.
# app.py
from flask import Flask
app = Flask(__name__)
@app.route("/")
def flag():
return "<p>flag{that_was_easy!}</p>"
FROM python:3
RUN pip install flask
COPY app.py .
EXPOSE 5000
CMD flask run --host=0.0.0.0
First we create a simple challenge that just emits our flag on connect. It must include a Dockerfile which attempts to EXPOSE a port.
Finally you should be able to build your docker image with
docker build -t project .
Next we create a new service inside of CTFd. This is where your challenge will live once it's deployed — no infrastructure setup required.
Finally we push our image up to CTFd, which will automatically handle the rest.
<image> registry.ctfd.io/demo/project
The challenge will go from
push to
building to
deployed until
finally your challenge will automatically be given a port.
Need an unencrypted TCP port for netcat? Read about Requesting a TCP Port.
docker push.