您好我有一个centos5服务器上启用mod_security和其中一个规则是让用户不要在窗体上张贴一些文本。 该文本是合法的,但它后面有“create”和一个html <table>标签,所以导致误报。
我收到的错误如下:
[Sun Apr 25 20:36:53 2010] [error] [client 76.171.171.xxx] ModSecurity: Access denied with code 500 (phase 2). Pattern match "((alter|create|drop)[[:space:]]+(column|database|procedure|table)|delete[[:space:]]+from|update.+set.+=)" at ARGS:body. [file "/usr/local/apache/conf/modsec2.user.conf"] [line "352"] [id "300015"] [rev "1"] [msg "Generic SQL injection protection"] [severity "CRITICAL"] [hostname "www.mysite.com"] [uri "/node/181/edit"] [unique_id "@TaVDEWnlusAABQv9@oAAAAD"]
这里是/usr/local/apache/conf/modsec2.user.conf(第352行)
#Generic SQL sigs SecRule ARGS "((alter|create|drop)[[:space:]]+(column|database|procedure|table)|delete[[:space:]]+from|update.+set.+=)" "id:1,rev:1,severity:2,msg:'Generic SQL injection protection'"
我有的问题是:
多谢你们
您可以使用LocationMatch指令在特定的URL上禁用ModSecurity,如下所示:
<LocationMatch "/node/181/edit"> <IfModule mod_security2.c> SecRuleEngine Off </IfModule> </LocationMatch>