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

# SQL Injection Login Bypass

SQL Injection Login Bypass notes for PortSwigger Web Security Academy labs, including exploitation workflow, payload testing, Burp Suite validation, and remediation context.

### SQL Injection Vulnerability Allowing Login Bypass

* **Context / Vulnerability:** Vulnerable connection function to SQL injection. Typical server-side query:/ `SELECT * FROM users WHERE username = 'administrator'--' AND password = ''`
* **Lab objective:** Login as a `administrator` user without knowing the password.
* **Vulnerable parameter:** `username` field (or `password` according to implementation).
* **Concept proof (payload provided):**

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

* Short interpretation: injects a still true condition (`1=1`) that neutralizes password verification, resulting in authentication as the first returned record (often `administrator`).
* **Example of usage:** send `username` = `' or 1=1-- -` (and leave/put any password) → the WHERE clause becomes true for all lines and the session is opened as a user (often administrator).
* **Expected result:** Successful login as an administrator without valid password.
* **Impact:** total compromise of a privilege account, escalation of access, exposure/ alteration of sensitive data and application control.


---

# 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/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.
