mirror of
https://github.com/Safe3/uusec-waf.git
synced 2025-10-04 15:01:55 +08:00
### Feature Updates **Interface & Management** - Redesigned main program and management interface with improved aesthetics and usability, supports UI language switching (English/Chinese) - Added Rule Collections functionality: Create custom rule templates for batch configuration - Introduced whitelist rules that terminate further rule matching upon success - UUSEC WAF Rules API intelligent suggestions during advanced rule editing:ml-citation - New plugin management supporting hot-reloaded plugins to extend WAF capabilities **Protocol & Optimization** - Supports streaming responses for continuous data push (e.g., LLM stream outputs) - Enables Host header modification during proxying for upstream service access - Search engine validation: `waf.searchEngineValid(dns,ip,ua)` prevents high-frequency rules from affecting SEO indexing - Interception log report generation (HTML/PDF exports) - Automatic rotation of UUSEC WAF error/access logs to prevent performance issues **Security & Infrastructure** - Expanded free SSL certificate support: HTTP-01 & DNS-01 verification across 50+ domain providers - Customizable advanced WAF settings: HTTP2, GZIP, HTTP Caching, SSL protocols, etc - Cluster configuration: Manage UUSEC WAF nodes and ML servers via web UI
19 lines
No EOL
674 B
Lua
19 lines
No EOL
674 B
Lua
--[[
|
|
Rule name: Abnormal character encoding requests
|
|
Filtering stage: Request phase
|
|
Threat level: High
|
|
Rule description: Hackers typically use an exception charset in the Content Type header to define character set encoding to bypass WAF protection, such as IBM037, IBM500, cp875, etc
|
|
--]]
|
|
|
|
|
|
local rct = waf.reqContentType
|
|
local has = waf.contains
|
|
local counter = waf.strCounter
|
|
local rgx = waf.rgxMatch
|
|
if rct then
|
|
rct = waf.toLower(rct)
|
|
if has(rct, "charset") and (not rgx(rct, "charset\\s*=\\s*(utf\\-8|gbk|gb2312|iso\\-8859\\-1|iso\\-8859\\-15|windows\\-1252)","jo") or counter(rct, "charset") > 1) then
|
|
return true, rct, true
|
|
end
|
|
end
|
|
return false |