DDoS-Deflate安装及配置

DDoS-Deflate是一款免费并且专门用来抵御和减轻ddos攻击的程序。它可通过netstat监测跟踪大量iP地址,如果在检测到结点处超过预设限制时,该程序会通过APF阻挡该IP地址。下面带大家了解DDoS-Deflate安装及配置:

DDoS-Deflate安装及配置插图亿华云

安装

wget http://www.inetbase.com/scripts/ddos/install.sh
chmod
0700 install.sh
./install.sh

配置

FREQ=1
NO_OF_CONNECTIONS
=150
APF_BAN
=1
KILL
=1
EMAIL_TO
=”root
BAN_PERIOD
=600
IP
地址白名单:/usr/local/ddos/ignore.ip.list

卸载

wget http://www.inetbase.com/scripts/ddos/uninstall.ddos
chmod
0700 uninstall.ddos
./uninstall.ddos

通过定时检测ip地址的连接情况,当某IP所需连接超过配置脚本限制数,程序自动禁止这些ip,来达到防护攻击的目的

Installation 安装

wget http://www.inetbase.com/scripts/ddos/install.sh
chmod
0700 install.sh
./install.sh

Uninstallation 卸载

wget http://www.inetbase.com/scripts/ddos/uninstall.ddos
chmod
0700 uninstall.ddos
./uninstall.ddos

检查是否遭到ddos攻击命令

netstat -ntu| awk ‘{print $5}‘| cut -d:-f1 | sort | uniq -c | sort -n

DDoS deflate的默认配置位于/usr/local/ddos/ddos.conf ,内容如下:

#####Paths of the script and other files
PROGDIR
=“/usr/local/ddos
PROG
=“/usr/local/ddos/ddos.sh
IGNORE_IP_LIST
=“/usr/local/ddos/ignore.ip.list// IP地址白名单
CRON
=“/etc/cron.d/ddos.cron// 定时执行程序
APF
=“/etc/apf/apf
IPT
=“/sbin/iptables##### frequency in minutes for running the script
#####Caution:Everytimethis setting is changed, run the script with--cron
##### option so that the newfrequency takes effect
FREQ
=1// 检查时间间隔,默认1分钟#####How many connections define a bad IP?Indicate that below.NO_OF_CONNECTIONS=150// 最大连接数,超过这个数IP就会被屏蔽,一般默认即可##### APF_BAN=1Make sure your APF version is atleast 0.96#####APF_BAN=0Uses iptables for banning ips instead of APF
APF_BAN
=1// 使用APF还是iptables。推荐使用iptables,将APF_BAN的值改为0即可。##### KILL=0BadIPs arent banned, good for interactive execution of script##### KILL=1Recommendedsetting
KILL
=1// 是否屏蔽IP,默认即可#####An email is sent to the following address when an IP is banned.#####Blankwould suppress sending of mails
EMAIL_TO
=“root// 当IP被屏蔽时给指定邮箱发送邮件,换成自己的邮箱即可#####Numberof seconds the banned ip should remainin blacklist.
BAN_PERIOD
=600// 禁用IP时间,默认600秒,

安装后需要将白名单设置好,避免mysql服务器,rsync备份服务器等需要保持连接的ip被封,另外CDN加速不适于用这脚本因为CDN节点缓存服务器IP百分百会被封。

以上就是关于“DDoS-Deflate安装及配置”的相关解答如需购买测试PHP主机,推荐亿华云共享虚拟主机、独享IP虚拟主机齐备,各类配置均有,满足不同网站建设需求;另外提供免费虚拟主机,可供测试,让您快速上线网站。

选购地址:https://www.kufanyun.com/host/

THE END
Copyright © 2024 亿华云