• 2019.11.18CTFD搭建记录


    ### 0x01
    实验室纳新,准备在自己服务器搭建个ctfd给新生们玩玩,忙活了一天orz【大一刚开学就搭建过没这么费力啊。。】
    现在大二了没想到能折腾一天。。。
    直接说下我踩的坑吧,给后来的人们说说

    0x02

    一:

    首先想到搭建一个实现动态flag的ctfd,在搭建过程中发现docker出现了各种错误,因为太菜了调试好一个错误又出现另一个,时间比较急决定按照网上绝大部分的教程搭建,放弃docker.

    开始按照网上大部分教程搭建,直到最后。。运行serve.py报错。。。
    报错如下:
    no-module-named-flask-migrate
    no-module-named_internal
    主要就是这两个库不断报错,按照网上教程,有的说是pip安装冲突,卸载就好,但是对我没用。。
    还有说是需要换源。。换源后还是无法解决。。
    重置服务器后重新安装。。没用。。
    继续想办法。。

    三:

    突然想到可以使用docker一键搭建ctfd,而且没有环境困扰,,亲测简单实用呜呜呜。。
    希望后来看到的使用这个方法。。
    开始一键搭建:
    1:
    推荐换源:非常简单,我换的是阿里云源
    使用xshell连接服务器后
    在终端输入

    sudo vim /etc/apt/sources.list
    将里面的内容删除换成

    
    #添加阿里源
    deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
    
    

    替换完成保存
    然后执行命令
    sudo apt-get update
    sudo apt-get upgrade #更新所有软件
    注意这里更新后会弹出选项,非常重要,选不好就gg了
    无脑选N
    好了
    更新源后

    安装docker
    
    sudo apt-get install docker.io -y
    sudo groupadd docker
    sudo gpasswd -a ${USER} dockers
    udo systemctl enable docker #添加为开机自启动
    sudo systemctl start docker  #启动docker注销用户后再重新登陆
    

    这是网上的一种,我还是推荐一键安装docker,两种方法大家自己选

    安装docker:
    
    wget -qO- https://get.docker.com/ | sh
    
    直接执行一下脚本就可以了
    然后在安装docker-composeapt install docker-compose
    或者pip install docker-compose
    
    

    安装CTFd

    搜索镜像

    docker search CTFD
    

    拉取镜像

    docker pull ctfd/ctfd
    

    运行CTFd

    docker run -d -p 80:8000 ctfd/ctfd
    

    将80端口映射到docker8000
    对了记得开服务器端口嗷
    然后访问服务器ip
    出现ctfd页面
    搭建成功!

  • 相关阅读:
    48.Warning: (vsim-3534) [FOFIR]
    47.MIF和COE文件格式
    46.谈谈SDRAM的作用
    45.modelsim仿真include文件
    44.do文件格式
    43.技术与产品的价值
    42.JTAG接口使用注意
    41.使用Chipscope时如何防止reg_wire型信号被优化掉
    40.格雷码与二进制码之间的转换
    39.原码、反码、补码的转换
  • 原文地址:https://www.cnblogs.com/wangtanzhi/p/11881317.html
Copyright © 2020-2023  润新知