Skip to main content

A Python library for interacting with multiple CTF platforms.

Project description

CTFBridge

PyPI Docs License

CTFBridge is a Python library for interacting with multiple CTF platforms through a unified interface.

[!WARNING] Under active development – expect breaking changes.

Overview

CTFBridge provides a simple, unified API to interact with different Capture the Flag (CTF) competition platforms like CTFd and more.

It hides platform-specific quirks and gives you consistent access to challenges, submissions, and authentication across platforms.

Features

  • 🌟 Unified API across different CTF platforms
  • 📄 Fetch challenges, attachments, and challenge metadata
  • 🔑 Handle logins, sessions, and authentication cleanly
  • ⚡ Automatic rate-limiting and retry handling
  • 🧩 Easy to extend with new platform clients
  • 🧪 Demo client for quick testing without external servers

Installation

pip install ctfbridge

Basic Usage

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

Platform Status
CTFd ✅ Supported
rCTF ✅ Supported
Berg ✅ Supported
EPT ✅ Supported
HTB ✅ Supported
More platforms 🚧 In development

Documentation

Full documentation: ctfbridge.readthedocs.io

Projects Using CTFBridge

These projects use ctfbridge:

  • ctf-dl — Automates downloading all challenges from a CTF.
  • pwnv — Manages 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.2.1.tar.gz (37.1 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.2.1-py3-none-any.whl (49.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ctfbridge-0.2.1.tar.gz
Algorithm Hash digest
SHA256 4ff46dfadeba8406108da0e554d9b7f8bc4728f82da0f2a70c9e7cf4182ba6ec
MD5 e17fb8bf4fe4c2c76f96d737fadeac3b
BLAKE2b-256 fb6411a529631a3ab333cbbb87abecb2342b71d23b17f6ef1083bf56c70bff35

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ctfbridge-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 49.3 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.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 58bf01c80fa8fc768392f9daa8dc9c579f36d1369af82866cb48c6cbddf7ef91
MD5 e6e5e0b2ca4d6590c143f974833db529
BLAKE2b-256 0a9aa186a32024d4be374e9cdacc5b766a63e1a7928535769d67cc2fa9516cfd

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