Coder Social home page Coder Social logo

fengleiyige123 / ocean_ctf Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tongchengbin/ocean_ctf

0.0 0.0 0.0 21.96 MB

开源CTF平台 动态flag docker部署管理 用户界面用flask jinjia2 模板+ jquery bootstrap 管理端由flask提供API VUE+element构建

Python 67.19% Shell 3.65% CSS 5.70% JavaScript 3.14% HTML 20.15% Dockerfile 0.17%

ocean_ctf's Introduction

🌊 Ocean CTF

一个动态flag练习靶场平台

✅ TODO

  • 容器管理
  • 题库管理
  • 动态flag
  • 作弊检测
  • 公告通知
  • 动态启动题库
  • 题库隔离
  • 公告通知
  • 排行榜
  • 快速部署
  • 大屏展示
  • 权限分离
  • 一键部署
  • fix bug
  • fix bug

🚀 预览

线上地址 http://159.75.92.142:8080 管理后台 http://159.75.92.142:8080/manager 访客账号 test/test
默认超级管理员账号 superuser/admin

🌍 使用

如何添加容器主机?

  1. 启用docker api —H tcp://0.0.0.0:2375 (一定要添加防火墙规则仅允许指定ip访问)

  2. curl 127.0.0.1:2375/_ping 输出OK 说明启用成功

  3. 添加主机ip 一栏是web 应用的入口如果是公网云请填写公网地址、如果是虚拟机请填写与物理机同一网段地址,docker API 一栏可以填写127.0.0.1:2375 这是由于部分服务器仅仅只对本地地址开放了2375端口,而如果是docker-compose 部署则无法使用127.0.0.1 可以使用docker的172网段代替。

📖 安装步骤

clone
git clone https://github.com/tongchengbin/ocean_ctf.git /opt/ocean_ctf

docker方式

docker 编排会引用.env文件中的环境变量

前置环境
docker、docker-compose
compose编排
cd /opt/ocean_ctf
docker-compose up -d
访问测试
curl 127.0.0.1:8080

手动安装

前置环境
Python 3.6+
mysql 5.6+
redis
nginx(可选)
docker(可选)
supervisord(可选)

安装Python依赖
cd /opt/ocean_ctf
pip3 install -r requirements.txt
快速运行
chmod +x ./run.sh
./run.sh

📗 进阶文档

通过nginx代理

默认情况下项目已经给管理后台的页面做了静态处理 但是建议使用nginx处理静态文件

# vim /etc/nginx/conf.d/ctf.conf
server {
        listen       8080 default_server;
        server_name  _;
        location / {
        proxy_pass http://127.0.0.1:5000;
        }
    location /manager {
        alias /opt/ocean_ctf/install/manager/dist;
    }
    }
使用supervisord托管程序

因为celery可能会因为程序异常而退出 所以使用supervisord托管celery 同时也可方便管理,如果使用supervisord托管进程,不要使用run.sh 启动避端口冲突

  1. 安装supervisord

    yum install -y supervisord
  2. 配置托管程序

    cp ./install/config/supervisord/ocean.ini /etc/supervisord.d/
  3. 设置开机启动

    systemctl enable supervisord.service
    systemctl start supervisord.service
开启 Docker API 2375 端口
开启API
vim /usr/lib/systemd/system/docker.service
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock -H tcp://0.0.0.0:2375
systemctl daemon-reload
systemctl restart docker

检查API
curl 127.0.0.1:2375/info

️️❗ 常见问题&注意事项

安装常用环境依赖

yum -y install python36-devel

pip 报错mysqlclinet

centos: sudo yum install mysql-devel
ubuntu: sudo apt-get install libmysqlclient-dev

📃 题库

题库仓库:GitHub - tongchengbin/ctfdb: ctf 题库

💻 题库格式说明

TODO

开发

后台管理源码:https://github.com/tongchengbin/ocean_manager

其他截图

  • 容器主机详情

  • 编译镜像

  • 编译进度

  • 镜像列表

  • 添加动态题库

  • 首页

  • 启动容器

  • 靶场

    动态靶场

  • 管理后台

    2

ocean_ctf's People

Contributors

tongchengbin avatar zzmarquis avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.