> 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/business-logic/inconsistent-security-controls.md).

# Controles de Segurança Inconsistentes

### Controles de Segurança Inconsistentes

**Objetivo do laboratório**

Este laboratório tem uma falha lógica associada a verificações de segurança inconsistentes. / Usuários arbitrários podem acessar recursos administrativos normalmente reservados a funcionários da empresa. / O objetivo é acessar o painel de administração e excluir o usuário **carlos**.

**Observação inicial**

Ao tentar acessar diretamente a interface de administração, a seguinte mensagem aparecerá:

> *A interface de administração só está disponível se você estiver logado como um usuário DontWannaCry*

Acesso ao `/admin` é, portanto, restrito a usuários pertencentes ao **DontWannaCry** domínio.

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

**Tentativa de registro**

Um novo usuário é registrado usando:

* **Nome de usuário**: `DontWannaCry` (já existente)
* **Endereço de e-mail**: um endereço controlado pelo invasor/ `attacker@exploit-0a2500bc04ce231c81841ade012e0049.exploit-server.net`

<figure><img src="/files/3f4589ac4e18f9d6968b7fcaeedf34b162712f1b" alt=""><figcaption></figcaption></figure>

Após enviar o formulário, a aplicação indica:

> *Verifique seus e-mails para o link de registro da sua conta*

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

**Validação de Conta**

Um e-mail de confirmação é recebido com um link contendo um token.

<figure><img src="/files/56bd6c2b1381dfe83baf745e2a8478a03ab65b96" alt=""><figcaption></figcaption></figure>

As credenciais usadas são:

* **Usuário**: `DontWannaCry`
* **Senha**: `jordan`

A conexão funciona corretamente.

<figure><img src="/files/00d78b135f60cb3c5dc75db7427f382bbeb24fb6" alt=""><figcaption></figcaption></figure>

**Modificação do Endereço de E-mail**

Uma vez logado, você altera o endereço de e-mail da conta sem nenhuma validação adicional, usando:

```bash
jordan@dontwannacry.com
```

Não há controle sobre a legitimidade dessa alteração.

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

**Acesso à interface de administração**

Após alterar o e-mail, o usuário passa a ser considerado pertencente ao domínio **DontWannaCry**. / Acesso à `/admin` interface é então permitido.

<figure><img src="/files/bfcd36cdc00b2b8d411efcbaa5134cc38606bc77" 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/pt-br/web/business-logic/inconsistent-security-controls.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.
