How to check DDOS attach

How to check DDOS attach

netstat -n | grep :80 |wc -l                  // show the number of active connections that are open    to your server
netstat -n | grep :80 | grep SYN |wc -l  //connection of any IP more that 100 then block that IP
netstat -anp |grep 'tcp\|udp' | awk '{print $5}' | cut -d: -f1 | sort | uniq -c| sort -n
netstat -anp |grep 'FIN_WAIT2' | awk '{print $5}' | cut -d: -f1 | sort | uniq -c| sort -n
To disable DOS attack add the following rule to the iptables :=>
# iptables -A INPUT -p tcp -m tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG NONE -j IN_SANITY

Leave a Comment