> 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/authentication/username-enumeration-via-account-lock.md).

# Username Enumeration via Account Lockout

Username Enumeration via Account Lockout notes for PortSwigger Web Security Academy labs, including exploitation workflow, payload testing, Burp Suite validation, and remediation context.

### Username Enumeration via Account Lock

The application sets up an account lock after several failed attempts, but the logic is imperfect. It can be used to:

1. Find a valid user name.
2. Force your password brutally.
3. Go to his account page.

The lists provided are:

* The **locking of the account** occurs \*\* only if the username is valid\*\*.
* For non-existent users, even after several attempts, the behavior remains different (no real lock, same message/response).
* One can therefore distinguish an existing user from a non-existing user only by observing the answers.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-4488912695921502b1626a6ca9fa2cdcedab8fc9%2F%7B990C1E33-5174-47C2-A076-89DB667CAD9C%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

#### 1. Detection of a Valid Username

1. Send login requests in **Intruder Mode** with the **Cluster Bomb** technique:

* A set of candidates for the username field.
* A set of passwords to cause several failures.

2. Configure a \*\* correspondence rule (regex)\*\* to filter the answers that contain the message:

* `Invalid username or password.`

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-3e97305bc93da5a693364b53788001c7f8381f82%2F%7B51BE5C26-72E2-49CE-B656-0A5E055B0999%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

* Analyse results:
* **Invalid** accounts maintain consistent behaviour.
* For a valid \*\* account\*\*, after a number of failed tests, the response changes (locking).

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-4551c97ca1337e410d484590a9baf8ad859cd78d%2F%7B5623C231-62EC-451F-A3C0-D01CED6E3857%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

1. Looking at the answers, we notice that the user name **`akamai`** differs from the others and reveals this behavior related to account locking. / → \*\*`akamai` is identified as a valid user name. \*\*

#### 2. Gross Strength of Valid Account Password

1. Once `akamai` has been identified as a valid user, Intruder is restarted in **mode Sniper**:

* The username field remains attached to `akamai`.
* Only the **password** is used with the wordlist provided ( Authentication lab passwords ).

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-7ee48f3d67ff83b1c239afe2b336017cdac80cf1%2F%7B61A289C6-CD3D-4AA5-9EDF-5811F764EF0E%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

1. The responses are reviewed again, including:

* The \*\* HTTP status code\*\*.
* The body size of the answer.
* Absence or modification of error message.

2. When testing the **`chelsea`** password, the answer is different (e.g. \*\* HTTP code different\*\* from other attempts). / → It is deduced that the torque **`akamai` / `chelsea`** is correct.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-cc02873fb961a6cd8baf85ef86e5a5db5ea8333d%2F%7B49B33C8D-8AAB-4470-8A77-2C2A510ED0E5%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/web/authentication/username-enumeration-via-account-lock.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.
