> 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

Notizen zur URL-Normalisierung für die Labs der PortSwigger Web Security Academy, einschließlich Ausnutzungsablauf, Payload-Tests, Burp-Suite-Validierung und Behebungskontext.

### URL-Normalisierung

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

Ziel ist es, eine Payload einzuschleusen, die ausgeführt wird `alert(1)` im Browser des Opfers und ihm dann die bösartige URL bereitzustellen.

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-924dc3b440ac56cd48934f83f912310005d50560%2F%7B52591DD1-9E12-45A2-812C-3E47D549F1AB%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

#### 1) Identifizierung des Injektionspunkts

Wenn Sie eine nicht existierende Seite aufrufen (z. B. `/test`), gibt die Site eine **Fehlerseite** zur Verwendung des angeforderten Pfads 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="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-42e0199c3c5daab9da221f946c67f82e554a1326%2F%7BACB59D9B-3776-4314-A88D-599A8DC970A4%7D.png?alt=media" 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="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-f1c4f08d1dd4ac265a27d642342ef2312b5e1d7f%2F%7B3A9DB60A-3A74-4826-80B7-FB0F49F6D1A2%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

#### 3) Ausführung über Cache-Standardisierung

Um diesen Schutz zu umgehen, wird die **Caches** verwendet:

* Die bösartige Anfrage wird über **Burp Suite**, ohne die Adressleiste des Browsers zu durchlaufen.
* Der Cache **normalisiert** die URL und speichert die zugehörige Antwort.
* Die zwischengespeicherte Antwort enthält dann die Nutzlast **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)` wird im Browser des Opfers ausgeführt.

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-08eb81aca79a89302f4550dbba0975de9ce5b2d8%2F%7B2A6C09FF-C1B0-4EAB-A5E8-A248B6FB611F%7D.png?alt=media" 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 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/de/web/cache-poisoning/url-normalization.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.
