> 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/host-header/routing-based-ssrf.md).

# ルーティングベースのSSRF

ルーティングベースのSSRFの PortSwigger Web Security Academy ラボ向けノート。攻撃フロー、ペイロードテスト、Burp Suite による検証、および是正策の文脈を含みます。

### ルーティングベースのSSRF

**ラボの説明**

このラボには **ルーティングに基づくSSRF型脆弱性**、〜を介して悪用可能 **Hostヘッダー**. / アプリケーションは次の値に依存しています: `Host` リクエストの送信先を決定するためにこのフィールドを使用しており、外部公開されていない内部リソースへのアクセスを許してしまいます。

目的：

* のIPアドレス上でホストされている内部管理パネルにアクセスする `192.168.0.0/24` ネットワーク
* ユーザーを削除 **carlos**

**初期観察**

その `/admin` アクセスポイントは外部からはアクセスできません。 / しかし、アプリケーションは次の値に従ってリクエストを中継します: `Host` このフィールドにより、リクエストを内部アドレスへリダイレクトできます。

**ステップ1 – 内部ネットワークのスキャン**

次のクエリが送信されます: **Intruder** 内部IPアドレスをテストするために:

```http
GET /admin HTTP/2
Host: 192.168.0.X
```

⚠️ 重要：

* オプションを無効化する **Hostヘッダーを更新** をBurpで設定しないと、攻撃は失敗します。

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-4bbe18c79106f9d515f0a2449f1d70a31e3e7584%2F%7B2B09BA49-05DD-4E1C-A851-5A650EFDF3C3%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

結果：

* その `192.168.0.221` アドレスが応答を返します **HTTP 200**。これは内部管理パネルの存在を示しています。

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-6b9ae2d6e0db7b026def6bd704bb7d14f192acc6%2F%7B350C3618-8038-4523-9B3E-5E9CD07C20CE%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

**ステップ2 – 管理パネルへのアクセス**

有効なIPが特定できたら、管理パネルを直接狙います：

```http
GET /admin/delete?username=carlos HTTP/2
Host: 192.168.0.221
```

内部管理インターフェースにアクセス可能になります。

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-05b594de5921e46ead6a5a00f2cdb7b738cd5f0f%2F%7BDF27F02D-DD3C-43FF-BEAC-DF0A39126856%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

**ステップ3 – carlosユーザーの削除**

削除には **POST** 有効なCSRFトークンを含むリクエストが必要です：

```http
POST /admin/delete HTTP/2
Host: 192.168.0.221

csrf=iWyb78rJxAsoblmARVtqSef6YOsKG0Ph&username=carlos
```

結果：

* サーバーは次で応答します： **302 Found**、ユーザーが **carlos** 削除されたことを確認しています。

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-71a6b466225f79c20ef7beb2490ac25425933000%2F%7B70F278BE-BBF2-4ABA-BF76-EB73C0EFB5B2%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/ja/web/host-header/routing-based-ssrf.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.
