装置nginx+ngx_lua支撑WAF防护功用

访客5年前关于黑客接单866

 

nginx lua模块 *** 开发的nginx第三方模块,它能将lua言语嵌入到nginx装备中,然后运用lua就极大增强了nginx的才能.nginx以高并发而闻名,lua脚本简便,两者的调配可谓完美.

用处: 避免sql注入,本地包括,部分溢出,fuzzing测验,xss,SSRF等web进犯

避免svn/备份之类文件走漏

避免ApacheBench之类压力测验东西的进犯

屏蔽常见的扫描黑客东西,扫描器

屏蔽反常的 *** 恳求

屏蔽图片附件类目录php履行权限

避免webshell上传

体系:centos 6.4_x64

需求的软件:LuaJIT-2.0.3.tar.gz

tengine-2.1.0.tar.gz (nginx)

ngx_devel_kit-master.zip (ngx_devel_kit)

lua-nginx-module-master.zip (nginx_lua模块)

ngx_lua_waf-master.zip (waf战略 web运用防火墙)

yum -y install gcc gcc-c++ ncurses-devel libxml2-devel openssl-devel curl-devel libjpeg-devel libpng-devel autoconf pcre-devel libtool-libs freetype-devel gd zlib-devel zip unzip wget crontabs iptables file bison cmake patch mlocate flex diffutils automake make readline-devel glibc-devel glibc-static glib2-devel bzip2-devel gettext-devel libcap-devel logrotate ntp libmcrypt-devel GeoIP*

装置LuaJIT 2.0

tar zxf LuaJIT-2.0.0.tar.gz

cd LuaJIT-2.0.0

make && make install

注:lib和include是直接放在/usr/local/lib和usr/local/include

再来设置环境变量(这是给后边nginx编译的时分运用的):

vi /etc/profile

export LUAJIT_LIB=/usr/local/lib

export LUAJIT_INC=/usr/local/include/luajit-2.0

export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH

source /etc/profile

装置nginx

tar zxvf tengine-2.1.0.tar.gz

cd tengine-2.1.0

./configure --user=www --group=www --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-pcre=/root/lnmp/pcre-8.20 --with-google_perftools_module --with-http_realip_module --with-poll_module --with-select_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module --with-http_image_filter_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_slice_module --with-http_mp4_module --with-http_gzip_static_module --with-http_concat_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_sysguard_module --with-http_browser_module=shared --with-http_user_agent_module=shared --with-http_upstream_ip_hash_module=shared --with-http_upstream_least_conn_module=shared --with-http_upstream_session_sticky_module=shared --with-http_addition_module=shared --with-http_xslt_module=shared --with-http_image_filter_module=shared --with-http_sub_module=shared --with-http_flv_module=shared --with-http_slice_module=shared --with-http_mp4_module=shared --with-http_concat_module=shared --with-http_random_index_module=shared --with-http_secure_link_module=shared --with-http_sysguard_module=shared --with-http_charset_filter_module=shared --with-http_userid_filter_module=shared --with-http_footer_filter_module=shared --with-http_trim_filter_module=shared --with-http_access_module=shared --with-http_autoindex_module=shared --with-http_map_module=shared --with-http_split_clients_module=shared --with-http_referer_module=shared --with-http_uwsgi_module=shared --with-http_scgi_module=shared --with-http_memcached_module=shared --with-http_limit_conn_module=shared --with-http_limit_req_module=shared --with-http_empty_gif_module=shared

make && make install

报过错请履行 error while loading shared libraries: libluajit-5.1.so.2: cannot open shared object file: No such file or directory

ln -s /usr/local/lib/libluajit-5.1.so.2 /lib64/libluajit-5.1.so.2

然后创立下面文件夹

mkdir -p /data/logs/{client_body,hack}

chown -R www:www /data

chmod -R 755 /data

解压ngx lua waf-master.zip

unzip ngx_lua_waf-master.zip

mv ngx_lua_waf-master/* /usr/local/webserver/nginx/conf/

vi /usr/local/webserver/nginx/conf/config.lua

RulePath = waf的途径--规矩寄存目录

logdir = 日志记载地址--log存储目录,该目录需求用户自己新建,切需求nginx用户的可写权限

attacklog = "off" --是否敞开进犯信息记载,需求装备logdir

UrlDeny="on" --是否阻拦url拜访

Redirect="on" --是否阻拦后重定向

CookieMatch = "on" --是否阻拦cookie进犯

postMatch = "on" --是否阻拦post进犯

whiteModule = "on" --是否敞开URL白名单

[1] [2]  黑客接单网

相关文章

鬼话蜜罐日志剖析

在布置蜜罐之后,会发作很多的日志,关于要挟情报而言,咱们需求经过这些日志来提取其间的有用的数据,本文将会描述提取那些数据用来完结剖析。 布置蜜罐之后会生成描述发作的事情的日志记载。能够收集到的安全事情...

支撑新处理器架构的Mirai变种呈现

概述 2019年2月底,unit 42研究人员发现了新出现的为新处理器架构编译的Mirai样本。尽管Mirai的源码在2019年就揭露了,可是它的进犯方针是特定的一批处理器架构集。 Unit 42研究...

记一次对WebScan的Bypass

今日测验了一个网站,发现存在360webscan的阻拦,所以便开端了一波“bypass”。 进入主题 1. 判别注入点 运用“and 1=1”测验了一下,惨遭阻拦。随后又测验了一下or也是被阻拦的。...

ARM架构上用来替代JTAG的调试协议SWD-黑客接单平台

关于嵌入式开发人员和专门进犯硬件的黑客来说,JTAG 实践上是调试和拜访微处理器寄存器的标准。该协议已运用多年,至今仍在运用,JTAG调试接口有必要运用VCC、GND电源信号,以及TMS、TCK、TD...

看我怎么发现比特币赌博网站缝隙并收成$12000赏金

Web浸透测验中比较难的便是测验那些交互较少的使用了,当你尝试了各种缝隙使用办法而无效之后,很或许就会抛弃了。但有时分,这种花费时刻的投入和研讨,对白帽本身的技能进步来说,仍是十分有用的。这儿我就共...

PHP中该怎样避免SQL注入?

问题描述: 假如用户输入的数据在未经处理的情况下刺进到一条SQL查询句子,那么运用将很可能遭受到SQL注入进犯,正如下面的比如: $unsafe_variable = $_POST['user_in...