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

# URL-Normalisierung

### URL-Normalisierung

Dieses Labor enthält eine **XSS** Schwachstelle, die nicht direkt ausnutzbar ist, da der Browser eine automatische **dURL** Kodierung. / Daher muss die **Cache-URL-Normalisierungsprozess** verwendet werden, um diesen Fehler auszunutzen.

Das Ziel ist es, eine Payload einzuschleusen, die `alert(1)` im Browser des Opfers ausgeführt wird und ihm dann die schädliche URL bereitzustellen.

<figure><img src="/files/3640e9cd23818c17b4a62796bfcaee790cd429f4" alt=""><figcaption></figcaption></figure>

#### 1) Identifizierung des Injektionspunkts

Wenn Sie eine nicht existierende Seite aufrufen (z. B. `/test`), gibt die Website eine **Fehlerseite** zurück, die den angeforderten Pfad in der HTML-Antwort wiederverwendet.

Wenn ein HTML-Tag geschlossen und ein Skript eingeschleust wird, wird es interpretiert als:

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

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

#### 2) Aufgetretenes Problem

Wenn diese URL direkt im Browser eingegeben wird, wird die Nutzlast **n wird nicht ausgeführt**. / Der Grund ist, dass der Browser **automatisch kodiert** Sonderzeichen (`<`, `>`, `/`, usw.), was die Skriptausführung verhindert.

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

#### 3) Betrieb über Cache-Standardisierung

Um diese Schutzmaßnahme zu umgehen, wird die **Cache** verwendet:

* Die schädliche Anfrage wird über **Burp Suite**gesendet, ohne über die Adressleiste des Browsers zu gehen.
* Der Cache **normalisiert** die URL und speichert die zugehörige Antwort.
* Die zwischengespeicherte Antwort enthält dann die Payload **unkodiert**.

#### (4) Auslösen des XSS

Sobald die Antwort im Cache vergiftet ist:

* Die URL wird dem Opfer bereitgestellt.
* Der Cache gibt die standardisierte Version der Seite zurück.
* Das Skript wird interpretiert und `alert(1)` läuft im Browser des Opfers.

<figure><img src="/files/371210dbb26a4608767f988acf9ff14c004254a4" 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/de/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.
