Monday, May 9, 2011

DDOS Attack prevention on Linux server.

DDOS Attack prevention on Linux server.

It will show you count.

netstat -anp |grep 'tcp\|udp' | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n

Get output to file.
netstat -anp |grep 'tcp\|udp' | awk '{print $5}' | cut -d: -f1     | grep "." > test123

Install and configure APF firewall.
wget http://www.rfxn.com/downloads/apf-current.tar.gz
tar xzvf apf-current.tar.gz

Add IP list to deny file.
cat test123 >> /etc/apf/deny_hosts.rules

Save the list.
/etc/apf/apf -r

Restart the firewall
/etc/init.d/apf restart
Stopping APF:                                              [  OK  ]
Starting APF:                                              [  OK  ]


OR

Solution I am Using.

USE THIRD PARTY SERVICE. Move your DNS to this.
i.e. http://cloudflare.com/
Cloud Flare is blocking exact threats which is HITING to website.
There is many fetures, please check the site.



2 comments:

  1. What is DDOS and how to establish in linux server related information through this blog.Above all the points are explained very clearly.Reading this kind of article is very helpful to improve my linux knowledge.hosting server

    ReplyDelete
    Replies
    1. Thank you for your comment, It was needed for me.

      :)

      Delete