> 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).

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

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

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

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

提供的列表如下：

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

<figure><img src="/files/9bf5dae971ccb8e7ab7f9f7744da5aac54199fb8" alt=""><figcaption></figcaption></figure>

#### 1. 检测有效用户名

1. 以 **Intruder 模式** 并使用 **Cluster Bomb** 技术：

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

2. 配置一个 \*\*匹配规则（regex）\*\* 来过滤包含以下消息的响应：

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

<figure><img src="/files/3c5b5c85e385b66576844c4b079d57bb484ab6be" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/648cc715386bebe998a9f0039899401e7c2217b9" alt=""><figcaption></figcaption></figure>

1. 查看响应后，我们注意到用户名 **`akamai`** 与其他用户名不同，并揭示了与账户锁定相关的这种行为。/ → \*\*`akamai` 被识别为有效用户名。\*\*

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

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

* 用户名字段仍保持为 `akamai`.
* 只有 **密码** 与提供的字典（Authentication lab passwords）一起使用。

<figure><img src="/files/955b07f28dc97aa9987711d73bf028afbc1e4a6a" alt=""><figcaption></figcaption></figure>

1. 再次检查响应，包括：

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

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

<figure><img src="/files/f0b9d0bee4a9db595859d1ac941e36a67f4b0c90" 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 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://hacking-notes.jord4n.pro/zh/web/authentication/username-enumeration-via-account-lock.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.
