From a892f446bac203649fc2ae95d860d9586ad6cabd Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sun, 28 Apr 2019 16:48:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=93=8D=E5=BA=94=E5=86=85=E5=AE=B9=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/op_waf/index.py | 7 +++++++ plugins/op_waf/js/op_waf.js | 12 ++++++------ plugins/op_waf/waf/config.json | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/plugins/op_waf/index.py b/plugins/op_waf/index.py index 7d6cd9dc4..d022f23ba 100755 --- a/plugins/op_waf/index.py +++ b/plugins/op_waf/index.py @@ -86,6 +86,13 @@ def contentReplace(content): def initDreplace(): + + config = getPluginDir() + '/waf/config.json' + content = public.readFile(config) + content = json.loads(content) + content['reqfile_path'] = public.getServerDir() + "/openresty/nginx/conf/waf/html" + public.writeFile(config, public.getJson(content)) + path = public.getServerDir() + "/openresty/nginx/conf" if not os.path.exists(path + '/waf'): sdir = getPluginDir() + '/waf' diff --git a/plugins/op_waf/js/op_waf.js b/plugins/op_waf/js/op_waf.js index b1273d822..eeb92ad58 100755 --- a/plugins/op_waf/js/op_waf.js +++ b/plugins/op_waf/js/op_waf.js @@ -456,31 +456,31 @@ function wafGloabl(){ \ \ \ - 规则 | 响应内容\ + 规则 | 响应内容\ \ \ GET-参数过滤'+ rdata.get.ps + '' + rdata.get.status + '
\ \ \ -
规则 | 响应内容\ + 规则 | 响应内容\ \ \ POST过滤'+ rdata.post.ps + '' + rdata.post.status + '
\ \ \ -
规则 | 响应内容\ + 规则 | 响应内容\ \ \ User-Agent过滤'+ rdata['user-agent'].ps + '' + rdata['user-agent'].status + '
\ \ \ -
规则 | 响应内容\ + 规则 | 响应内容\ \ \ Cookie过滤'+ rdata.cookie.ps + '' + rdata.cookie.status + '
\ \ \ -
规则 | 响应内容\ + 规则 | 响应内容\ \ \ 常见扫描器'+ rdata.scan.ps + '' + rdata.scan.status + '
\ @@ -511,7 +511,7 @@ function wafGloabl(){ \ 其它'+ rdata.other.ps + '--\ --\ - 响应内容\ + 响应内容\ \ \ \ diff --git a/plugins/op_waf/waf/config.json b/plugins/op_waf/waf/config.json index 6c1b739fd..aae507cca 100755 --- a/plugins/op_waf/waf/config.json +++ b/plugins/op_waf/waf/config.json @@ -1 +1 @@ -{"reqfile_path": "/Users/midoks/Desktop/fwww/server/openresty/nginx/conf/waf/html", "drop_abroad": {"status": 444, "ps": "\u7981\u6b62\u4e2d\u56fd\u5927\u9646\u4ee5\u5916\u7684\u5730\u533a\u8bbf\u95ee\u7ad9\u70b9", "open": true, "reqfile": ""}, "retry": 6, "log": true, "retry_cycle": 60, "scan": {"status": 444, "ps": "\u8fc7\u6ee4\u5e38\u89c1\u626b\u63cf\u6d4b\u8bd5\u5de5\u5177\u7684\u6e17\u900f\u6d4b\u8bd5", "open": true, "reqfile": ""}, "cc": {"status": 444, "ps": "\u8fc7\u8651CC\u653b\u51fb", "limit": 120, "endtime": 300, "open": true, "reqfile": "", "cycle": 60}, "body_character_string": [], "start_time": 1556095983.425878, "get": {"status": 403, "ps": "\u8fc7\u6ee4uri\u3001uri\u53c2\u6570\u4e2d\u5e38\u89c1sql\u6ce8\u5165\u3001xss\u7b49\u653b\u51fb", "open": true, "reqfile": "get.html"}, "body_regular": [], "log_save": 30, "user-agent": {"status": 403, "ps": "\u901a\u5e38\u7528\u4e8e\u8fc7\u6ee4\u6d4f\u89c8\u5668\u3001\u8718\u86db\u53ca\u4e00\u4e9b\u81ea\u52a8\u626b\u63cf\u5668", "open": true, "reqfile": "user_agent.html"}, "retry_time": 180, "other": {"status": 403, "ps": "\u5176\u5b83\u975e\u901a\u7528\u8fc7\u6ee4", "reqfile": "other.html"}, "cookie": {"status": 403, "ps": "\u8fc7\u6ee4\u5229\u7528Cookie\u53d1\u8d77\u7684\u6e17\u900f\u653b\u51fb", "open": true, "reqfile": "cookie.html"}, "logs_path": "/www/wwwlogs/btwaf", "post": {"status": 403, "ps": "\u8fc7\u6ee4POST\u53c2\u6570\u4e2d\u5e38\u89c1sql\u6ce8\u5165\u3001xss\u7b49\u653b\u51fb", "open": true, "reqfile": "post.html"}, "open": true} \ No newline at end of file +{"reqfile_path": "/Users/midoks/Desktop/fwww/server/openresty/nginx/conf/waf/html", "drop_abroad": {"status": 444, "ps": "\u7981\u6b62\u4e2d\u56fd\u5927\u9646\u4ee5\u5916\u7684\u5730\u533a\u8bbf\u95ee\u7ad9\u70b9", "open": true, "reqfile": ""}, "retry": 6, "log": true, "retry_cycle": 60, "scan": {"status": 444, "ps": "\u8fc7\u6ee4\u5e38\u89c1\u626b\u63cf\u6d4b\u8bd5\u5de5\u5177\u7684\u6e17\u900f\u6d4b\u8bd5", "open": true, "reqfile": ""}, "cc": {"status": 444, "ps": "\u8fc7\u8651CC\u653b\u51fb", "limit": 120, "endtime": 300, "open": true, "reqfile": "", "cycle": 60}, "body_character_string": [], "start_time": 1556095983.425878, "get": {"status": 403, "ps": "\u8fc7\u6ee4uri\u3001uri\u53c2\u6570\u4e2d\u5e38\u89c1sql\u6ce8\u5165\u3001xss\u7b49\u653b\u51fb", "open": true, "reqfile": "get.html"}, "body_regular": [], "log_save": 30, "user-agent": {"status": 403, "ps": "\u901a\u5e38\u7528\u4e8e\u8fc7\u6ee4\u6d4f\u89c8\u5668\u3001\u8718\u86db\u53ca\u4e00\u4e9b\u81ea\u52a8\u626b\u63cf\u5668", "open": true, "reqfile": "user_agent.html"}, "logs_path": "/www/wwwlogs/btwaf", "other": {"status": 403, "ps": "\u5176\u5b83\u975e\u901a\u7528\u8fc7\u6ee4", "reqfile": "other.html"}, "cookie": {"status": 403, "ps": "\u8fc7\u6ee4\u5229\u7528Cookie\u53d1\u8d77\u7684\u6e17\u900f\u653b\u51fb", "open": true, "reqfile": "cookie.html"}, "retry_time": 180, "post": {"status": 403, "ps": "\u8fc7\u6ee4POST\u53c2\u6570\u4e2d\u5e38\u89c1sql\u6ce8\u5165\u3001xss\u7b49\u653b\u51fb", "open": true, "reqfile": "post.html"}, "open": true} \ No newline at end of file