ข้ามไปยังเนื้อหาหลัก
ลด 50% ทุกแพลน เวลาจำกัด เริ่มต้นที่ $2.48/mo
CTFd

CTFd

CTFd คือเฟรมเวิร์ก Capture The Flag โอเพนซอร์สสำหรับจัดการแข่งขันด้านความปลอดภัย ห้องปฏิบัติการฝึกอบรม และหลักสูตร ปรับแต่งได้ด้วยปลั๊กอินและธีม และตั้งค่าได้ง่ายสำหรับทีมทุกขนาด

ภาพรวม

6.7k

GitHub stars

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. ยืนยันคำเตือน self-signed certificate
  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

ดู logs:

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 ของ server

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. แทนที่ SSL paths ใน Nginx config:

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/เดือน