DDoS deflate is a free script for defending and mitigating DDoS attacks. It creates an IP address for a large number of network connections through Netstat monitoring trails that prohibit or block these IPs through APF or iptables when a node is detected that exceeds the preset limit.
Official website:http://deflate.medialayer.com/
1. Install DDoS deflate
Shell>wget http://www.inetbase.com/scripts/ddos/install.sh
Shell>chmod 0700 install.sh
shell>./install.sh
2. Configure DDoS Deflate
The default configuration for DDoS deflate is located in/usr/local/ddos/ddos.conf, which reads as follows:
##### 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 address white list
cron= "/etc/cron.d/ddos.cron"//Timed execution procedure
apf= "/etc/apf/apf"
ipt= "/sbin/iptables"
##### frequency in minutes for running the script
##### caution:every time This setting are changed, run the script with--cron
##### option so the new frequency takes effect
Freq=1//Check time interval, default 1 minutes
##### How many connections define a bad IP? indicate that below.
no_of_connections=150//Maximum number of connections, more than this number of IP will be blocked, the general default can be
##### apf_ban=1 (Make sure your APF version is atleast 0.96)
##### apf_ban=0 (Uses iptables for banning IPs instead of APF)
Apf_ban=1//using APF or iptables. It is recommended to use Iptables to change the value of Apf_ban to 0.
##### kill=0 (Bad IPs are ' NT banned, good for interactive execution of script)
##### kill=1 (recommended setting)
Kill=1//Whether shielding IP, the default can
##### an email was sent to the following address when a IP is banned.
##### Blank would suppress sending of mails
email_to= "root"///when IP is blocked to send mail to the specified mailbox, recommended to use, change your own mailbox can
##### number of seconds the banned IP should remain in blacklist.
ban_period=600//Disable IP time, default 600 seconds, can be adjusted according to the situation
3. Uninstall DDoS deflate
Shell>wget Http://www.inetbase.com/scripts/ddos/uninstall.ddos
Shell>chmod 0700 Uninstall.ddos
Shell>./uninstall.ddos
4. White List setting
Sometimes the default whitelist often has errors, in order to avoid this situation, we can manually set the white list of IP, and then force not allowed to modify
Vi/usr/local/ddos/ignore.ip.list//Manually set white list IP
Chattr +i/usr/local/ddos/ignore.ip.list//forced modification not allowed
Chattr-i/usr/local/ddos/ignore.ip.list//Lifting not allowed modification