> 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

Notizen zur Umgehung der Validierung des Verbindungszustands für die Labs der PortSwigger Web Security Academy, einschließlich Ausnutzungsablauf, Payload-Tests, Burp-Suite-Validierung und Behebungskontext.

### Umgehung der Host-Validierung durch einen Angriff auf den Verbindungsstatus

**Beschreibung der Schwachstelle**

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

Obwohl der Front-Server den `Host` -Header anscheinend korrekt validiert, macht er eine gefährliche \*\*Annahme\*\*:

> Alle Anfragen, die über dieselbe TCP-Verbindung gesendet werden, gelten als vertrauenswürdig, wenn die **erste Anfrage** gültig ist.

Dadurch kann eine spätere bösartige Anfrage über dieselbe Verbindung eingeschleust werden und die anfängliche Validierung umgangen werden.

**Lernziel**

* Zugriff auf das interne Administrationspanel:/ `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 **bei der ersten Anfrage**.

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-716cd678495ba9f257aeef4663599d1781bb752d%2F%7B66EAD875-C290-48AB-86B2-6054CF9ECE86%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

**Vorgehen: Angriff auf den Verbindungsstatus**

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

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

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-c156f1764638d2ba4d002f1dd9ec42c8cc7b1aed%2F%7B7C1D0937-5E3E-4E83-8F29-42F59338EF12%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

In Burp Suite geschieht dies durch:

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

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-00d3a64b47a7ce1463445cb3ee7908241bb2af19%2F%7BE961F29C-9FAA-4C08-A8CE-75A3D270193E%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

**Zugriff auf das Administrationspanel**

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

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

Das interne Administrationspanel wird dann zugänglich.

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-62e690af215289aa04969d98c4420d8f1d2616fa%2F%7BC76FC4FB-52F9-4BFD-B3F9-CE9040DB5411%7D.png?alt=media" 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="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-586b97aeff5349a4a728d8a02e94a919b03e31eb%2F%7B2A1D959A-10BF-4B0A-A3FF-6907C0A91CD6%7D.png?alt=media" 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/de/web/host-header/bypass-of-connection-state-validation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
