CTFManager is my implementation of a manager of dockerised ctf environment.
It is writtent in go and stands at my first serious project in this language.
The manager is a simple cli tool that allows you to manage a team,it's members and the challenges they are working on.
Each team is a docker compose project that contains a set of services used to create a ctf network:
The network is a simple bridge network that allows the team members to connect to the services.
Each team network is created with the following configuration: subnet: 10.0.[team_id].0/24
A vpn service that allows the team to connect to the ctf network.
on the host a port between 50000 and 50254 is opened and mapped to the wireguard port. The team members can connect to the vpn using the host ip and the port.
A dns server that resolves the ctf domain to the wireguard network. each team member can access the services using the domain name once connected to the vpn.
Each challenges is stored in a separate folder and contains a dokcerfile and an .env file (will add more features like volume mounting and network configuration later).
Each challenge directory is in /challenges and must respect the following structure: <number>-<name>
with
- number: the number of the challenge in the network between 11 and 249
- name: the name of the challenge (must be alphanumeric)
- docker
- docker-compose
- the binary
- (Optional) go [if you want to build the binary]
go build -o ctfmanager
sudo cp ctfmanager /usr/local/bin
sudo ctfmanager setup
The CLI is still on my TODO list but here is a list of the commands that will be available:
ctfmanager setup
ctfmanager start
ctfmanager stop
ctfmanager team list
ctfmanager team create <team_name>
ctfmanager team delete <team_name>
ctfmanager team disable <team_name>
ctfmanager team enable <team_name>
ctfmanager member list <team_name>
ctfmanager member add <team_name> <member_name>
ctfmanager member remove <team_name> <member_name>
ctfmanager challenge list
ctfmanager challenge enable <challenge_name>
ctfmanager challenge disable <challenge_name>