Commit 6367c22d by Joneq

修改代码

parent a4bc142a
Showing with 11 additions and 6 deletions
...@@ -408,6 +408,11 @@ red:lpush('spider_ip_info_list',cjson.encode(arr)) ...@@ -408,6 +408,11 @@ red:lpush('spider_ip_info_list',cjson.encode(arr))
res , err = red:expire(spider_time .. user_ip , spider_key_exit_time) res , err = red:expire(spider_time .. user_ip , spider_key_exit_time)
res , err = red:expire(spider_count .. user_ip , spider_key_exit_time) res , err = red:expire(spider_count .. user_ip , spider_key_exit_time)
local ok , err = red:close()
ngx.say(ok)
ngx.say(err)
ngx.exit(ngx.HTTP_FORBIDDEN)
......
...@@ -8,7 +8,7 @@ local _Wafcheck= {} ...@@ -8,7 +8,7 @@ local _Wafcheck= {}
--------白名单ip----------- --------白名单ip-----------
function _Wafcheck.WhiteIp(user_ip) function _Wafcheck.WhiteIp(user_ip)
is_exist ,err = red:sismember('ichunt_waf_white_ip', user_ip) local is_exist ,err = red:sismember('ichunt_waf_white_ip', user_ip)
if is_exist == 1 then if is_exist == 1 then
return "exist" return "exist"
end end
...@@ -18,7 +18,7 @@ end ...@@ -18,7 +18,7 @@ end
--------白名单url----------- --------白名单url-----------
function _Wafcheck.WhiteUrl(url) function _Wafcheck.WhiteUrl(url)
is_exist ,err = red:sismember('ichunt_waf_white_url', url) local is_exist ,err = red:sismember('ichunt_waf_white_url', url)
if is_exist == 1 then if is_exist == 1 then
return "exist" return "exist"
end end
...@@ -28,7 +28,7 @@ end ...@@ -28,7 +28,7 @@ end
--------白名单header----------- --------白名单header-----------
function _Wafcheck.WhiteHeader(header) function _Wafcheck.WhiteHeader(header)
is_exist ,err = red:sismember('ichunt_waf_white_header', header) local is_exist ,err = red:sismember('ichunt_waf_white_header', header)
if is_exist == 1 then if is_exist == 1 then
return "exist" return "exist"
end end
...@@ -39,7 +39,7 @@ end ...@@ -39,7 +39,7 @@ end
-------黑名单Ip -------黑名单Ip
function _Wafcheck.BlackIp(user_ip) function _Wafcheck.BlackIp(user_ip)
is_exist ,err = red:sismember('ichunt_waf_black_ip', user_ip) local is_exist ,err = red:sismember('ichunt_waf_black_ip', user_ip)
if is_exist == 1 then if is_exist == 1 then
return "exist" return "exist"
end end
...@@ -49,7 +49,7 @@ end ...@@ -49,7 +49,7 @@ end
-------黑名单Url -------黑名单Url
function _Wafcheck.BlackUrl(url) function _Wafcheck.BlackUrl(url)
is_exist ,err = red:sismember('ichunt_waf_black_url', url) local is_exist ,err = red:sismember('ichunt_waf_black_url', url)
if is_exist == 1 then if is_exist == 1 then
return "exist" return "exist"
end end
...@@ -59,7 +59,7 @@ end ...@@ -59,7 +59,7 @@ end
-------黑名单header -------黑名单header
function _Wafcheck.BlackHeader(header) function _Wafcheck.BlackHeader(header)
is_exist ,err = red:sismember('ichunt_waf_black_header', header) local is_exist ,err = red:sismember('ichunt_waf_black_header', header)
if is_exist == 1 then if is_exist == 1 then
return "exist" return "exist"
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