Centos 安装漏洞靶场vulhub+vulfocus
CentOS-8.1.1911-x86_64-dvd1
搭建于VMWare Workstation 15.5
准备工作
国内yum源
换为国内yum源https://mirrors.tuna.tsinghua.edu.cn/help/centos/
或者,你也可以直接使用如下内容覆盖掉 /etc/yum.repos.d/CentOS-Base.repo 文件:(未经充分测试)
1 2 3 4 5 6 7 8 9 |
# 备份 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak # 根据tuna里不同版本的内容替换 vi /etc/yum.repos.d/CentOS-Base.repo # 更新缓存 sudo yum makecache |
安装docker
yum安装出现问题
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# 删除旧的Docker yum remove docker docker-common docker-selinux docker-engine # 安装相关依赖 yum install -y yum-utils \ > device-mapper-persistent-data \ > lvm2 # 安装Docker yum install docker-ce ## 安装Docker时可能出错,需要安装containerd.io dnf install https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm # 继续进行安装 yum install docker-ce docker-ce-cli # 开机自启 systemctl start docker systemctl enable docker |
安装docker-compose
1 2 3 4 5 6 |
[root@localhost ~]# pip3 -V pip 9.0.3 from /usr/lib/python3.6/site-packages (python 3.6) [root@localhost ~]# pip3 install docker-compose [root@localhost ~]# docker-compose version |
修改Docker
下载源
登录阿里云:https://cr.console.aliyun.com/cn-hangzhou/mirrors。最后一栏就是镜像加速器。会有自己的镜像加速器地址。
选择Centos
进行执行:
1 2 3 4 5 6 7 8 9 |
sudo mkdir -p /etc/docker sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://xxxxx.mirror.aliyuncs.com"] } EOF sudo systemctl daemon-reload sudo systemctl restart docker |
————————————————
版权声明:本文为CSDN博主「易水墨龙吟」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/yhflyl/java/article/details/104101312
vulhub
1 2 3 4 5 6 7 8 9 10 |
[root@centos opt]# git clone https://github.com/vulhub/vulhub.git 正克隆到 'vulhub'... remote: Enumerating objects: 19, done. remote: Counting objects: 100% (19/19), done. remote: Compressing objects: 100% (17/17), done. 接收对象中: 100% (9063/9063), 124.80 MiB | 208.00 KiB/s, 完成. remote: Total 9063 (delta 3), reused 10 (delta 1), pack-reused 9044 处理 delta 中: 100% (3530/3530), 完成. |
使用时,进入需要使用漏洞的文件夹即可,例如
1 2 3 4 5 6 7 8 9 |
# Enter the directory of vulnerability/environment cd flask/ssti # Compile environment docker-compose build # Run environment docker-compose up -d |
vulfocus
拉取镜像
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
[root@centos opt]# docker pull vulfocus/vulfocus:latest latest: Pulling from vulfocus/vulfocus 7e2b2a5af8f6: Pull complete 09b6f03ffac4: Pull complete dc3f0c679f0f: Pull complete fd4b47407fc3: Pull complete b32f6bf7d96d: Pull complete 3940e1b57073: Pull complete ce1fce2a6cf9: Pull complete 1f593157bb4c: Pull complete bde1ccd8f1b8: Pull complete 981a75146ed4: Pull complete 0d418ed87c2c: Pull complete cf966bf7408d: Pull complete 542ac87d0959: Pull complete Digest: sha256:78d8f5163d621acbf4d65034470f2488741fdace2c4144bfc5e85ebd2b0c9197 Status: Downloaded newer image for vulfocus/vulfocus:latest docker.io/vulfocus/vulfocus:latest |
运行 Vulfocus
1 2 3 4 5 6 7 |
[root@centos opt]# docker create -p 80:80 -v /var/run/docker.sock:/var/run/docker.sock -e VUL_IP=10.10.111.131 vulfocus/vulfocus 04cb761c5a08437a7cfaaf5b26d24aed3e5e579fac750e7a3a7485fa1876eb50 [root@centos opt]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES [root@centos opt]# docker start 04cb761c5a08437a7cfaaf5b26d24aed3e5e579fac750e7a3a7485fa1876eb50 |
发表评论