A simple Python 3 tool to automatically download challenges and files from any CTFd instance.
Supports:
- Session cookie authentication or username/password login
.envor CLI-based usage- Downloads challenge descriptions and files
- Skips existing files if needed
# Clone the repo
git clone https://github.com/ha1fdan/CTFdScraper.git
cd CTFdScraper
# Set up a virtual environment (optional but recommended)
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txtYou can either use a .env file or pass arguments via the command line.
Create a .env file in the root folder:
SESSION=your_session_cookie # OR use USERNAME + PASSWORD below
USERNAME=your_username
PASSWORD=your_password
URL=https://your-ctfd-url.com
Then simply run:
python3 main.pypython3 main.py \
--username your_username \
--password your_password \
--url https://your-ctfd-url.comOr with a session cookie:
python3 main.py \
--session your_session_cookie \
--url https://your-ctfd-url.com--nofiles– Skip downloading files, just save challenge descriptions.--nooverwrite– Don't overwrite existingdescription.mdfiles.
All content will be saved under the output/ directory like this:
output/
└── category/
└── challenge_name/
├── description.md
└── challenge_file.ext
-
Python 3.7+
-
Libraries in
requirements.txt:requestsbeautifulsoup4python-dotenv
Made for automation lovers & CTF enthusiasts. Feel free to fork and adapt for your own CTF team setup!