> 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/pt-br/web/access-control/user-role-controlled-by-a-parameter.md).

# Função do Usuário Controlada por um Parâmetro

### Função do usuário controlada por parâmetro de requisição

Este laboratório tem um painel de administração acessível por meio de **/admin**, que determina se um usuário é administrador com base em um cookie **facilmente falsificável**. / O objetivo é acessar o painel de administração e depois excluir o usuário **carlos**. / Você pode se conectar com as seguintes credenciais: **wiener:peter**.

<figure><img src="/files/adf56ca60f21a5afcfc9abfb7bbada73d038a66b" alt=""><figcaption></figcaption></figure>

Após alterar o endereço de e-mail, notamos que um cookie simplesmente indica **verdadeiro**  ou **falso** a função de administrador.

<figure><img src="/files/2d184d67b28ba99f581783c0acdf9c26529ced87" alt="" width="563"><figcaption></figcaption></figure>

Ao alterar seu valor para **verdadeiro**, o painel de administração fica acessível.

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

<figure><img src="/files/8b25aa5b6142f453006272805bf155037527a833" 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/pt-br/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.
