> 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/web-cache-deception/cheating-the-cache-with-delimiters-in-the-path.md).

# Den Cache mit Trennzeichen im Pfad austricksen

### Ausnutzen von Pfadtrennzeichen für Web Cache Deception

#### Kontext

**Labor:** Pfadgrenzen für Web Cache Deception ausnutzen / **Ziel:** den \*\*API-Schlüssel\*\* vom Benutzer wiederherstellen **carlos**. / **Zugriff gewährt:** mögliche Verbindung mit `wiener:peter`. / **Hilfe:** eine Liste möglicher Trennzeichen wird vom Labor bereitgestellt.

<figure><img src="/files/4f94f64b6e5ee67fad23abc2aef59de3e09eed2b" alt=""><figcaption></figcaption></figure>

#### Erste Beobachtung

* Auf der **Mein Konto** Seite sehen wir ein Schild, auf dem unser eigener API-Schlüssel\*\* deutlich angezeigt wird.
* Im Hintergrund löst der normale Zugriff eine Anfrage aus:

```bash
GET /my-account HTTP/2
```

In diesem Fall, **die Antwort wird nicht aus dem Cache ausgeliefert** (kein sichtbares/interpretierbares Cache-Verhalten).

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

#### Test der Trennzeichen

* Durch Hinzufügen eines \*\*Semikolons\*\* `;` im Pfad interpretiert die \*\*Anwendung die Route weiterhin\*\* zu `my-account`, aber diesmal **mit Cache-Verhalten**.

Verwenden von **Intruder**, prüfen wir mehrere Trennzeichen, und wir stellen fest, dass **das Semikolon funktioniert**.

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

Beispiel eines gültigen Pfads:

* `/my-account;test.js`

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

#### Ausnutzung

Zweck: Sicherstellen, dass das Opfer eine präparierte URL besucht, um die **/my-account** Antwort \*\*zwischengespeichert\*\* und sie dann mit einer anderen Variante erneut abzurufen, um die **carlos** Daten.

Vom**Exploit-Server**, wird das Opfer weitergeleitet an:

```javascript
<script>
    document.location="https://0a5e005c048218fb80a3f0ec00c2000d.web-security-academy.net/my-account/my-account;test.js";
</script>
```

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

#### Wiederherstellung des API-Schlüssels

* Dann ändern wir die URL und rufen auf:
* `/my-account;jordan.js`

Diese Antwort enthält dann **den API-Schlüssel von Carlos**.

<figure><img src="/files/79020ea7509e90e74aa5e9b0968e28de5955b92d" 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 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/web-cache-deception/cheating-the-cache-with-delimiters-in-the-path.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.
