最新消息:时间抓起来说是金子,抓不住就是流水。

利用nginx重写规则防止SQL注入攻击通用规则

Nginx 老子黑牵翻 7223浏览 0评论
if ($request_uri ~* "([+|(%20)]and[+|(%20)])|([+|(%20)]or[+|(%20)])|([+|(%20)]select[+|(%20)])|([+|(%20)]exec[+|(%20)])|([+|(%20)]union[+|(%20)])") {
return 404;
}
if ($request_uri ~* "(cost\()|(concat\()") {
return 404;
}
if ($query_string ~ "(<|%3C).*script.*(>|%3E)") {
return 404;
}
if ($query_string ~ "GLOBALS(=|[|%[0-9A-Z]{0,2})") {
return 404;
}
if ($query_string ~ "_REQUEST(=|[|%[0-9A-Z]{0,2})") {
return 404;
}
if ($query_string ~ "proc/self/environ") {
return 404;
}
if ($query_string ~ "mosConfig_[a-zA-Z_]{1,21}(=|%3D)") {
return 404;
}
if ($query_string ~ "base64_(en|de)code(.*)") {
return 404;
}
if ($http_user_agent ~ "Python-urllib") {
return 404;
}

转载请注明:LINUX服务器运维架构技术分享 » 利用nginx重写规则防止SQL注入攻击通用规则

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址