A lightweight Capture The Flag (CTF) platform designed local events and for easy deployment and management of challenges. This project is ideal for internal training, CTF competitions, and cybersecurity education.
- Web-based challenge management system
- JSON-based challenge loader (
auto.py) - Admin login with configurable credentials
- SQLite database backend (
ctf.db) - Configurable via
.envfile
The auto.py script reads challenge definitions from challenges.json and injects them into the ctf.db database. It automates the challenge import process, making setup fast and repeatable.
python auto.pyEnsure challenges.json exists in the root directory before running the script.
Admin credentials are set via the .env file:
FLASK_APP=app.py
FLASK_ENV=development
SECRET_KEY=your-secret-key-here
DATABASE_URL=sqlite:///ctf.db
DEBUG=True
ADMIN_USERNAME=admin
ADMIN_PASSWORD=admin123
PORT=8000You can change ADMIN_USERNAME and ADMIN_PASSWORD to secure your deployment.
git clone https://github.com/ShulkwiSEC/CTFPlatform.git
cd CTFPlatformpython3 -m venv venv
source venv/bin/activate # or venv\Scripts\activate on Windowspip install -r requirements.txtCreate a .env file with the content shown above.
python auto.pyflask run --port=8000CTFPlatform/
├── app.py # Main Flask application
├── auto.py # Challenge loader script
├── challenges.json # Challenge definitions
├── ctf.db # SQLite database file
├── templates/ # HTML templates
├── static/ # Static files (CSS, JS)
├── requirements.txt # Python dependencies
└── .env # Configuration file
Set FLASK_ENV=development in your .env to enable auto-reloading and debug mode.
Feel free to contribute or fork this project for your own training and competitions.