# NFS

> NFS file share protocol. Attackers enumerate exports, mount shares, abuse UID trust and no_root_squash to access files, plant SUID binaries, escalate privileges, and exfiltrate data

- **URL:** https://hackindex.io/services/nfs
- **Type:** Service
- **Default ports:** 2049
- **Tags:** nfs, linux, network, file-sharing, enumeration, privilege-escalation
- **Published:** 2025-12-31
- **Updated:** 2026-07-13

NFS (Network File System) runs on **TCP port 2049** and provides remote file access over a network. Nmap identifies it as `nfs`. NFS relies on the portmapper/rpcbind service (TCP/UDP 111) to register and locate its services. It is common on Linux servers and network-attached storage devices.

NFS exports that allow access to `*` (everyone) or specific subnets without proper restrictions are a frequent finding. Mounting an open export gives direct access to files, which may include home directories, configuration files, SSH keys, and application data. NFS v2 and v3 use host-based authentication only, with no user-level password checks, so UID/GID spoofing can bypass permissions.

List available exports with `showmount -e target` or Nmap's `nfs-showmount` script. Mount accessible shares and review their contents. Check file permissions and look for `no_root_squash` configurations that allow root-level access from the client side.

## Phases

- [Enumeration](https://hackindex.io/services/nfs/enumeration.md): NFS export discovery, content listing, and share mounting guides (3 guides)
- [Vulnerability Discovery](https://hackindex.io/services/nfs/vulnerability-discovery.md): Find open NFS exports, weak configs, and no_root_squash misconfigs (2 guides)
- [Exploitation](https://hackindex.io/services/nfs/exploitation.md): Mount NFS shares and exploit UID trust to access files and credentials (2 guides)
- [Privilege Escalation](https://hackindex.io/services/nfs/privilege-escalation.md): Abuse NFS no_root_squash to plant SUID binaries or SSH keys (1 guides)
