> ## Documentation Index
> Fetch the complete documentation index at: https://www.0101isnothacking.nl/llms.txt
> Use this file to discover all available pages before exploring further.

# NFS enumeration

> Active enumeration commands and dangerous settings for the Network File System protocol.

NFS (Network File System) typically runs on ports 111 and 2049.

## Check default open ports

```bash theme={null}
nmap -p111,2049 $ip
```

## Banner grabbing

```bash theme={null}
nmap -sVC -A -p111,2049 $ip
netcat -nv $ip 111/2049
netexec nfs $ip
nmap -p111,2049 $ip --script nfs*
```

## List shares

```bash theme={null}
netexec nfs $ip --shares
showmount -e $ip
```

```text theme={null}
msf auxiliary/scanner/nfs/nfsmount
```

## Create a local mount point

```bash theme={null}
mkdir shared
```

## Mount shares

Mount all shares into the current directory:

```bash theme={null}
sudo mount -t nfs $ip:/ . -o nolock
```

Mount a specific share:

```bash theme={null}
sudo mount -t nfs $ip:/ /mnt/shareablefolder -o nolock
```

## Check UID/GID

```bash theme={null}
ls -lahn
```

## Replica of the shares

```bash theme={null}
sudo cp -r /folder .
```

## Unmount the shares

```bash theme={null}
sudo umount /mnt/shareablefolder
```

## Dangerous settings

| Setting | Description |
| - | - |
| `rw` | Read and write permissions. |
| `insecure` | Ports above 1024 will be used. |
| `nohide` | If another file system was mounted below an exported directory, this directory is exported by its own exports entry. |
| `no_root_squash` | All files created by root are kept with the UID/GID 0. |

## Useful commands

List the contents of the current folder recursively:

```bash theme={null}
tree
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.