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
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.0.tar.gz (32.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.0-py3-none-any.whl (37.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ctfbridge-0.2.0.tar.gz
  • Upload date:
  • Size: 32.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.0.tar.gz
Algorithm Hash digest
SHA256 9952c6bbd6f150263c3b2726bc6ad4244c3c98c47915a5767943820d9328135a
MD5 8daf8a156d1a79234ab2ee81b76831f4
BLAKE2b-256 28c66395d344009ef99fc9dc92804204f06d612a1457e790cfdeb5105715e828

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ctfbridge-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 37.8 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0d867524a57337c90de359c22dc6fe68b1fd172acb843fe256a9c86c972c0414
MD5 22890118a3d277c9424757160a562d8d
BLAKE2b-256 197ca7523b4b97af8210489bb73c35fcd4dbae65b316e0dc697279cccc4bc54f

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