Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CnChunfeng
/
ichunt_lua_waf
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f43e931d
authored
Dec 07, 2021
by
Joneq
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
增加慢速统计302跳转代码
parent
443b0840
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletions
waf.lua
wafcheck.lua
waf.lua
View file @
f43e931d
...
...
@@ -97,13 +97,19 @@ end
-- 黑名单存在直接
302
-- 黑名单存在直接
403
if
wafcheck
.
BlackIp
(
user_ip
,
red
)
==
'exist'
or
wafcheck
.
BlackUrl
(
temp_uri
,
red
)
==
'exist'
or
wafcheck
.
BlackHeader
(
u_agent
,
red
)
==
'exist'
then
ngx
.
exit
(
ngx
.
HTTP_FORBIDDEN
)
return
end
-- 在302直接跳转google验证
if
wafcheck
.
Threetwoone
(
user_ip
,
red
)
==
'exist'
then
redirect
.
checkgoogle
(
red
)
end
-------20210316对nginx的参数xss进行处理
if
"GET"
==
ngx
.
var
.
request_method
then
...
...
wafcheck.lua
View file @
f43e931d
...
...
@@ -66,4 +66,15 @@ function _Wafcheck.BlackHeader(header,redis)
return
"continue"
end
-------慢速统计出来的302ip
function
_Wafcheck
.
Threetwoone
(
user_ip
,
redis
)
local
is_exist
,
err
=
redis
:
sismember
(
'ichunt_waf_three_zero_two_list'
,
user_ip
)
if
is_exist
==
1
then
return
"exist"
end
return
"continue"
end
return
_Wafcheck
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment