Commit c265bbea by Joneq

增加google验证条状

parent bd2180c3
Showing with 1 additions and 5 deletions
...@@ -13,9 +13,7 @@ function _ReM.checkgoogle() ...@@ -13,9 +13,7 @@ function _ReM.checkgoogle()
dest = 'http://passport.ichunt.com/static/login.html' .. '?continue=' .. source_url dest = 'http://passport.ichunt.com/static/login.html' .. '?continue=' .. source_url
--获取多少时间内同一个ip可以几次302,超过就加入黑名单 --获取多少时间内同一个ip可以几次302,超过就加入黑名单
threezerotwo_time , err = red:get('threezerotwo_time')
threezerotwo_second , err = red:get('threezerotwo_second') threezerotwo_second , err = red:get('threezerotwo_second')
threezerotwo_ip = 'threezerotwo_time_secode_'..user_ip threezerotwo_ip = 'threezerotwo_time_secode_'..user_ip
--如果不存在则设为1 --如果不存在则设为1
if red:get(threezerotwo_ip) == ngx.null then if red:get(threezerotwo_ip) == ngx.null then
...@@ -25,10 +23,8 @@ function _ReM.checkgoogle() ...@@ -25,10 +23,8 @@ function _ReM.checkgoogle()
red:incr(threezerotwo_ip) red:incr(threezerotwo_ip)
red:expire(threezerotwo_ip , threezerotwo_second) red:expire(threezerotwo_ip , threezerotwo_second)
nownum,err = red:get(threezerotwo_ip)
--如果超过次数就添加至黑名单 --如果超过次数就添加至黑名单
if nownum >= 3 then if tonumber(red:get(threezerotwo_ip)) >= tonumber(red:get('threezerotwo_time')) then
red:sadd('ichunt_waf_black_ip',user_ip) red:sadd('ichunt_waf_black_ip',user_ip)
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment