CTF trivia server (w/ socat)
A trivia server is very useful when you want to do question-based challenges, but don't want to have to resort to challenge spam. A trivia server will typically be accessed via commandline using the Netcat command, such as shown below

To simplify the process, we can use a Python script combined with the socat utility (read more here) to allow participants to connect to the server
Here is a very minimalistic server, which was used for the Secure The Network DFIR challenge series
It was accompanied by a JSON file containing the question bank, as well as the Dockerfile to spin up the server
The server can be built and ran using the following commands
Do note that on networks with very restrictive firewalls (e.g. school or corporate networks), access to the socat server may be blocked, as connections are not made via the common HTTP/HTTPS and DNS ports. If you anticipate that many participants will be connected to such networks, you may wish to consider using a webpage instead, or revert to using flag-based challenges instead
Edit 2025-07-15
I have modified the original trivia server script to be much more lively and interesting. You can get the source code for the new server here

Last updated