工作,学习,生活,这里将会有一些记录. 备用域名:http://meisw.51099.com 注册 | 登陆
浏览模式: 标准 | 列表分类:openresty

openresty waf

yum install git
git clone https://github.com/loveshell/ngx_lua_waf
cd ngx_lua_waf/
vi install.sh 
yum install -y vim-enhanced
cd ngx_lua_waf/
vim install.sh 
yum install -y unzip
ls /data/
yum install readline-devel pcre-devel openssl-devel gcc
wget https://openresty.org/download/openresty-1.11.2.2.tar.gz
tar zxvf openresty-1.11.2.2.tar.gz 
cd openresty-1.11.2.2
./configure --prefix=/www/openresty             --with-luajit             --without-http_redis2_module             --with-http_iconv_module
gmake
gmake install
/www/openresty/nginx/sbin/nginx 
wget https://github.com/loveshell/ngx_lua_waf/archive/master.zip --no-check-certificate
unzip master.zip 
cd ngx_lua_waf-master/
mv ngx_lua_waf-master/ lua_waf
cd lua_waf/
vi nginx.conf
vi lua_waf/waf.lua 
/www/openresty/nginx/sbin/nginx -s reload
curl http://localhost
curl http://localhost/?id=../etc/passwd
 
 
 
http {
    include       mime.types;
    default_type  application/octet-stream;
    lua_need_request_body on;
    lua_package_path "/www/openresty/nginx/conf/lua_waf/?.lua";
    lua_shared_dict limit 10m;
    init_by_lua_file  /www/openresty/nginx/conf/lua_waf/init.lua; 
    access_by_lua_file /www/openresty/nginx/conf/lua_waf/waf.lua;