Commit cdd4c698 by Joneq

修改代码

parent 944f98de
...@@ -7,7 +7,7 @@ local _Lstring= {} ...@@ -7,7 +7,7 @@ local _Lstring= {}
--------切分字符串 --------切分字符串
function _Lstring.Split(self,szFullString, szSeparator) function _Lstring.Split(szFullString, szSeparator)
local nFindStartIndex = 1 local nFindStartIndex = 1
local nSplitIndex = 1 local nSplitIndex = 1
local nSplitArray = {} local nSplitArray = {}
......
...@@ -7,7 +7,7 @@ local _ReM = {} ...@@ -7,7 +7,7 @@ local _ReM = {}
------跳转到google验证页面 ------跳转到google验证页面
function _ReM.checkgoogle(self) function _ReM.checkgoogle()
source_url = ngx.encode_base64(ngx.var.scheme .. '://' .. source_url = ngx.encode_base64(ngx.var.scheme .. '://' ..
ngx.var.host .. ':' .. ngx.var.server_port .. ngx.var.request_uri) ngx.var.host .. ':' .. ngx.var.server_port .. ngx.var.request_uri)
dest = 'http://passport.ichunt.com/static/login.html' .. '?continue=' .. source_url dest = 'http://passport.ichunt.com/static/login.html' .. '?continue=' .. source_url
......
...@@ -7,7 +7,7 @@ local _Reqhandle= {} ...@@ -7,7 +7,7 @@ local _Reqhandle= {}
--------去除一些网站自己的白名单 --------去除一些网站自己的白名单
function _Reqhandle.Selfwhiteurl(self) function _Reqhandle.Selfwhiteurl()
local l_str = string.reverse(ngx.var.request_uri) local l_str = string.reverse(ngx.var.request_uri)
local l_a,l_b = string.find(l_str,'?') local l_a,l_b = string.find(l_str,'?')
...@@ -40,7 +40,7 @@ end ...@@ -40,7 +40,7 @@ end
--------获取真实ip --------获取真实ip
function _Reqhandle.GetRealIp(self) function _Reqhandle.GetRealIp()
if tonumber(ngx.var.server_name_id) == 1 then if tonumber(ngx.var.server_name_id) == 1 then
user_ip = ngx.var.remote_addr user_ip = ngx.var.remote_addr
......
...@@ -103,6 +103,7 @@ end ...@@ -103,6 +103,7 @@ end
-- 黑名单存在直接302 -- 黑名单存在直接302
if wafcheck.BlackIp(user_ip) == 'exist' or wafcheck.BlackUrl(temp_uri) == 'exist' or wafcheck.BlackHeader(user_ip) == 'exist' then if wafcheck.BlackIp(user_ip) == 'exist' or wafcheck.BlackUrl(temp_uri) == 'exist' or wafcheck.BlackHeader(user_ip) == 'exist' then
red:close() red:close()
......
...@@ -7,7 +7,7 @@ local _Wafcheck= {} ...@@ -7,7 +7,7 @@ local _Wafcheck= {}
--------白名单ip----------- --------白名单ip-----------
function _Wafcheck.WhiteIp(self,user_ip) function _Wafcheck.WhiteIp(user_ip)
is_exist ,err = red:sismember('ichunt_waf_white_ip', user_ip) 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"
...@@ -17,7 +17,7 @@ end ...@@ -17,7 +17,7 @@ end
--------白名单url----------- --------白名单url-----------
function _Wafcheck.WhiteUrl(self,url) function _Wafcheck.WhiteUrl(url)
is_exist ,err = red:sismember('ichunt_waf_white_url', url) is_exist ,err = red:sismember('ichunt_waf_white_url', url)
if is_exist == 1 then if is_exist == 1 then
return "exist" return "exist"
...@@ -27,7 +27,7 @@ end ...@@ -27,7 +27,7 @@ end
--------白名单header----------- --------白名单header-----------
function _Wafcheck.WhiteHeader(self,header) function _Wafcheck.WhiteHeader(header)
is_exist ,err = red:sismember('ichunt_waf_white_header', header) is_exist ,err = red:sismember('ichunt_waf_white_header', header)
if is_exist == 1 then if is_exist == 1 then
return "exist" return "exist"
...@@ -38,7 +38,7 @@ end ...@@ -38,7 +38,7 @@ end
-------黑名单Ip -------黑名单Ip
function _Wafcheck.BlackIp(self,user_ip) function _Wafcheck.BlackIp(user_ip)
is_exist ,err = red:sismember('ichunt_waf_black_ip', user_ip) 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"
...@@ -48,7 +48,7 @@ end ...@@ -48,7 +48,7 @@ end
-------黑名单Url -------黑名单Url
function _Wafcheck.BlackUrl(self,url) function _Wafcheck.BlackUrl(url)
is_exist ,err = red:sismember('ichunt_waf_black_url', url) is_exist ,err = red:sismember('ichunt_waf_black_url', url)
if is_exist == 1 then if is_exist == 1 then
return "exist" return "exist"
...@@ -58,7 +58,7 @@ end ...@@ -58,7 +58,7 @@ end
-------黑名单header -------黑名单header
function _Wafcheck.BlackHeader(self,header) function _Wafcheck.BlackHeader(header)
is_exist ,err = red:sismember('ichunt_waf_black_header', header) is_exist ,err = red:sismember('ichunt_waf_black_header', header)
if is_exist == 1 then if is_exist == 1 then
return "exist" return "exist"
......
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