最新版H1ve靶场搭建记录
2020-06-04 10:46:17 Author: forum.90sec.com(查看原文) 阅读量:974 收藏

前言

最近360club群里很多师傅在搭建靶场,有不少搭建成功了的,也有一些师傅卡在H1ve的搭建问题,借此机会,小弟我写了个靶场搭建记录,

搭建环境

cat /etc/redhat-release    

image

安装docker

所需要的软件包

sudo yum install -y yum-utils device-mapper-persistent-data lvm2 bind-utils

设置yum源

sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

执行安装docker

sudo yum install docker-ce

启用并加入开机启动

sudo systemctl start docker
sudo systemctl enable docker

验证docker是否安装成功

image

安装docker-compose

安装python-pip

yum -y install epel-release
yum -y install python-pip

查询python-pip是否安装成功docker version

pip -V 

image

对安装的pip升级指令

pip install --upgrade pip

然后安装docker-compose报错

pip install docker-compose

报错代码:

ERROR: Command errored out with exit status 1:
     command: /usr/bin/python2 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-I8svWV/ansible/setup.py'"'"'; __file__='"'"'/tmp/pip-install-I8svWV/ansible/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
         cwd: /tmp/pip-install-I8svWV/ansible/
    Complete output (19 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-I8svWV/ansible/setup.py", line 315, in <module>
        main()
      File "/tmp/pip-install-I8svWV/ansible/setup.py", line 310, in main
        setup(**setup_params)
      File "/usr/lib64/python2.7/distutils/core.py", line 112, in setup
        _setup_distribution = dist = klass(attrs)
      File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 269, in __init__
        _Distribution.__init__(self,attrs)
      File "/usr/lib64/python2.7/distutils/dist.py", line 287, in __init__
        self.finalize_options()
      File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 302, in finalize_options
        ep.load()(self, ep.name, value)
      File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2443, in load
        return self.resolve()
      File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2453, in resolve
        raise ImportError(str(exc))
    ImportError: 'module' object has no attribute 'check_specifier'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

解决方法: sudo pip install --upgrade setuptools==30.1.0

安装ctfd

git clone https://gitee.com/quan2020/H1ve.git

会发现又报错了

image

执行

git clone https://gitee.com/quan2020/H1ve.git

下载完之后ls会 出现H1ve文件夹

image

image

cd H1ve

直接docker-compose -f single.yml up会因为db版本不同会报错所以先要修改版本

image

centos7下使用YUM安装mariadb-10.4.12

image

输入vi single.yml修改db版本号

image

如果你上面一直和我走下来了,那么你修改完的db版本应该和我一样为10.4.12

image

保存并退出

执行docker-compose -f single.yml up

进行安装

结尾

但有些师傅可能遇到这个问题了

image

发现这个问题是docker: Error response from daemon: ... : net/http: TLS handshake timeout.出现这个问题的原因是因为该命令默认从docker远端镜像仓库中拉取镜像,但由于远端仓库的服务器是在国外,我们国内有的用户很可能都访问不了,所以会报错。

解决方法:直接使用阿里云的镜像加速器

image

然后重新跑指令,直到出现这个页面,

image

默认的端口是8000,访问服务器的IP地址.记得开放服务器的8000端口

最后在设置下相关数据

image

搭建 完成,然后来到帅气的界面 over

image

文章来源: https://forum.90sec.com/t/topic/1103/1
如有侵权请联系:admin#unsafe.sh