ngx_lua_waf是一个基于lua-nginx-module(openresty)的web应用防火墙
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

21 lines
684 B

ngx.req.read_body()
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!!')
end
else
return
end
log('User-agent')