[root@localhost ~]# cd /etc/yum.repos.d #更新源
[root@localhost yum.repos.d]# mkdir repos_bak
[root@localhost yum.repos.d]# mv *.repo repos_bak
[root@localhost yum.repos.d]# yum clean all && yum makecache
[root@localhost yum.repos.d]# yum update -y
[root@localhost yum.repos.d]# yum install -y yum-untils device-mapper-persistent-data lvm2 #安装基本驱动依赖
[root@localhost yum.repos.d]# yum -y install yum-utils #使用阿里的镜像源
[root@localhost yum.repos.d]# yum makecache fast
[root@localhost yum.repos.d]# yum -y install docker-ce #安装docker
[root@localhost yum.repos.d]# yum list docker-ce --showduplicates | sort -r
[root@localhost yum.repos.d]# docker version
[root@localhost yum.repos.d]# systemctl start docker #启动服务
[root@localhost yum.repos.d]# systemctl enable docker #开机自启
[root@localhost yum.repos.d]# vi /etc/docker/daemon.conf #设置国内源加速镜像
{
"registry-mirrors": [
"https://dockerhub.azk8s.cn",
"https://reg-mirror.qiniu.com",
"https://registry.docker-cn.com",
"http://hub-mirror.c.163.com",
"https://3laho3y3.mirror.aliyuncs.com",
"http://f1361db2.m.daocloud.io",
"https://mirror.ccs.tencentyun.com"
}
[root@localhost yum.repos.d]# systemctl daemon-reload #重启docker
[root@localhost yum.repos.d]# systemctl restart docker
[root@localhost yum.repos.d]# yum install python-pip.noarch #安装docker-compose
[root@localhost yum.repos.d]# pip install --upgrade pip
[root@localhost yum.repos.d]# pip install docker-compose
[root@localhost yum.repos.d]# yum install docker-compose -y
[root@localhost /]# mkdir cve 创建cve文件夹,导入vulhub-master.zip
[root@localhost /]# cd cve/
[root@localhost cve]# yum install unzip -y
[root@localhost cve]# unzip vulhub-master.zip
[root@localhost cve]# cd vulhub-master
[root@localhost vulhub-master]# ls
activemq cgi django electron gitea hadoop jenkins laravel mojarra ofbiz phpunit rsync solr tikiwiki xstream
apereo-cas coldfusion dns fastjson gitlab httpd jetty libssh mongo-express opensmtpd postgres ruby spark tomcat xxl-job
appweb confluence docker ffmpeg gitlist imagemagick jira LICENSE mysql openssh python saltstack spring unomi zabbix
aria2 contributors.md drupal flask glassfish influxdb jmeter liferay-portal nexus openssl rails samba struts2 uwsgi
base contributors.zh-cn.md dubbo flink goahead jackson joomla log4j nginx php README.md scrapy supervisor weblogic
bash couchdb ecshop ghostscript gogs java jupyter magento node phpmailer README.zh-cn.md shiro tests webmin
celery discuz elasticsearch git h2database jboss kibana mini_httpd ntopng phpmy** redis skywalking thinkphp wordpress
[root@localhost vulhub-master]# cd discuz/ #进入目录
[root@localhost discuz]# ls
wooyun-2010-080723 x3.4-arbitrary-file-deletion
[root@localhost discuz]# cd wooyun-2010-080723/
[root@localhost wooyun-2010-080723]# ls
1.png 2.png docker-compose.yml README.md
[root@localhost wooyun-2010-080723]# docker-compose up -d #启动docker
[root@localhost wooyun-2010-080723]# docker ps
[root@localhost wooyun-2010-080723]# systemctl stop firewalld.service
[root@localhost wooyun-2010-080723]# docker inspect c48f22a4b0e1 | grep IPAddress
"SecondaryIPAddresses": null,
"IPAddress": "",
"IPAddress": "172.18.0.3",
[root@localhost wooyun-2010-080723]# docker inspect 46c1236299a0 | grep IPAddress
"SecondaryIPAddresses": null,
"IPAddress": "",
"IPAddress": "172.18.0.2",
[root@localhost wooyun-2010-080723]# docker-compose down #关闭docker
[root@localhost wooyun-2010-080723]# service docker restart #关闭之后如需再启动必须重启docker
[root@localhost wooyun-2010-080723]# docker-compose up -d
[root@localhost wooyun-2010-080723]# cd /
[root@localhost /]# find / -name CVE-2017-12615
/cve/vulhub-master/tomcat/CVE-2017-12615
[root@localhost /]# cd /cve/vulhub-master/tomcat/CVE-2017-12615/
[root@localhost CVE-2017-12615]# ls
01.png docker-compose.yml Dockerfile README.md README.zh-cn.md
[root@localhost CVE-2017-12615]# docker-compose up -d
[root@localhost CVE-2017-12615]# docker exec -it b920951c2740 /bin/bash 进入docker的ssh,必须参照docker的ps查询的id
root@b920951c2740:/usr/local/tomcat# find ./ -name 1.jsp
./webapps/ROOT/1.jsp
root@b920951c2740:/usr/local/tomcat# cat ./webapps/ROOT/1.jsp
******************shell*************************
abcdefg
root@b920951c2740:/usr/local/tomcat# find ./ -name index.jsp
root@b920951c2740:/usr/local/tomcat/conf# apt update #docker内安装vim
root@b920951c2740:/usr/local/tomcat/conf# apt-get install -y vim