> 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/password-brute-force-via-password-change.md).

# 通过密码修改功能进行密码暴力破解

通过密码修改功能进行密码暴力破解，PortSwigger Web Security Academy 实验笔记，包括利用流程、载荷测试、Burp Suite 验证以及修复上下文

### 通过修改密码进行密码暴力破解

本实验展示了以下功能中的一个漏洞： **修改密码**，从而使得可以通过 **暴力破解**。/ 目标是识别以下用户的密码： **Carlos**，然后访问其页面 \*\*

**提供的凭据：**

* 用户： `wiener`
* 密码： `peter`

**目标用户：**

* `carlos`

有一个部分允许您在身份验证后修改密码。/ 当输入错误的 **当前密码** 信息时，应用程序会返回特定的错误消息。

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-b28b2b93c3c2f8c2b40b13ba25a0e4fb6e224b05%2F%7BDC9BF2F7-E41F-4D00-ADF9-7111E3DBF354%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

应用程序发送的请求示例：

{% code overflow="wrap" %}

```bash
username=wiener&current-password=test&new-password-1=test1234&new-password-2=test123
```

{% endcode %}

如果 `current-password` 字段无效，显示的错误表明当前密码不正确。

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-e2878fffa7229fc9a42c61bc57ea36721199917c%2F%7B498293B7-D204-419C-A18B-8BC457FB303A%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

当替换 `wiener` 替换为 `carlos` 查询中的 **错误消息保持不变**，只要测试的密码不是正确的。配置一个 Burp Intruder 攻击

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-b08fe73486c2f05bd5e404e7a9b5470e007bd9e3%2F%7BE3795651-6554-4698-B348-00BE94804022%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-fd1d049f8656f4a739ba6652b1c93cf983237e54%2F%7B527509D2-E1A4-41E7-A224-3A9100A5010C%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/password-brute-force-via-password-change.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.
