add whit host support

pull/80/head
root 9 years ago
parent c0b121a64c
commit 172b56505c

@ -6,9 +6,11 @@ Redirect="on"
CookieMatch="on"
postMatch="on"
whiteModule="on"
whiteHostModule="on"
black_fileExt={"php","jsp"}
ipWhitelist={"127.0.0.1"}
ipBlocklist={"1.0.0.1"}
hostWhiteList = {"www.xxx.com"}
CCDeny="off"
CCrate="100/60"
html=[[

@ -10,6 +10,7 @@ UrlDeny = optionIsOn(UrlDeny)
PostCheck = optionIsOn(postMatch)
CookieCheck = optionIsOn(cookieMatch)
WhiteCheck = optionIsOn(whiteModule)
WhiteHostCheck = optionIsOn(whiteHostModule)
PathInfoFix = optionIsOn(PathInfoFix)
attacklog = optionIsOn(attacklog)
CCDeny = optionIsOn(CCDeny)
@ -89,6 +90,20 @@ function whiteurl()
end
return false
end
function whitehost()
if WhiteHostCheck then
local items = Set(hostWhiteList)
for host in pairs(items) do
if ngxmatch(ngx.var.host, host, "isjo") then
log('POST',ngx.var.request_uri,"-","white host".. host)
return true
end
end
end
return false
end
function fileExtCheck(ext)
local items = Set(black_fileExt)
ext=string.lower(ext)

@ -2,6 +2,7 @@ local content_length=tonumber(ngx.req.get_headers()['content-length'])
local method=ngx.req.get_method()
local ngxmatch=ngx.re.match
if whiteip() then
elseif whitehost() then
elseif blockip() then
elseif denycc() then
elseif ngx.var.http_Acunetix_Aspect then

Loading…
Cancel
Save