> For the complete documentation index, see [llms.txt](https://alham-rizvi.gitbook.io/alhamrizvi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alham-rizvi.gitbook.io/alhamrizvi/picoctf-writeups/picoctf/web-exploitation/web-gauntlet-3.md).

# web-gauntlet-3

Log in as the **admin** user to retrieve the flag. However, there are two major obstacles:

* **A Blacklist:** Words like `admin`, `or`, `and`, `=`, and `true` are forbidden.
* **Character Limit:** Your total input cannot exceed **25 characters**.

The login page uses a **SQLite** database. When you enter data, the server reflects the query it is trying to run.

> **Reflected Query:** `SELECT username, password FROM users WHERE username="..." AND password="..."`

#### **3. The Bypass Strategy**

**Step A: Bypassing the "admin" Filter**

Since we cannot type `admin`, we use **String Concatenation**. In SQLite, the `||` operator joins two strings together.

* **Payload:** `'ad'||'min'`
* **Result:** The database combines them into `admin`, but the security filter only sees `ad` and `min`, so it lets it pass.

**Step B: Bypassing the "=" Filter**

We need to make the password check "True" without using the `=` sign. We use the **`GLOB`** operator with a wildcard.

* **Payload:** `GLOB '*'`
* **Result:** `GLOB` matches patterns. The asterisk (`*`) matches **anything**. This makes the password check always true because any password stored in the database will match "anything".

#### **4. Final Execution**

To stay under the 25-character limit, enter these into the login fields:

* **Username:** `ad'||'min`
* **Password:** `'GLOB'*`

#### **5. Capturing the Flag**

Once you are logged in as admin, the challenge description states the flag will be located at:

> `http://wily-courier.picoctf.net:59492/filter.php`


---

# 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://alham-rizvi.gitbook.io/alhamrizvi/picoctf-writeups/picoctf/web-exploitation/web-gauntlet-3.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.
