(111,2049 for NFSv4.1)NFS

Network File System, same purpose as SMB and USED ONLY BETWEEN UNIX-LIKE OS.

About

  • Its purpose is to access file systems over a network as if they were local. Kind of forking a copy on your device without actually saving

  • It's really like SMB but a whole other protocol so there's no direct communication between NFS clients and SMB servers.

  • Newer NFS versions work only on TCP/UDP port 2049 which simplifies the use of the protocol across firewalls.

From NFSv3, the protocol integrated client authentication. And from NFSv4, it included Kerberos, works with firewalls..etc and now the NFSv4.1 aims to support and facilitate the cluster server deployment and only on port TCP/UDP 2049.

Also, NFS is based on ONC-RPC/SUN-RPC protocol which uses TCP/UDP port 111: This is the port for the RPC portmapper (also known as rpcbind), which maps RPC program numbers to network port numbers. NFS uses RPC, so the portmapper is essential for the initial communication.

NFS also uses dynamic ports assigned by the portmapper for various RPC services such as:

  • mountd: The mount daemon, which assists with mounting NFS file systems.

  • nlockmgr: The network lock manager, which manages file locking.

  • statd: The status monitor daemon, which handles crash recovery.

  • rquotad: The remote quota server daemon, which provides disk quota management.

That's why the nmap output when probing an NFS server lists a long list of RPC services.

Config

triangle-exclamation

Enumeration

Nmap

We can see how NFS is entangled to RPC through a simple nmap scan:

Mounting/Unmounting and interacting with NFS

The nolock option in NFS mount commands is used to disable file locking. This option is particularly useful in scenarios where the NFS server does not support the Network Lock Manager (NLM) protocol or when interfacing with older versions of operating systems like Red Hat Enterprise Linux, Red Hat Linux, or Solaris, as these systems may not be compatible with the most recent ACL technology.

When using the nolock option, applications can still lock files, but such locks only provide exclusion against other applications running on the same client. Remote applications are not affected by these locks. This can be a workaround for issues where the NFS server does not have rpc.statd running, which is required for remote locking.

Last updated