sql注入之 布尔盲注

一:布尔型盲注
盲注,就是在服务器没有错误回显是完成的注入攻击。服务器没有错误回显,对于攻击者来说缺少了非常重要的信息,所以攻击者必须找到一个方法来验证注入的sql语句是否得到了执行。
注入原理
布尔忙住一般适用于 页面没有回显字段(不支持联合查询),而且web页面返回true或者false,构造sql语句 利用and or 等关键词来时web页面返回true或者false,从而达到注入的目的来获取信息
常用函数
ascii()/ord() 函数,返回字符ascii码值
参数:str单字符
length() 函数,返回字符串的长度。例如:length(‘ab’)= 2
参数 : str 字符串
left(str,length) 函数,返回从左至右截取固定长度的字符串
参数str,length
str : 字符串
length:截取长度
substr(str,pos,length)/substring()/mid() 函数 , 返回从pos位置开始到length长度的子字符串.例如:substr(‘ab’,1,1) 从ab字符串中,第一个位置,取一个长度,为a。
str: 字符串。
pos:开始位置
length: 截取长度
1:判断数据库类型
2:判断当前数据库名(mysql)
判断数据库长度length(database())>x --+
3:判断当前数据库中的表
接下来根据得到的数据库名长度,去判断具体的数据库名字// 此刻用ascii 码来搞他ascii(substr(database(),1,1))
依次判断 查出表名
4. 判断表中的字段
1)接下来 判断 xxxx库中第1,2,3xxx个表名长度
2) // and ascii(substr((select table_name from information_schema.tables where table_schema=‘security’ limit x,1),1,1))>xxx

5.判断字段中的数据
1)xxx表xxx列中字段的长度
and leghth(selecte column_name from informatin. schema columns where table schema=security and table name=‘users’ limit 01)=2-++
依次判断
2)接下来判断字段的ascii值
and ascii(substr((select column_name from information_schema.columns where table_schema=‘security’ and table_name=‘users’ limit 0,1),1,1))=105–+
查出对应的值 okok了

发布了2 篇原创文章 · 获赞 0 · 访问量 111

猜你喜欢

转载自blog.csdn.net/qq_46185846/article/details/104310297