A TCP server to facilitate the process of making checker for multi-question CTF challenge.
Watch go-ctf-quiz in action:
- From JSON -> quiz server, ready to publish!
- Authentication through CTFd access token
- Log each quiz attempt into a single JSON file
In order to get started, prepare a question file named question.json. The file should look like this:
{
"title": "Sample Quiz",
"created_at": 123,
"author": "teebow1e",
"flag": "FLAG{sample_flag}",
"timeout_amount": 30,
"questions": [
{
"id": 1,
"question": "What is question A?",
"answer": "Option A"
},
{
"id": 2,
"question": "What is question B?",
"answer": "Option B"
},
{
"id": 3,
"question": "What is question C?",
"answer": "Option C"
}
]
}After that, edit necessary information in the .env file, including CTFd link, listening host/port.
services:
part1:
image: ghcr.io/teebow1e/tcpquiz:latest
container_name: part1
ports:
- "127.0.0.1:7002:1337"
volumes:
- ./question.json:/app/question.json
- ../logs:/app/log
environment:
- HOST=0.0.0.0
- PORT=1337
- CTFD_URL=https://example.com
- MAX_CONNECTIONS=100
# Only when you want CTFd authentication
- STRICT_MODE=1
restart: unless-stoppedWhen everything is done, just docker compose up -d!
All quiz attempts are logged to ./log/quiz_attempts_<sanitized_title>.json. The log directory is automatically created by the application.
When using Docker Compose, the logs are persisted on the host machine through volume mounting:
volumes:
- ./question.json:/app/question.json
- ./log:/app/logEach log entry contains detailed information about the attempt including timestamp, user token, answers, and whether they completed the quiz successfully.