> 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-unpredictable-guid-parameter.md).

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

#### 由参数控制的用户 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-unpredictable-guid-parameter.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.
