From 3c82631d7bd0c1b07b6689233ea472f2dc3ab0ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=97=E5=AD=90?= Date: Sun, 10 Dec 2023 14:06:30 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=B0=83=E4=BC=98=20WAF=20=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/openresty/install.sh | 59 ++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/scripts/openresty/install.sh b/scripts/openresty/install.sh index 402a264a..d5602f3a 100644 --- a/scripts/openresty/install.sh +++ b/scripts/openresty/install.sh @@ -363,6 +363,8 @@ http { server_tokens off; access_log off; + waf_http_status general=403 cc_deny=444; + # 服务状态页 server { listen 80; @@ -505,6 +507,63 @@ cat > ${openrestyPath}/html/stop.html << EOF EOF +# 写入 WAF 拦截页(战未来,暂时无法生效) +cat > ${openrestyPath}/html/block.html << EOF + + + + + + 请求被拦截 - 耗子Linux面板 + + + +
+

耗子Linux面板

+

本次请求判断为危险的攻击请求,已被拦截!

+

当您看到此页面,说明您的请求被WAF拦截,可能是由于您的请求中包含了危险的攻击内容,或者您的请求被误判为攻击请求。

+

如果您认为这是误判,请联系服务器管理员解决。

+
+ + +EOF + # 处理文件权限 chmod -R 755 ${openrestyPath} chmod -R 755 /www/wwwroot