Associated Vulnerability
Title:Apache Solr 代码问题漏洞 (CVE-2017-12629)Description:Remote code execution occurs in Apache Solr before 7.1 with Apache Lucene before 7.1 by exploiting XXE in conjunction with use of a Config API add-listener command to reach the RunExecutableListener class. Elasticsearch, although it uses Lucene, is NOT vulnerable to this. Note that the XML external entity expansion vulnerability occurs in the XML Query Parser which is available, by default, for any query request with parameters deftype=xmlparser and can be exploited to upload malicious data to the /upload request handler or as Blind XXE using ftp wrapper in order to read arbitrary local files from the Solr server. Note also that the second vulnerability relates to remote code execution using the RunExecutableListener available on all affected versions of Solr.
Description
Remote code execution occurs in Apache Solr before 7.1 with Apache Lucene before 7.1 by exploiting XXE in conjunction with use of a Config API add-listener command to reach the RunExecutableListener class.
Readme
# README
Remote code execution occurs in Apache Solr before 7.1 with Apache Lucene before 7.1 by exploiting XXE in conjunction with use of a Config API add-listener command to reach the RunExecutableListener class. Elasticsearch, although it uses Lucene, is NOT vulnerable to this. Note that the XML external entity expansion vulnerability occurs in the XML Query Parser which is available, by default, for any query request with parameters deftype=xmlparser and can be exploited to upload malicious data to the /upload request handler or as Blind XXE using ftp wrapper in order to read arbitrary local files from the Solr server. Note also that the second vulnerability relates to remote code execution using the RunExecutableListener available on all affected versions of Solr.
# Usage
Command output needs to be exfiltrated OOB. This POC includes support for Hex and Base32 formats, which are both case-insensitive.
```
usage: rce.py [-h] -ue URL_BASE_EXTERNAL -ui URL_BASE_INTERNAL [-b {curl,wget,ftp,ping,nc,ncat,nslookup,dig}] -e EXFIL
[-f {hex,base32}]
POC for CVE-2017-12629 (RCE via internal SSRF via XXE) by @realCaptainWoof
options:
-h, --help show this help message and exit
-ue, --url-base-external URL_BASE_EXTERNAL
External URL base of the vulnerable application; e.g, 'https://vulnerable.app/solr'
-ui, --url-base-internal URL_BASE_INTERNAL
Internal URL base of the vulnerable application; e.g, 'https://127.0.0.1:8983'; default:
'https://127.0.0.1:8983'
-b, --bin {curl,wget,ftp,ping,nc,ncat,nslookup,dig}
How to exfiltrate command output from target; default: 'curl'
-e, --exfil EXFIL Destination to exfil to. Make sure this corresponds to '--bin'; e.g, if '--bin' is 'curl', '--exfil' can
be 'http://EXFIL.myserver.com/EXFIL'. Must specify injection point via 'EXFIL' keyword.
-f, --exfil-format {hex,base32}
Format in which to exfil the command output; default: 'base32'
```
# References
- https://www.exploit-db.com/exploits/43009
File Snapshot
[4.0K] /data/pocs/2da884a411eddf70bfc1d18ee07edba1da73631a
├── [6.5K] rce.py
└── [2.1K] README.md
0 directories, 2 files
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 →