ngx_lua_waf/waf.lua

22 lines
684 B
Lua
Raw Permalink Normal View History

2013-04-16 17:21:52 +00:00
ngx.req.read_body()
2013-04-22 07:54:18 +00:00
if ngx.req.get_headers()['Acunetix-Aspect'] then
ngx.exit(400)
elseif ngx.req.get_headers()['X-Scan-Memo'] then
ngx.exit(400)
end
if ua() then
elseif url() then
elseif args() then
elseif ngx.req.get_body_data() and ngx.re.match(ngx.req.get_body_data(),[[Content-Disposition: form-data;(.*)filename=]],"isjo") ==nil then
ngx.req.read_body()
body()
ngx.req.discard_body()
elseif string.len(filext) >0 then
if ngx.req.get_body_data() and ngx.re.match(ngx.req.get_body_data(),"Content-Disposition: form-data;(.*)filename=\"(.*)."..filext.."\"","isjo") then
ngx.exit('Not Allow Uploaded!!')
2013-03-23 10:14:21 +00:00
end
2013-04-22 07:54:18 +00:00
else
return
2013-03-23 10:14:21 +00:00
end
2013-04-22 07:54:18 +00:00
log('User-agent')