Skip to main content

A Python library for interacting with multiple CTF platforms.

Project description

CTFBridge

A unified Python interface for all major CTF platforms

PyPI Python Versions Docs CI License

FeaturesInstallQuickstartDocsLicense


✨ Features

  • Unified API for multiple CTF platforms
  • 🧠 Auto-detect platform type from just a URL
  • 🔐 Clean auth flow with support for credentials and API tokens
  • 🧩 Challenge enrichment — parses services and attachments from descriptions
  • 🔄 Persistent sessions — save/load session state with ease
  • 🤖 Async-first design — perfect for scripts, tools, and automation

📦 Installation

pip install ctfbridge

🚀 Quickstart

import asyncio

from ctfbridge import create_client


async def main():
    # Connect and authenticate
    client = await create_client("https://demo.ctfd.io")
    await client.auth.login(username="admin", password="password")

    # Get challenges
    challenges = await client.challenges.get_all()
    for chal in challenges:
        print(f"[{chal.category}] {chal.name} ({chal.value} points)")

    # Submit a flag
    await client.challenges.submit(challenge_id=1, flag="CTF{flag}")

    # View the scoreboard
    scoreboard = await client.scoreboard.get_top(5)
    for entry in scoreboard:
        print(f"[+] {entry.rank}. {entry.name} - {entry.score} points")


if __name__ == "__main__":
    asyncio.run(main())

🧩 Supported Platforms

CTFBridge works out of the box with:

Platform Login Challenges Submit Flags Scoreboard
CTFd
rCTF
GZCTF
HTB
Berg
EPT
CryptoHack
pwnable.tw
pwnable.xyz
pwnable.kr
More... 🚧 🚧 🚧 🚧

📖 See docs for details.

📚 Documentation

All guides and API references are available at: ctfbridge.readthedocs.io

🤝 Contributing

Contributions are welcome! We appreciate any help, from bug reports and feature requests to code enhancements and documentation improvements.

Please read our Contributing Guidelines to get started.

🛠️ Projects Using CTFBridge

Project Description
ctf-dl 🗃️ A CTF challenge bulk downloader
ctf-sniper 🎯 An automated flag submission tool
pwnv 🧠 A CTF workspace management tool

Using CTFBridge in the wild? Send a PR to feature it here!

📄 License

MIT License © 2025 bjornmorten

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ctfbridge-0.8.2.tar.gz (113.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ctfbridge-0.8.2-py3-none-any.whl (106.7 kB view details)

Uploaded Python 3

File details

Details for the file ctfbridge-0.8.2.tar.gz.

File metadata

  • Download URL: ctfbridge-0.8.2.tar.gz
  • Upload date:
  • Size: 113.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for ctfbridge-0.8.2.tar.gz
Algorithm Hash digest
SHA256 f955965f594c27a4d37e0e64dd8692f6814b92560dc8d88538ccd32b414fe6a0
MD5 3019a80e2ef29f4372a321358255fc44
BLAKE2b-256 f3eb32956bacc0000c1ee908e2f7c01855423396fc24c34790ca236d8430f9a1

See more details on using hashes here.

File details

Details for the file ctfbridge-0.8.2-py3-none-any.whl.

File metadata

  • Download URL: ctfbridge-0.8.2-py3-none-any.whl
  • Upload date:
  • Size: 106.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for ctfbridge-0.8.2-py3-none-any.whl
Algorithm Hash digest
SHA256 950cd5bdc5e0b57ef740986b2d259b1498b50ea0207e7545b4f337ae53fbaf25
MD5 68f259363292dd9cb6d40b8e8e75628e
BLAKE2b-256 2870f945d5c3508e483de6a600b588548681c1ba65ce874a2bcccc83b7486f9e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page