I was recently tasked with setting up a ctf environment and I have been researching ever since. After looking through other platforms such as rctf and fbctf, I settled on CTFD. CTFd is a Capture The Flag (CTF) framework designed for ease of use for both administrators and users. Not only is CTFd full featured, but it's open source, written in the simple Flask framework, and easy to modify. So lets get into it!
Prerequisites
(There isn't many tbh)
- VPS (with your prefered flavour of Linux)
- Internet connection
I am still in the testing stages of this platform. Therefore, I will be not be deploying this on a live production server. I will be working on a virtual machine instead. I will be using a fresh install of Ubuntu 20.04 on VMware Workstation Pro.
Install Docker & Docker Compose
The first thing we need to ensure that we have is docker
and docker compose
! This step is very crucial as we are going to be running our webserver on a docker container
. You can take a look at this post of mine to install both of these :) !
TLDR; Here are the install commands
root@ubuntu:~# sudo apt install docker.io docker-compose
Before we move on lets check if the installation was successful
root@ubuntu:~# docker --version
root@ubuntu:~# docker-compose --version
Clone the CTFd repository
Now that we have docker
and docker compose
installed, its time to clone CTFd's github repository onto our local machine.
root@ubuntu:/ctfd# git clone github.com/CTFd/CTFd.git
Build CTFd docker container
Following the git clone, we are now ready to build the docker image. All you have to do is enter 1 command.
root@ubuntu:/#cd /CTFd root@ubuntu:/CTFd# docker-compose up
Now we wait for it to finish building!
Once we see something like this, we are DONE!!
Setup the CTFd portal
Now that we are all setup we can access the server IP address on port 80 using any browser. We will be greeted with this page.
Once we see this page, we are all set! We can go head and configure the portal to our liking and conduct our CTF event!
That was easier than I thought. I was kinda intimidated by the thought of setting up a CTF framework but it went pretty smooth! I hope to use this framework for the project that I am embarking on! Hope you learnt something too ♥!
~Nee