> 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/host-header/bypass-of-connection-state-validation.md).

# Umgehung der Validierung des Verbindungszustands

### Umgehung der Host-Validierung durch Angriff auf den Verbindungszustand

**Beschreibung der Schwachstelle**

Dieses Lab hat eine **SSRF-artige Schwachstelle basierend auf Routing über den Host** Header, verbunden mit einer mangelhaften Zustandsverwaltung der serverseitigen Verbindung.

Obwohl der Front-End-Server den `Host` Header scheinbar korrekt validiert, geht er von einer gefährlichen \*\*Annahme\*\* aus:

> Alle auf derselben TCP-Verbindung gesendeten Anfragen werden als vertrauenswürdig angesehen, wenn die **erste Anfrage** gültig ist.

Dadurch kann eine spätere schädliche Anfrage in dieselbe Verbindung eingeschleust werden, wodurch die anfängliche Validierung umgangen wird.

**Lernziel**

* Greife auf das interne Verwaltungs-Panel zu:/ `HTTP://192.168.0.1/admin`
* Benutzer löschen **carlos**

**Erste Beobachtung**

Eine direkte Anfrage an die interne IP wird blockiert:

```http
GET / HTTP/1.1
Host: 192.168.0.1
```

Der Server lehnt diese Anfrage ab, was bestätigt, dass eine `Host` Validierung vorhanden ist **beim ersten Request**.

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

**Vorgehensweise: Angriff auf den Verbindungszustand**

Die Idee besteht darin, \*\*mehrere Anfragen über dieselbe TCP-Verbindung\*\* zu senden:

1. Eine legitime erste Anfrage an den öffentlichen Host (akzeptiert).
2. Eine zweite schädliche Anfrage an die interne IP, gesendet **über dieselbe Verbindung**.

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

In Burp Suite geschieht dies durch:

* Anfragen gruppieren
* Verwenden von **Gruppe in einer einzelnen Verbindung senden**

<figure><img src="/files/1492254925fb77b56561069c90678c89bd984f48" alt=""><figcaption></figcaption></figure>

**Zugriff auf das Verwaltungs-Panel**

Sobald die Verbindung mit einer gültigen Anfrage hergestellt ist, wird die folgende Anfrage an die interne Verwaltung akzeptiert:

```http
GET /admin HTTP/1.1
Host: 192.168.0.1
```

Das interne Verwaltungs-Panel wird dann zugänglich.

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

**Löschen des Benutzers**

Das Entfernen des Benutzers erfordert eine POST-Anfrage:

```http
POST /admin/delete HTTP/1.1
Host: 192.168.0.1

csrf=ppBVKn8wVrgZifEETHsn48Hykwiq8yFO&username=carlos
```

Serverantwort:

<figure><img src="/files/92e7b2a06b343256d67965e5c332c5320181ae97" alt="" width="446"><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/host-header/bypass-of-connection-state-validation.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.
