> 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/sql-injection.md).

# SQL 注入

SQL 注入、UNION 攻击、盲注、基于错误的 SQL 注入、基于时间的 SQL 注入、OOB 数据外传和 DBMS 枚举。

用于 PortSwigger Web Security Academy 实验的 SQL 注入笔记，重点关注实用测试步骤、Burp Suite 验证、payload 行为和利用流程。

## 测试流程

1. 识别存在漏洞的功能，以及相关的请求、参数、请求头、Cookie 或浏览器端 sink。
2. 在进一步发起攻击之前，先在 Burp Suite 中使用最小有效载荷复现该行为。
3. 使用清晰的概念验证来验证影响，例如账户访问、数据泄露、代码执行、SSRF 或状态变更。
4. 在记录利用路径时，保持有效载荷、URL、令牌和实验室凭据不变。

## 实验

<table><thead><tr><th data-type="content-ref"></th></tr></thead><tbody><tr><td><a href="/zh/web/sql-injection/blind-sql-injection-with-conditional-errors.md">基于条件错误的盲 SQL 注入</a></td></tr><tr><td><a href="/zh/web/sql-injection/blind-sql-injection-with-conditional-responses.md">基于条件响应的盲 SQL 注入</a></td></tr><tr><td><a href="/zh/web/sql-injection/blind-sql-injection-with-oob-interaction.md">带带外交互的盲 SQL 注入</a></td></tr><tr><td><a href="/zh/web/sql-injection/identifying-dbms-version-mysql-mssql-postgresql.md">DBMS 版本检测（MySQL、MSSQL、PostgreSQL）</a></td></tr><tr><td><a href="/zh/web/sql-injection/error-based-sql-injection.md">基于错误的 SQL 注入</a></td></tr><tr><td><a href="/zh/web/sql-injection/non-oracle-database-enumeration.md">非 Oracle 数据库枚举</a></td></tr><tr><td><a href="/zh/web/sql-injection/database-enumeration-on-oracle.md">Oracle 数据库枚举</a></td></tr><tr><td><a href="/zh/web/sql-injection/oracle-dbms-version-detection.md">Oracle DBMS 版本检测</a></td></tr><tr><td><a href="/zh/web/sql-injection/sql-injection-data-exfiltration-via-oob-channel.md">通过 OOB 字符串进行 SQL 注入数据外传</a></td></tr><tr><td><a href="/zh/web/sql-injection/sql-injection-filter-bypass-via-xml-encoding.md">通过 XML 编码绕过 SQL 注入过滤器</a></td></tr><tr><td><a href="/zh/web/sql-injection/sql-injection-in-where-clause.md">WHERE 子句中的 SQL 注入</a></td></tr><tr><td><a href="/zh/web/sql-injection/sql-injection-login-bypass.md">SQL 注入登录绕过</a></td></tr><tr><td><a href="/zh/web/sql-injection/time-based-blind-sql-injection.md">基于时间的盲 SQL 注入</a></td></tr><tr><td><a href="/zh/web/sql-injection/blind-sql-injection-with-time-delay-and-exfiltration.md">基于时间的盲 SQL 注入数据外传</a></td></tr><tr><td><a href="/zh/web/sql-injection/union-attack-determining-number-of-columns.md">UNION 攻击列数检测</a></td></tr><tr><td><a href="/zh/web/sql-injection/union-attack-retrieving-data-from-other-tables.md">通过 UNION 攻击从其他表提取数据</a></td></tr><tr><td><a href="/zh/web/sql-injection/union-attack-to-extract-multiple-values-in-one-column.md">通过 UNION 攻击在一列中提取多个值</a></td></tr><tr><td><a href="/zh/web/sql-injection/union-attack-to-find-a-text-compatible-column.md">通过 UNION 攻击寻找兼容文本的列</a></td></tr></tbody></table>


---

# 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/zh/web/sql-injection.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.
