Skip to main content

CTFd Downloader

CTFd インスタンスから課題情報と添付ファイルを自動取得・整理する Python ツールです。

機能

  • Token 認証またはユーザ名/パスワード認証による CTFd API へのアクセス
  • 課題一覧・詳細情報の取得
  • 添付ファイルの自動ダウンロード
  • challenges/<Category>/<Challenge Name>/ の構造で整理保存
  • メタデータ(JSON)と README(Markdown)の自動生成
  • 並列ダウンロードとリトライ機能
  • ロギングとエラーハンドリング

インストール

pip install ctfd-dl

設定

  1. config.example.yaml を config.yaml にコピー
  2. config.yaml を編集して CTFd インスタンスの情報を設定
base_url: "https://ctf.example.com"
api_token: "your_api_token_here"  # 推奨
# または
username: "your_username"
password: "your_password"
output_dir: "./challenges"
concurrency: 4

または環境変数を使用:

export CTFD_BASE_URL="https://ctf.example.com"
export CTFD_API_TOKEN="your_api_token_here"

使用方法

パッケージをインストールすると、ctfd-dl コマンドが利用可能になります。

# 基本的な使用
ctfd-dl --config config.yaml

# コマンドライン引数で設定を上書き
ctfd-dl --base-url https://ctf.example.com --token YOUR_TOKEN --output ./my_challenges

# メタデータのみ取得(ファイルダウンロードをスキップ)
ctfd-dl --skip-download

# 詳細ログを出力
ctfd-dl --verbose

出力構造

challenges/
└─ <Category>/
   └─ <Challenge Name>/
      ├─ files/
      │  ├─ attached1.zip
      │  └─ script.py
      ├─ metadata.json
      └─ README.md

注意事項

  • 法的注意: 他者運営の CTFd インスタンスにアクセスする場合は、必ず運営者の許可を得てください。
  • セキュリティ: ダウンロードした実行ファイルは直接実行せず、適切な環境で解析してください。
  • サーバ負荷: 並列ダウンロード数(concurrency)を適切に設定し、サーバに負荷をかけないようにしてください。

ライセンス

MIT License

作者

tikisan (GitHub: @tikipiya)

Metadata

Release files for ctfd-dl 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ctfd-dl 1.1.0
File Size Uploaded Provenance Actions
ctfd_dl-1.1.0.tar.gz 14.7 kB Without provenance Details for ctfd_dl-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ctfd-dl 1.1.0
File Interpreter ABI Platform Actions
ctfd_dl-1.1.0-py3-none-any.whl Python 3 none any Details for ctfd_dl-1.1.0-py3-none-any.whl

Total release size: 34.1 kB

Release files / ctfd_dl-1.1.0.tar.gz

Download URL ctfd_dl-1.1.0.tar.gz
Size 14.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d58cf62c807be1c5463c9dc07676511d703643b4fcd9a19873976be5ea7e6bd7
BLAKE2b-256 checksum
How to use checksums
12e04b66d989a898c818f65e399695caf4031ac52a43e6e32cb1f2223a92b275
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / ctfd_dl-1.1.0-py3-none-any.whl

Download URL ctfd_dl-1.1.0-py3-none-any.whl
Size 19.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8c5701484fd6243aead0a4d6134276be5dc408469e3462487d5842fefcc06e2e
BLAKE2b-256 checksum
How to use checksums
2908d7efadd83cbc72f6e2aef96f157648c0e8d8772a59e0ed9954498922c520
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for ctfd-dl 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page