Infrastructure-agnostic and DX-first CTF dynamic flag server for
Jeopardy and AnD formats
- Dynamic Leetspeak Flags — deterministic per-user flag generation via leetspeak character transformation (no hash suffixes)
- Netcat QnA Server — per-challenge TCP listeners with sequential Q&A flow
- CTFd Integration — token-based identity assignment and webhook event subscription
- Discord Notifications — webhook relay for flag generation and solve events
- Admin Web UI — server-rendered dashboard with challenge CRUD, CTFd config, and Discord settings
- Internal HTTP API — challenge authors fetch user-specific flags on the internal network
- Custom CTF Server API — standardized
/api/v1/submissions endpoint for non-CTFd platforms
- SQLite Config — all configuration stored in a single SQLite file
# Build
go build -o trout .
# Run
TROUT_ADMIN_PASSWORD=changeme TROUT_INTERNAL_API_KEY=changeme ./trout --db trout.db
| Flag |
Default |
Description |
--db |
trout.db |
Path to SQLite database |
--http-addr |
:8080 |
Address for admin UI and webhooks |
--internal-addr |
127.0.0.1:9125 |
Address for internal flag API |
| Variable |
Required |
Description |
TROUT_ADMIN_PASSWORD |
Yes |
Admin UI password; also derives the DB encryption key and flag pepper |
TROUT_INTERNAL_API_KEY |
Yes |
Auth key for the internal flag API (/internal/flag) |
External Network Internal Network
─────────────── ────────────────
Admin Browser CTFd / Custom CTF Server
│ │
▼ ▼
:8080/admin/* :8080/ctfd/webhook
(Basic Auth) :8080/api/v1/submissions
Challenge Containers
│
▼
:9125/internal/flag
Players → :{port}/tcp (netcat QnA → flag)
- Connect to challenge port
- Answer sequential questions
- Provide CTFd token (or skip for anonymous)
- Receive deterministic leetspeak-transformed flag
- Enterprise: CTFd sends webhooks to
/ctfd/webhook endpoint
- Open-Source: Requires installing the Trout plugin (see
docs/ctfd-plugin-spec.md)
- No CTFd: Custom CTF servers can POST to
/api/v1/submissions
Challenge authors fetch flags for users on the internal network. The challenge_id is the numeric CTFd challenge ID (as a string):
curl http://127.0.0.1:9125/internal/flag?user_id=42\&challenge_id=7