ADD uri检查列表,同一个IP不能频繁请求这个列表中的uri,遵循CC的策略 #13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
因为最近我的服务器遭受到几百个IP规模的CC攻击
攻击特点是,多个链接轮训的加入了一个时间戳的参数,所以导致现有的denycc无效。
于是我针对我碰到的情况,加入了这个特性:
然后请求者的IP加入ipBlocklist,最后执行blockip()
blockip()应该是被遗漏了,不然我也不会在denycc()里面直接调用。
这样直接导致了没有开启denycc,IP黑名单功能也失效。所以这里应该是一个Bug.
denycc的改善想法
如果只有几个页面链接,没有JavaScript,样式,图片等资源文件的频繁请求,就可以当作是攻击者IP处理,这样对于web系统来说不会出现误判。
这个目前只是想法,有时间我去实践一下。
代码是临时学习Lua写的,所以质量可想象,甚至还有可能有严重的Bug。