PortSwiggerlabs: Blind SQL injection with time delays
Information :
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.
Solution :
I tried injecting both parameters but this didn’t work.
So i moved to the TrackingID parameter inside the cookie , but again couldn’t see any difference , so we mus test for Blind SQLi .
Since this is a blind one , we can’t really know what DB is being used so we have to test all of them :
Eventually this is the paylaod that caused the delay :
1
||pg_sleep(10)-- : This proves the DB is PostgreSQL .
We can even see that there was a huge delay after we ran the command :
The moment we cause the delay :
We should see that the lab was solved .
That was all for this lab , see you in the next one :)