Descripción

This lab contains a blind SQL injection vulnerability. The application uses a tracking cookie for analytics, and performs a SQL query containing the value of the submitted cookie.

The results of the SQL query are not returned, and the application does not respond any differently based on whether the query returns any rows or causes an error. However, since the query is executed synchronously, it is possible to trigger conditional time delays to infer information.

To solve the lab, exploit the SQL injection vulnerability to cause a 10 second delay.

Blind SQL injection with time delays writeup

Para completar el laboratorio necesitaremos la cheatsheet de SQL injection de PortSwigger. Vemos que el código para inyectar SQL y provocar un delay de 10 segundos es el siguiente:

Oracledbms_pipe.receive_message(('a'),10)
MicrosoftWAITFOR DELAY '0:0:10'
PostgreSQLSELECT pg_sleep(10)
MySQLSELECT SLEEP(10)

Encontraremos la cookie vulnerable en el inicio del laboratorio:

Nos llevaremos la petición al ‘Repeater’ con Ctrl + R o Click derecho -> Send to Repeater. Allí probaremos a inyectar las diferentes posibilidades, dado que no sabemos el tipo de base de datos que es. Al llegar a la de PostgreSQL la página tardará 10 segundos en cargar y superaremos el laboratorio:

Nota: Como es una base de datos de PostgreSQL, la concatenación se ha hecho con ‘||’ y no con ‘+’ (Microsoft) o ‘ ‘ (SQL).

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *