Showing posts with label DDOS. Show all posts
Showing posts with label DDOS. Show all posts

Thursday, May 10, 2012

// // Leave a Comment

Protect DDOS attack with medialayer (D)DoS Deflate

About

(D)DoS Deflate is a lightweight bash shell script designed to assist in the process of blocking a denial of service attack. It utilizes the command below to create a list of IP addresses connected to the server, along with their total number of connections. It is one of the simplest and easiest to install solutions at the software level.
netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n
IP addresses with over a pre-configured number of connections are automatically blocked in the server's firewall, which can be direct iptables or Advanced Policy Firewall (APF). (We highly recommend that you use APF on your server in general, but deflate will work without it.)

Notable Features

  • It is possible to whitelist IP addresses, via /usr/local/ddos/ignore.ip.list.
  • Simple configuration file: /usr/local/ddos/ddos.conf
  • IP addresses are automatically unblocked after a preconfigured time limit (default: 600 seconds)
  • The script can run at a chosen frequency via the configuration file (default: 1 minute)
  • You can receive email alerts when IP addresses are blocked.

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
Read More

Wednesday, December 21, 2011

// // 5 comments

Anti-DDoS PHP Script

Create a directory anti_ddos and throw all the scripts there:

index.php (DDOS attacks detection module):



anti_ddos.php (module redemption DDOS attacks):
 PHP Code: 


Also, for the script will need 4 files check.txt, white_ip.txt, black_ip.txt all_ip.txt and create them in the same directory and all the rights set 666 (read and write).

It is also desirable during the attack lists of IP addresses the attackers machine, the file transfer black_ip.txt gradually. Htaccess file and block them out, then the load is still considerably lower.

Example of a file. Htaccess
Code:
Deny from 11.11.11.11 22.22.22.22 etc. through gap

To connect the script at the beginning of each file, which can be subjected to attack, add the line:
PHPCode:
require ("anti_ddos/index.php");
Read More