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 — no per-platform hacks
  • 🧠 Auto-detect platform type from just a URL
  • 🔐 Clean auth flow with support for credentials and API tokens
  • 🧩 Challenge enrichment — authors, categories, services, attachments
  • 🔄 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 flags
    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    Auth      Challenges      Flags      Scoreboard  
CTFd
rCTF
HTB
Berg
EPT
More... 🚧 🚧 🚧 🚧

📖 See docs for details.

📚 Documentation

All guides, API references, and platform notes 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

These open-source projects are already using CTFBridge:

  • ctf-dl — 🗃️ Download all CTF challenges in bulk
  • pwnv — 🧠 CLI to manage CTFs and challenges

📄 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.3.0.tar.gz (85.6 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.3.0-py3-none-any.whl (77.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ctfbridge-0.3.0.tar.gz
  • Upload date:
  • Size: 85.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for ctfbridge-0.3.0.tar.gz
Algorithm Hash digest
SHA256 c0c7c7c216cc7486f5dc64116fd63b4669ead68dac1a392c55f4e1096ffdb95a
MD5 d0f1beb05890c54e6f043eba4597cef0
BLAKE2b-256 6c2aacccaae5a24b560590a9a307e961c90d9e4d2b311c4930cad392130f78e5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ctfbridge-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 77.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for ctfbridge-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c4407580ce5c8b813bf05bf14d4a16fbeb58c0bb2d9172ebfc0dcbeab648f239
MD5 216ba5066ee6d243baa58b1ac66af34f
BLAKE2b-256 6bb26ddf94455290a4fa5b714e60bb7f8776ebe83094b0ce31cb97bdc7f472d5

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