Centos部署vulhub时所遇到的问题
官⽅部署⽂档,直接使⽤⼏条命令即可⽅便快捷的部署漏洞靶场环境
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: docs.docker
Process: 16433 ExecStart=/usr/bin/dockerd-current --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-runc --exec-op  Main PID: 1643
3 (code=exited, status=1/FAILURE)
3⽉ 07 11:20:00 localhost.localdomain systemd[1]: Starting Docker Application
3⽉ 07 11:20:00 localhost.localdomain dockerd-current[16433]: unable to configure the Docker daemon with file /ing
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.
exited3⽉ 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 /packages/f3/3e/ca05e486d44e38eb495ca60b8ca526b192071717387346ed1031ecf78966/docker_compose-1.29.2-    100% |████████████████████████████████| 122kB 828kB/s
Collecting websocket-client<1,>=0.32.0 (from docker-compose)
Downloading /packages/f7/0c/d52a2a63512a613817846d430d16a8fbe5ea56dd889e89c68facf6b91cb6/websocket_client-0.59.0-py    100% |████████████████████████████████| 71kB 84kB/s
Collecting distro<2,>=1.5.0 (from docker-compose)
Downloading /packages/b5/7e/ddfbd640ac9a82e60718558a3de7d5988a7d4648385cf00318f60a8b073a/distro-1.7. (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 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
下载 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: www.docker/increase-rat 解决⽅法:使⽤⾃⼰的docker ID进⾏登录,没有账户去官⽹注册⼀个,很简单⽅便
进⼊到对应的漏洞⽬录下执⾏
docker-compose up -d
访问⾃⼰服务器的IP+端⼝即可访问
漏洞复现后执⾏关闭漏洞环境
docker-compose down

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。