Perl Script to check DDOS Attack on a web server.
Posted by raxsoJul 16
Here is a small perl script to check if your site is under DDOS attack. I use this script to check our web server for certain attacks.
#!/usr/bin/perl
%ip_add=();
@list=`netstat -an |grep :80 |grep EST |awk ‘{print \$5}’ |awk -F: ‘{print \$1}’`;
foreach $line(@list) {
chomp($line);
$ip_add{$line}++;
}$total=0;
foreach $line2(keys (%ip)) {
$total+=$ip{$line2};
print “$line2=$ip{$line2}\n”;
}
print “total=$total\n”;
— After you get a cheap web hosting deal, you should first go to the hosting product site to learn about it. Unlike others, bluehost as well as hostgator come with their own set of directions. —
Like this blog? Why not buy me a cup of coffee?




![[hackers black book]](http://raxso.net/images/hbb-ani-misuse.gif)





Just a heads up to anyone trying to copy and paste the above into a Linux text editor - you may have to replace the quotation marks manually as could be pasted as “curly quotes” which won’t work.
[Reply]