Accueil > Réseau, Sécurité > Debian / Ubuntu / CentOs – Block DDOS attacks with No More DDOS (formerly : DDoS Deflate)

Debian / Ubuntu / CentOs – Block DDOS attacks with No More DDOS (formerly : DDoS Deflate)

22/01/2016 Categories: Réseau, Sécurité Tags: , , , ,
Print Friendly, PDF & Email

If you arrive on this page, is that you have already received a DDoS attack on your server or you want to protect it before this attack happens on your server.
In this tutorial, we will install « No More DDoS » (replacing DDoS Deflate that is no longer maintained by its author) that lets you easily protect you against small DDoS attacks.

This script is available in 2 versions :

  1. the Debian version, compatible with : Debian 6/7/8, Ubuntu Server 13.10, Ubuntu Server 14.04, Linux Mint 17 and distributions based on Debian.
  2. the CentOs version, compatible with : CentOs 6/7, RHEL 6/7 (à venir dans la version 2.0), Fedora 20 (coming in version 2.0), and distributions based on CentOs.
  1. Install No More DDoS
  2. Configure No More DDoS
  3. No More DDoS GUI
  4. Update No More DDoS
  5. Uninstall No More DDoS

1. Install No More DDoS

To install « No More DDoS for Debian« , use the following command :

wget -O- https://raw.githubusercontent.com/stylersnico/nmd/master/debian/install.sh | sh

To install »No More DDoS for CentOS 7 » use the following command :

wget -O- https://raw.githubusercontent.com/stylersnico/nmd/master/centos/install.sh | sh

2. Configurer No More DDoS

To configure No More DDoS, edit the « /usr/local/nmd/conf.d/agent.conf » file :

vim  /usr/local/nmd/conf.d/agent.conf

In this file, you can edit the following information :

  • FREQ : Interval time between 2 launches of the script. By default, this script is run once per minute.
  • NO_OF_CONNECTIONS : Corresponds to the maximum number of established connections to an IP address. If an IP address has more than 500 connections established on your server, this IP will be banned.
  • APF_BAN : By default, the script blocks IP addresses in the firewall with iptables (APF_BAN=0). To use « APF », specify 1 (APF_BAN=1).
  • EMAIL_TO : If you wish to be notified when blocking a DDoS attack, enter your email address at this line. If you leave this empty, then, no e-mail will be sent.
  • BAN_PERIOD : Period during an IP address is blocked. Default : 3600 seconds = 1 hour.

3. No More DDoS GUI

No More DDoS provides a « graphical interface » in order to :

  1. Test the No More DDoS agent
  2. Add an IP address to the white list (for example : the IP address of a monitoring server as Nagios or other)
  3. List IP addresses currently blocked
  4. Unblock an IP address.
  5. Ban an IP address
  6. Clear the agent history
  7. Restore the Cron job
  8. Restore the original configuration

Note : This GUI works only with bans made in iptables.

Debian _ Ubuntu _ CentOs - Block DDoS attacks with No More DDoS (formerly _ DDoS Deflate) - InformatiWeb Pro

To use this GUI, type the following command :

/usr/local/nmd/nmd

To save changes made in the configuration file, use the 7 option and then the option 1.

Option 7 :

--> Creating new cron
 
[....] Restarting periodic command scheduler: cron[ ok ] Stopping periodic command scheduler: cron.
[ ok ] Starting periodic command scheduler: cron.
[....] Restarting periodic command scheduler: cron[ ok ] Stopping periodic command scheduler: cron.
[ ok ] Starting periodic command scheduler: cron.
 
--> Done

Option 1 :
Note : The number in front of the IP address is the number of currently established connections from this IP address.

friday 5 june 2015, xx:xx:xx (UTC+0000)
Connections | IP
 
      2 xx.xx.xx.xx

To ban an IP address or add an IP address to the white list, simply select the corresponding option and indicate the desired IP address.

4. Update No More DDoS

Pour mettre à jour « No More DDoS for Debian » utilisez la commande suivante :

wget -O- https://raw.githubusercontent.com/stylersnico/nmd/master/debian/update.sh | sh

Pour mettre à jour « No More DDoS for CentOS 7 » utilisez la commande suivante :

wget -O- https://raw.githubusercontent.com/stylersnico/nmd/master/centos/update.sh | sh

5. Désinstaller No More DDoS

Pour désinstaller « No More DDoS for Debian » utilisez la commande suivante :

wget -O- https://raw.githubusercontent.com/stylersnico/nmd/master/debian/uninstall.sh | sh

Pour désinstaller « No More DDoS for CentOS 7 » utilisez la commande suivante :

wget -O- https://raw.githubusercontent.com/stylersnico/nmd/master/centos/uninstall.sh | sh

Source: us.informatiweb-pro.net

Les commentaires sont fermés.