From aba8bdbc8c78d6ae9af99dc400c4d3a2596c1bc4 Mon Sep 17 00:00:00 2001 From: loveshell <82163261@qq.com> Date: Wed, 8 Apr 2015 00:20:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=96=87=E4=BB=B6=E6=89=A9?= =?UTF-8?q?=E5=B1=95=E5=90=8D=E7=9A=84=E5=87=BD=E6=95=B0=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- init.lua | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index ca6b3a7..f44d3db 100644 --- a/init.lua +++ b/init.lua @@ -88,7 +88,21 @@ function whiteurl() end return false end - +function fileExtCheck(ext) + local items = Set(fileExtension) + if ext then + if not items[ext] then + log('POST',ngx.var.request_uri,"-","file attack with ext "..ext) + say_html() + end + end + return false +end +function Set (list) + local set = {} + for _, l in ipairs(list) do set[l] = true end + return set +end function args() for _,rule in pairs(argsrules) do local args = ngx.req.get_uri_args()