> 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/access-control/user-id-controlled-by-parameter-unpredictable-guid.md).

# 由参数控制的不可预测 GUID

#### 由参数控制的用户ID

本实验展示了一个 **水平权限提升** 用户账户页面上的问题。/ 特点是 **用户通过 GUID 进行标识**，即长且随机的凭证，例如：

```bash
9e2f3fc0-7035-48ed-ad6d-f643690c7b9d
```

连接到账户后 **wiener:peter**，你可以在“我的账户”部分看到自己的 GUID。

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

#### **通过发布内容恢复 GUID**

通过浏览网站，我们在 **可见的发布内容** 中找到其他用户的 GUID：

* 管理员的 GUID 出现在他的某一条帖子中。

<figure><img src="/files/679fc46c43b02bab68ee8aed60ce60608c2f5db7" alt=""><figcaption></figcaption></figure>

同样，我们可以从 **carlos**.

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

```bash
?userId=5abc76d3-7763-4be9-83d1-c6181bcdf0b5
```

#### **操作：访问 Carlos 的账户**

账户页面可通过一个可控参数访问：

```bash
my-account?id=5abc76d3-7763-4be9-83d1-c6181bcdf0b5
```

只需将我们的 GUID 替换为 **carlos**，我们就能访问他的账户：

<figure><img src="/files/03979fd97cc665c94adb6f51bec9062d217a01f4" 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/access-control/user-id-controlled-by-parameter-unpredictable-guid.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.
