DDos attacks or Dos attacks

To see the number of connections :

netstat -lpna |grep :80 |wc -l

To see the number of connections and IP addresses :

netstat -lpna |grep :80|awk ‘{print $5}’ |cut -d: -f1 |sort |uniq -c |sort -n

If huge number of connections are coming from a particular IP, i.e greater than 50 connections , we should block this IP

For that we can use IPTABLES

iptables -A INPUT -s IP –dport 80 -p tcp -j DROP

Advertisements
  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: