> 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-role-controlled-by-a-parameter.md).

# 由参数控制的用户角色

### 用户角色由请求参数控制

本实验室有一个可通过以下方式访问的管理面板 **/admin**，它根据 cookie 来判断用户是否是管理员 **很容易伪造**。/ 目标是访问管理面板，然后删除该用户 **carlos**。/ 你可以使用以下凭据登录： **wiener:peter**.

<figure><img src="/files/4af5fdb8036533339407ecff61b389b26d165bd9" alt=""><figcaption></figcaption></figure>

更改电子邮件地址后，我们注意到一个 cookie 只是表明 **true** 或 **false** 管理员角色。

<figure><img src="/files/52a8b45c9fb524be96c65d0d049442aa2a56689d" alt="" width="563"><figcaption></figcaption></figure>

将其值更改为 **true**，管理面板即可访问。

<figure><img src="/files/98267bb06d5d03fc3b80054ee8350a6f93c8b643" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="/files/818c5cb781c52aaa3bc502ee71bcb7999172f8b0" alt="" width="537"><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-role-controlled-by-a-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.
