官方部署文档,直接使用几条命令即可方便快捷的部署漏洞靶场环境
Vulhub - Docker-Compose file for vulnerability environmenthttps://vulhub.org/#/docs/install-docker-compose/
1、首先是网络问题,服务器直接使用GitHub下载因为某些原因,下载失败。使用官网文档中的docker加速器时在重启docker时出现docker启动报错
[root@localhost docker]# systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since 一 2022-03-07 11:20:00 CST; 1min 4s ago
Docs: http://docs.docker.com
Process: 16433 ExecStart=/usr/bin/dockerd-current --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-runc --exec-opt native.cgroupdriver=systemd --userland-proxy-path=/usr/libexec/docker/docker-proxy-current --init-path=/usr/libexec/docker/docker-init-current --seccomp-profile=/etc/docker/seccomp.json $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $ADD_REGISTRY $BLOCK_REGISTRY $INSECURE_REGISTRY $REGISTRIES (code=exited, status=1/FAILURE)
Main PID: 16433 (code=exited, status=1/FAILURE)
3月 07 11:20:00 localhost.localdomain systemd[1]: Starting Docker Application Container Engine...
3月 07 11:20:00 localhost.localdomain dockerd-current[16433]: unable to configure the Docker daemon with file /etc/docke...ring
3月 07 11:20:00 localhost.localdomain systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
3月 07 11:20:00 localhost.localdomain systemd[1]: Failed to start Docker Application Container Engine.
3月 07 11:20:00 localhost.localdomain systemd[1]: Unit docker.service entered failed state.
3月 07 11:20:00 localhost.localdomain systemd[1]: docker.service failed.
解决方法,删除?/etc/docker/下的?daemon.json文件,随后重启docker正常
systemctl restart docker 2、无法安装docker-compose
解决方法:因为centos默认不支持pip命令,所以需要先安装pip在进行安装
yum -y install epel-release
yum -y install python-pip
pip install docker-compose
3、安装完pip后安装docker-compose仍然失败
pip install docker-compose
Collecting docker-compose
Downloading https://files.pythonhosted.org/packages/f3/3e/ca05e486d44e38eb495ca60b8ca526b192071717387346ed1031ecf78966/docker_compose-1.29.2-py2.py3-none-any.whl (114kB)
100% |████████████████████████████████| 122kB 828kB/s
Collecting websocket-client<1,>=0.32.0 (from docker-compose)
Downloading https://files.pythonhosted.org/packages/f7/0c/d52a2a63512a613817846d430d16a8fbe5ea56dd889e89c68facf6b91cb6/websocket_client-0.59.0-py2.py3-none-any.whl (67kB)
100% |████████████████████████████████| 71kB 84kB/s
Collecting distro<2,>=1.5.0 (from docker-compose)
Downloading https://files.pythonhosted.org/packages/b5/7e/ddfbd640ac9a82e60718558a3de7d5988a7d4648385cf00318f60a8b073a/distro-1.7.0.tar.gz (58kB)
100% |████████████████████████████████| 61kB 29kB/s
Running setup.py (path:/tmp/pip-build-QeGxhM/distro/setup.py) egg_info for package distro produced metadata for project name unknown. Fix your #egg=distro fragments.
Collecting requests<3,>=2.20.0 (from docker-compose)
Could not find a version that satisfies the requirement requests<3,>=2.20.0 (from docker-compose) (from versions: )
No matching distribution found for requests<3,>=2.20.0 (from docker-compose)
解决方法:采用离线安装docker-compose
访问https://github.com/docker/compose/releases
下载 docker-compose-Linux-x86_64,下载本地后改名成docker-compose
?通过文件传输到服务器/usr/local/bin/目录下,再给权限,运行docker-compose?--version看是否成功
4、漏洞环境启动时,需要pull相关数据,结果提示限制pull次数,是匿名下请求次数过高
toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
解决方法:使用自己的docker ID进行登录,没有账户去官网注册一个,很简单方便
?进入到对应的漏洞目录下执行?
docker-compose up -d
访问自己服务器的IP+端口即可访问
漏洞复现后执行关闭漏洞环境
docker-compose down
|