> 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-login-bypass.md).

# SQLインジェクションによるログインバイパス

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

### ログインバイパスを可能にするSQLインジェクション脆弱性

* **背景 / 脆弱性:** SQLインジェクションに脆弱な接続関数。典型的なサーバー側クエリ:/ `SELECT * FROM users WHERE username = 'administrator'--' AND password = ''`
* **ラボの目的:** 〜としてログイン `administrator` パスワードを知らずにユーザーとして。
* **脆弱なパラメータ：** `username` フィールド（または `パスワード` 実装によっては）。
* **概念実証（提供されたペイロード）：**

```sql
' or 1=1-- -
```

* 簡単な解釈: 常に真となる条件（`1=1`）を挿入してパスワード検証を無効化し、その結果、最初に返されたレコードとして認証される（多くの場合 `administrator`).
* **使用例:** 送信 `username` = `' or 1=1-- -` （任意のパスワードを入力/そのままにして）→ WHERE句が全行で真となり、セッションがユーザー（多くの場合は管理者）として開かれる。
* **期待される結果：** 有効なパスワードなしで管理者としてのログインに成功。
* **影響：** 特権アカウントの完全な侵害、アクセス権限の昇格、機密データの漏えい/改ざん、およびアプリケーション制御。


---

# 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-login-bypass.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.
