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 — 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 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 Flags Scoreboard
CTFd
rCTF
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

These open-source tools are powered by CTFBridge:

  • ctf-dl — 🗃️ A CTF challenge bulk downloader
  • 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.4.0.tar.gz (96.5 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.4.0-py3-none-any.whl (72.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ctfbridge-0.4.0.tar.gz
Algorithm Hash digest
SHA256 bba3a0f05d357f1e359dff3c765228dcb12a0dd9b04433c359d3e320d5e6c20f
MD5 122b34ca2156c83a3c095b49be290705
BLAKE2b-256 2b66cc25a040a419a79de30da5ee409f821ebd667577e1f09305aeba8135af35

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for ctfbridge-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ad0a55b65335d332a2f3c732f28b5fae4916666af81885286958da5fbc999f2a
MD5 bd6d24c0059561f7264c7167e101215e
BLAKE2b-256 c1c03b69e1fefa23e0bc177b4183f9732fa9101b73303438336a95e540e0ebfa

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