mirror of https://github.com/Safe3/uuWAF
Update anti-cc.lua
parent
41c37b9d1f
commit
b3907f2f28
|
@ -17,13 +17,13 @@ local sh = ngx.shared.ipCache
|
||||||
local ccIp = 'cc-' .. waf.ip
|
local ccIp = 'cc-' .. waf.ip
|
||||||
local c, f = sh:get(ccIp)
|
local c, f = sh:get(ccIp)
|
||||||
if not c then
|
if not c then
|
||||||
sh:set(ccIp, 0, 60, 1) -- 设置1分钟也就是60秒访问计数时间
|
sh:set(ccIp, 1, 60, 1) -- 设置1分钟也就是60秒访问计数时间
|
||||||
else
|
else
|
||||||
if f == 2 then
|
if f == 2 then
|
||||||
return true, ccIp, true
|
return waf.block(true)
|
||||||
end
|
end
|
||||||
sh:incr(ccIp, 1)
|
sh:incr(ccIp, 1)
|
||||||
if c >= 360 then
|
if c + 1 >= 360 then
|
||||||
sh:set(ccIp, c, 300, 2) -- 设置5分钟也就是300秒拦截时间
|
sh:set(ccIp, c, 300, 2) -- 设置5分钟也就是300秒拦截时间
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue