> 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/cache-poisoning/url-normalization.md).

# Normalisation des URL

### Normalisation des URL

Ce laboratoire contient une **XSS** vulnérabilité qui n’est pas directement exploitable, car le navigateur applique automatiquement une **d’URL** encodage. / Par conséquent, le **processus de normalisation des URL du cache** doit être utilisé pour exploiter cette faille.

L’objectif est d’injecter une charge utile qui s’exécute `alert(1)` dans le navigateur de la victime, puis de lui fournir l’URL malveillante.

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

#### 1) Identification du point d’injection

Lorsque vous accédez à une page inexistante (par ex. `/test`), le site renvoie une **page d’erreur** qui réutilise le chemin demandé dans la réponse HTML.

Si une balise HTML est fermée et qu’un script est injecté, il est interprété comme :

```javascript
/test</p><script>alert(1)</script>
```

<figure><img src="/files/8183db01d37f639d7435b85f4561bdac2ca43bec" alt=""><figcaption></figcaption></figure>

#### 2) Problème rencontré

Si cette URL est saisie directement dans le navigateur, la charge utile **n’est pas exécutée**. / La raison est que le navigateur **encode automatiquement** les caractères spéciaux (`<`, `>`, `/`, etc.), ce qui empêche l’exécution du script.

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

#### 3) Fonctionnement via la standardisation du cache

Pour contourner cette protection, le **cache** est utilisé :

* La requête malveillante est envoyée via **Burp Suite**, sans passer par la barre d’adresse du navigateur.
* Le cache **normalise** l’URL et stocke la réponse associée.
* La réponse mise en cache contient alors la charge utile **non encodée**.

#### (4) Déclenchement du XSS

Une fois la réponse empoisonnée dans le cache :

* L’URL est fournie à la victime.
* Le cache renvoie la version standard de la page.
* Le script est interprété et `alert(1)` s’exécute dans le navigateur de la victime.

<figure><img src="/files/bae37ffda67dfff3a2a051417956c4ca4c3b80f8" alt="" width="507"><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/fr/web/cache-poisoning/url-normalization.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.
