Skip to content

ShulkwiSEC/CTFPlatform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CTFPlatform

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.

🔧 Features

  • Web-based challenge management system
  • JSON-based challenge loader (auto.py)
  • Admin login with configurable credentials
  • SQLite database backend (ctf.db)
  • Configurable via .env file

🧩 Challenge Loader (auto.py)

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.

Example usage:

python auto.py

Ensure challenges.json exists in the root directory before running the script.

🔐 Admin Configuration

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=8000

You can change ADMIN_USERNAME and ADMIN_PASSWORD to secure your deployment.

🚀 Installation & Setup

1. Clone the Repository

git clone https://github.com/ShulkwiSEC/CTFPlatform.git
cd CTFPlatform

2. Create a Python Virtual Environment

python3 -m venv venv
source venv/bin/activate  # or venv\Scripts\activate on Windows

3. Install Dependencies

pip install -r requirements.txt

4. Set Environment Variables

Create a .env file with the content shown above.

5. Initialize the Challenge Database

python auto.py

6. Run the Platform

flask run --port=8000

📁 Project Structure

CTFPlatform/
├── 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

🧪 Development

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.

About

Minim CTFPlatform for local events

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors