# NFS

## Enumeration

{% tabs %}
{% tab title="Configuration" %}

```bash
cat /etc/exports
```

{% endtab %}

{% tab title="Options" %}

```bash
rw # Read and write permissions.
ro # Read only permissions.
sync # Synchronous data transfer. (A bit slower)
async # Asynchronous data transfer. (A bit faster)
secure # Ports above 1024 will not be used.
insecure # Ports above 1024 will be used.
no_subtree_check # This option disables the checking of subdirectory trees.
root_squash # Assigns all permissions to files of root UID/GID 0 to the UID/GID of anonymous, which prevents root from accessing files on an NFS mount.
nohide # If another file system was mounted below an exported directory, this directory is exported by its own exports entry.
```

{% endtab %}

{% tab title="List NFS Shares" %}

```bash
showmount -e 10.10.10.10
```

{% endtab %}

{% tab title="Mount a share" %}

```bash
mkdir /mnt/nfs
mount -t nfs 10.10.10.10:/ /mnt/nfs/ -o nolock
cd /mnt/nfs
tree .
```

{% endtab %}

{% tab title="List UID / GUID" %}

```bash
ls -n mnt/nfs/
```

{% endtab %}

{% tab title="Unmount a share" %}

```bash
umount /mnt/nfs
```

{% endtab %}
{% endtabs %}
