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.2.tar.gz (37.0 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.2-py3-none-any.whl (49.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ctfbridge-0.2.2.tar.gz
  • Upload date:
  • Size: 37.0 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.2.tar.gz
Algorithm Hash digest
SHA256 ab5a4c4f5f432930e75c4989d83a460b86e5445a5c3b04b3f705502176b682ff
MD5 3537ab4e90fa16fb424373eb4209b9e9
BLAKE2b-256 193def9580084580bc13b1fa0bfc858eea015ad979f41566b2ce9dc1e30f7cd0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ctfbridge-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 49.2 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 97913789d21ef994edf08f49170a193a74a7db789460974ab2de29c8b9724e15
MD5 cfe14644e4f3aaf40056056ce7ff2a08
BLAKE2b-256 4f332a92c024804eb021225339017e7052f7558ff02d6157cfcc2627bcd05d16

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