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

FeaturesQuickstartInstallDocsLicense


✨ 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

🚀 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())

📦 Installation

pip install ctfbridge

🧩 Supported Platforms

CTFBridge works out of the box with:

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

📖 See docs for details.

📚 Documentation

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

🛠️ 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!

🤝 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.

📄 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.8.tar.gz (124.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.8.8-py3-none-any.whl (123.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ctfbridge-0.8.8.tar.gz
Algorithm Hash digest
SHA256 3fbbae3b35829b62b793f8c1e98c984f7d5d25358e6875b8262f1495617c7e80
MD5 6a01fda9c11405948b92c560bbb2d829
BLAKE2b-256 952f0fa76d614fea93db72e5134552d6278b3ae555f0ffb0b0fd8660f57d0e35

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for ctfbridge-0.8.8-py3-none-any.whl
Algorithm Hash digest
SHA256 bcde031f1a44da4aac1fcccb1fb8ecdbf7ab1b44943ab6a60cb93859aca92ea8
MD5 e545e44c76c3a097432f2c7ab47c46d5
BLAKE2b-256 2cf92cdb233dfad8ac36faf0a2d8304fd7fca8557a20cf3887bc15036442517b

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