> 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/cache-poisoning/parameter-cloaking.md).

# パラメータ・クロークィング

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

### パラメータ・クローキング

このラボは〜に対して脆弱です **Webキャッシュポイズニング** 特定のパラメータがキャッシュキーから除外されるためです。/ さらに、 **パラメータの解釈に不整合があり** キャッシュシステムとバックエンドの間で不整合があるためです。/ ユーザーが定期的にサイトのホームページを **Google Chrome**.

目的:/ 以下を使ってキャッシュを汚染する **パラメータ・クローキング** 技法を用いて実行する `alert(1)` 被害者のブラウザ上で。

**初期観察**

次のCookieがリクエストに含まれています:

```bash
Cookie: country=[object Object]
```

サーバーのレスポンスでは、 **geolocate** スクリプトが読み込まれます。/ このスクリプトはCookieの値を使って、クライアント側でユーザーの国を定義します。

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-e1abcf98c21c78b0db6da65b5d331867956b1c9f%2F%7BD9BBC0AD-F7D9-4429-9D29-5FF0E36D48E1%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

**脆弱なパラメータの特定**

を使用する **Param Miner（クエリパラメータの推測）**、次の挙動を検出します **パラメータ・クローキング**.

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-347c3908251db87efa566857c5c8269869f4480e%2F%7B59183D27-91D4-4A67-B37F-9A29856BD6AA%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

見つかったパラメータは次のとおりです:

```bash
utm_content
```

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-64ba404c5225bc25fb0ca8abfa49ff4e0aa71d15%2F%7B7A4C69CA-3BE9-4DCA-8BB2-47C9992BAB3D%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

次のURLにアクセスすると:

```bash
/?utm_content=z9qc51
```

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-f2e5161348525f75826286872f15b4470928ee42%2F%7BF8FDA3E8-345E-4BA2-8936-875627D058CE%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

次のことが分かります:

* パラメータ値を自由に変更できる
* キャッシュは\*\*無効化されない\*\*
* 次のユーザーでも同じ回答になります

これは、 `utm_content` です **キャッシュキーから除外されていることを確認します**.

**geolocateスクリプトによる動作**

ページによって読み込まれるスクリプトは次のとおりです:

```bash
/js/geolocate.js?callback=setCountryCookie
```

キャッシュで無視されるパラメータを追加すると:

```bash
/js/geolocate.js?callback=setCountryCookie=test?utm_content=z9111
```

次の挙動が観察されます:

* その `テスト` 値がレスポンスに反映される
* キャッシュは変更されない

これは、バックエンドがキャッシュとは異なる方法でパラメータを解釈していることを示します。

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-c0ec82e9e23a5b37b4f9ac1befae385a6bb0744d%2F%7B8770FD66-DE7B-489B-918D-FD164C725FD0%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

**パラメータ・クローキングによるインジェクション**

この解析の違いは、 **2つ目のパラメータ callback を注入することで悪用されます** によって隠された `utm_content`:

```bash
/js/geolocate.js?callback=setCountryCookie&utm_content=z9111;callback=alert(1)
```

結果:

* キャッシュは常にリクエストが同一だとみなす

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-5612d5cf630ed4e6030329f482fe43b49eeac2c2%2F%7BE0C7D0B7-48EF-4AA5-89D4-C313340F619F%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

バックエンドは `callback=alert(1)` を有効な新しいパラメータとして解釈する

生成されたJavaScriptが実行される `alert(1)`

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-01d00681eb96e35ffd716faefd245f13023de4a3%2F%7B8AB5CB75-F0E8-4DD7-B637-93BC769301E4%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/cache-poisoning/parameter-cloaking.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.
