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
65d0f22b
authored
Jun 30, 2023
by
CnChunfeng
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
暂时处理
parent
abd1f236
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
waf.lua
waf.lua
View file @
65d0f22b
...
...
@@ -136,6 +136,33 @@ if pageNum ~= nil and tonumber(pageNum) >= 50 then
red
:
sadd
(
'ichunt_waf_black_ip'
,
user_ip
)
end
-------s------------------------20230630新增对m.ichunt.com特殊处理-------s------------------------
--如果在检测的路由中则继续
if
temp_uri
==
'/v3/api/common/data'
and
tonumber
(
ngx
.
var
.
server_name_id
)
==
2
then
--获取对应的时间和次数
checkuricount
=
5
checkuritime
=
4
checkuriip
=
'waf_urldesc_limit_'
..
user_ip
--如果不存在则设为1
if
red
:
get
(
checkuriip
)
==
ngx
.
null
then
red
:
set
(
checkuriip
,
0
)
end
--自增1 设置超时时间
red
:
incr
(
checkuriip
)
red
:
expire
(
checkuriip
,
checkuritime
)
--如果超过次数就跳转至google验证页面,并且带上网址
if
tonumber
(
red
:
get
(
checkuriip
))
>
checkuricount
then
redirect
.
checkgoogle
(
red
)
end
end
-------e------------------------20230630新增对m.ichunt.com特殊处理-------e------------------------
...
...
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