Skip to content
fwilson42 edited this page Dec 1, 2015 · 1 revision

To install Flagbase, you should first clone the repository:

~ $ git clone https://github.com/tjcsec/ctf-platform flagbase
~ $ cd flagbase

You'll need to install the dependencies:

~/flagbase $ sudo pip install -r requirements.txt

Edit config.py and database.py to your liking, and create a secrets file. The secrets file should look like this:

mailgun_url: https://api.mailgun.net/v3/yourdomain.com
mailgun_key: key-yourmailgunkey
recaptcha_key: yourrecaptchakey
recaptcha_secret: yoursecret
key: flasksessionkey

flasksessionkey should be just some random characters. Keep the secrets file secret.

Once you have set everything up, you are ready to create the database tables:

~/flagbase $ ./ctftool create-tables
Tables created
~/flagbase $

Now, you can add Challenges. The recommended way to do this is by creating a problem.yml file that looks like this:

name: The name of your problem
author: Your name (someircnickname)
category: Misc
description: The text you want the user to see when you they view the problem. It <strong>can</strong> include HTML.
points: 100
flag: the problem solution

To import this, run:

~/flagbase $ ./ctftool add-challenge /path/to/problem.yml
Challenge added with id 1
~/flagbase $

Flagbase can handle your static files, but it doesn't have to. You can use the tag normally.

You can run the development server with python app.py. You can then access your Flagbase instance on localhost:8001 in a web browser. The admin interface will be at localhost:8001/admin/. To create an admin user, use:

~/flagbase $ ./ctftool add-admin
Username: your admin username
Password:
AdminUser created
~/flagbase $

You can then log in to the admin interface.

Clone this wiki locally