メインコンテンツへスキップ
50% off 全プラン対象、期間限定。月額 $2.48/mo
CTFd

CTFd

CTFd は、セキュリティ競技、トレーニングラボ、コースを運営するためのオープンソースの Capture The Flag フレームワークです。プラグインとテーマでカスタマイズ可能で、どのサイズのチームでも簡単にセットアップできます。

概要

6.7k

GitHubスター

17

ページビュー

ライセンス Apache-2.0 バージョン Latest OS Ubuntu Server 24.04 LTS Min RAM 1 GB IP IPV4

アクセス

  1. Open the CTFd URL: https://<SERVER-IP>
  2. 自己署名証明書の警告を承認してください。
  3. ワンタイムセットアップウィザードを完了してください。
  4. 管理者アカウントを作成してください。
  5. CTF を設定してください。

重要なファイルとディレクトリ

  • インストールパス: /root/ctfd
  • Compose ファイル: /root/ctfd/docker-compose.yml
  • 環境ファイル: /root/ctfd/.env
  • Uploads: /root/ctfd/.data/CTFd/uploads
  • ログ: /root/ctfd/.data/CTFd/logs
  • MariaDB Data: /root/ctfd/.data/mysql
  • Redis データ: /root/ctfd/.data/redis
  • Nginxコンフィグ: /etc/nginx/sites-available/ctfd
  • SSLサーティフィケート: /etc/nginx/ssl/ctfd.crt
  • SSL 秘密鍵: /etc/nginx/ssl/ctfd.key

Docker 管理

コンテナを確認:

docker ps

ログを表示:

cd /root/ctfd
docker compose logs -f

サービスを再起動:

cd /root/ctfd
docker compose restart

サービスを停止:

cd /root/ctfd
docker compose down

サービスを開始:

cd /root/ctfd
docker compose up -d

Nginx の管理

テスト構成:

nginx -t

Nginx を再起動:

systemctl restart nginx

Nginx をリロード:

systemctl reload nginx

Nginx の状態を確認:

systemctl status nginx

ドメインでSSLを有効化する

1. ドメインをサーバーIPに向ける。

2. Nginx の設定ファイルを編集して置き換える server_name _; with your domain in both HTTP and HTTPS blocks:

vim /etc/nginx/sites-available/ctfd

3. Certbotをインストール:

apt install -y certbot python3-certbot-nginx

4. Generate a Let's Encrypt certificate:

certbot certonly --nginx --non-interactive --agree-tos --email [email protected] -d yourdomain.com

5. Nginx設定内のSSLパスを置き換える:

vim /etc/nginx/sites-available/ctfd
# Before:
    # ssl_certificate     /etc/nginx/ssl/ctfd.crt;
    # ssl_certificate_key /etc/nginx/ssl/ctfd.key;
# After:
    # ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
    # ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;

6. Reload Nginx:

systemctl reload nginx

セキュリティの他の記事

関連アプリ。

Deploy CTFd now. 月額2.48ドルから。