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

# 通过账户锁定进行用户名枚举

通过账户锁定进行用户名枚举，PortSwigger Web Security Academy 实验笔记，包括利用流程、载荷测试、Burp Suite 验证以及修复上下文。

### 通过账户锁定枚举用户名

应用程序在多次失败尝试后会设置账户锁定，但其逻辑并不完善。它可用于：

1. 找出有效用户名。
2. 暴力破解密码。
3. 进入其账户页面。

提供的列表如下：

* 该 **账户锁定** 仅在用户名有效时才会发生\*\*。
* 对于不存在的用户，即使多次尝试，行为也保持不同（没有真正锁定，消息/响应相同）。
* 因此，只需观察响应即可区分现有用户和不存在的用户。

<figure><img src="https://1574813340-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. 检测有效用户名

1. 以……方式发送登录请求 **Intruder 模式** 使用 **集束炸弹** 技术：

* 用户名字段的一组候选值。
* 一组用于造成多次失败的密码。

2. 配置一个\*\*匹配规则（正则表达式）\*\*，以筛选包含以下消息的响应：

* `用户名或密码无效。`

<figure><img src="https://1574813340-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>

* 分析结果：
* **无效** 账户保持一致的行为。
* 对于有效的\*\*账户\*\*，在多次失败测试后，响应会发生变化（锁定）。

<figure><img src="https://1574813340-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. 观察响应，我们注意到用户名 **`akamai`** 与其他项不同，并揭示了与账户锁定相关的这一行为。/ → \*\*`akamai` 被识别为有效用户名。\*\*

#### 2. 有效账户密码的暴力破解

1. 一旦 `akamai` 已被识别为有效用户，Intruder 将重新以 **Sniper 模式**:

* 用户名字段仍保持绑定到 `akamai`.
* 只有 **密码** 与提供的字典（认证实验室密码）一起使用。

<figure><img src="https://1574813340-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. 再次检查响应，包括：

* \*\*HTTP 状态码\*\*。
* 响应正文大小。
* 错误消息的缺失或更改。

2. 在测试 **`chelsea`** 密码时，响应不同（例如，\*\*HTTP 代码\*\*与其他尝试不同）。/ → 据此推断该密码 **`akamai` / `chelsea`** 是正确的。

<figure><img src="https://1574813340-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/zh/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.
