hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Hosting Security and Technology : Massive DDOS - Urgent Help Needed
Reply

Hosting Security and Technology Configuring and optimizing web hosting servers and operating systems, developing administration scripts, building servers, protecting against hackers, and general security (SSL certificates, etc.)
Forum Jump

Massive DDOS - Urgent Help Needed

Reply Post New Thread In Hosting Security and Technology Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 08-10-2009, 12:34 AM
SaturnStar SaturnStar is offline
Junior Guru Wannabe
 
Join Date: Oct 2004
Posts: 33

Massive DDOS - Urgent Help Needed


I'm not very good at server administration, I stick to WHM, but my server is now experiencing a DDOS that hasn't seized up at all. My server is brought to it's knees. Can anyone give any advice?

Reply With Quote


Sponsored Links
  #2  
Old 08-10-2009, 12:59 AM
e-Sensibility e-Sensibility is offline
Uptime Aficionado
 
Join Date: Mar 2009
Location: /usr/bin/perl
Posts: 971
depending on how large "massive" is a tipping point firewall might mitigate the impact this has on your servers.

Beyond that, the only solution is incredibly expensive hardware specifically designed to filter out nasty traffic, which only specialized data centers have.

Edit: also, if you notice that the bad traffic is all coming from specific regions, you can mass-blacklist ip's in your firewall, dropping all packets from those regions instantly.


Last edited by e-Sensibility; 08-10-2009 at 01:03 AM.
Reply With Quote
  #3  
Old 08-10-2009, 02:29 AM
alanzkorner alanzkorner is offline
Junior Guru Wannabe
 
Join Date: Oct 2007
Location: Mumbai, India
Posts: 67
Hello,

You can use this command to check the IPs from which the attack is coming .

Quote:
netstat -anp|grep tcp|awk '{print $5}'| cut -d : -f1 | sort | uniq -c | sort -n
based on the result blacklist the ip in server firewall


Also You can use this script to prevent ddos attack .

Quote:

#!/bin/bash
# Finding out which all ips making coneection and also the number of connection from an IP
#make a file counter in the same location as this script and and add entries in each line..
#the script will run as number of times as the number of lines in the file
for j in `cat ./counter`
do
echo "Round="$j
netstat -anp|grep tcp|awk '{print $5}'| cut -d : -f1 | sort | uniq -c | sort -n|grep -v 127.0.0.1|grep -v 0.0.0.0 > connections
####Finding the number of entries in the file and storing it to a file#####
n=`cat ./connections|wc -l`

#echo $n

####Finding top five connection making IPs #####
a=`expr $n - 1`
b=`expr $n - 2`
c=`expr $n - 3`
d=`expr $n - 4`
#echo $a
#echo $b
#echo $c
#echo $d

##### Filtering out the number of connections ####

top1=`sed -n ''$n'p' connections|awk '{print $1}'`
#echo $top1
top2=`sed -n ''$a'p' connections|awk '{print $1}'`
top3=`sed -n ''$b'p' connections|awk '{print $1}'`
top4=`sed -n ''$c'p' connections|awk '{print $1}'`
top5=`sed -n ''$d'p' connections|awk '{print $1}'`

##The below given part of code checks the top 5 high connections makers and if they are
# making more than 50 connections then they will be blocked and the loop exits from the
# script once any of the top connection maker is making less than 50 connections

if test $top1 -gt 50

then
sed -n ''$n'p' connections|awk '{print $2}' >>blocked
sed -n ''$n'p' connections|awk '{print $2}' |xargs csf -d
else
#rm -rf ./connections
#rm -rf ./blocked
exit
fi


##### filtering out the top five connection making ips #####
sed -n ''$n'p' connections|awk '{print $2}'
sed -n ''$a'p' connections|awk '{print $2}'
sed -n ''$b'p' connections|awk '{print $2}'
sed -n ''$c'p' connections|awk '{print $2}'
sed -n ''$d'p' connections|awk '{print $2}'

if test $top2 -gt 50
then
sed -n ''$a'p' connections|awk '{print $2}' >>blocked
sed -n ''$a'p' connections|awk '{print $2}' |xargs csf -d
else
#rm -rf ./connections
#rm -rf ./blocked
exit
fi

if test $top3 -gt 50
then
sed -n ''$b'p' connections|awk '{print $2}' >>blocked
sed -n ''$b'p' connections|awk '{print $2}' |xargs csf -d
else
#rm -rf ./connections
#rm -rf ./blocked
exit
fi

if test $top4 -gt 50
then
sed -n ''$c'p' connections|awk '{print $2}' >>blocked
sed -n ''$c'p' connections|awk '{print $2}'|xargs csf -d
else
#rm -rf ./connections
#rm -rf ./blocked
exit
fi

if test $top5 -gt 50
then
sed -n ''$d'p' connections|awk '{print $2}' >>blocked
sed -n ''$d'p' connections|awk '{print $2}' |xargs csf -d
else
#rm -rf ./connections
#rm -rf ./blocked
exit
fi
echo "Completed round "$j
/etc/init.d/csf restart
echo " "
#sleep 10
done

__________________
Regards,
Alan John

Reply With Quote
Sponsored Links
  #4  
Old 08-10-2009, 03:16 AM
eth10 eth10 is offline
Temporarily Suspended
 
Join Date: Jul 2009
Posts: 178
Best solution is to install DOS-Deflate which stops all attacks on all ports.

Reply With Quote
  #5  
Old 08-10-2009, 03:20 AM
Wulex Wulex is offline
Web Hosting Master
 
Join Date: Nov 2002
Posts: 1,468
Wow, about the script, does it really work?

__________________
All life is an experiment. The more experiments you make the better.

Reply With Quote
  #6  
Old 08-10-2009, 04:54 AM
0nijin 0nijin is offline
Newbie
 
Join Date: Aug 2009
Posts: 23
Yes it sees which IP's have multiple connections then bans them from the server. You need to be able to connect to ssh though

Reply With Quote
  #7  
Old 08-10-2009, 08:33 AM
linuxfan linuxfan is offline
Junior Guru
 
Join Date: Mar 2009
Posts: 244
Quote:
Originally Posted by Wulex View Post
Wow, about the script, does it really work?
Yes it does.Some people says how csf firewall can do same thing,but don't know how.

Reply With Quote
  #8  
Old 08-10-2009, 08:59 AM
e-Sensibility e-Sensibility is offline
Uptime Aficionado
 
Join Date: Mar 2009
Location: /usr/bin/perl
Posts: 971
Never used Csf but you can easily accomplish this with iptables, which will be on any Linux box, or pf on *bsd

Reply With Quote
  #9  
Old 08-10-2009, 09:12 AM
040Hosting 040Hosting is offline
Community Liaison
 
Join Date: May 2006
Location: EU & USA
Posts: 3,627
Quote:
Originally Posted by roguehosting View Post
Yes it does.Some people says how csf firewall can do same thing,but don't know how.
Might misunderstand your post, but the script posted above is using CSF.

p/s when using that script i would first rewrite it so that file locations are bit better defined; this might get confusing.


Last edited by 040Hosting; 08-10-2009 at 09:13 AM. Reason: added remark about script.
Reply With Quote
  #10  
Old 08-10-2009, 10:23 AM
linuxfan linuxfan is offline
Junior Guru
 
Join Date: Mar 2009
Posts: 244
Quote:
Originally Posted by 040Hosting View Post
Might misunderstand your post, but the script posted above is using CSF.

p/s when using that script i would first rewrite it so that file locations are bit better defined; this might get confusing.
Dos deflate is using APF,not CSF.

Reply With Quote
  #11  
Old 08-10-2009, 10:26 AM
040Hosting 040Hosting is offline
Community Liaison
 
Join Date: May 2006
Location: EU & USA
Posts: 3,627
Quote:
Originally Posted by roguehosting View Post
Dos deflate is using APF,not CSF.
Sorry, but i thought you were mentioning the script shown in this post and that you where answering someones question regarding that script.

From my point of view alanzkorner's post was the one Wulex (which you quoted) was about. Hence my confusion.


Last edited by 040Hosting; 08-10-2009 at 10:28 AM. Reason: pressed send way to fast.
Reply With Quote
  #12  
Old 08-10-2009, 12:08 PM
rankris rankris is offline
Web Hosting Guru
 
Join Date: Jun 2008
Location: India
Posts: 258
script is cool could you include rules to block exim usage too??

__________________
Ranjith
Light travels faster thn sound.This is why some people look bright until you actually hear them speak

Reply With Quote
  #13  
Old 08-10-2009, 02:10 PM
Dave - Just199 Dave - Just199 is offline
Web Hosting Master
 
Join Date: Aug 2003
Location: East Coast
Posts: 1,952
LFD (part of csf) reads the logs and blackholes malicious users based on the specifications that you enter in the configuration. There is a rigid set of standard rules.

Honestly though unless it's a small ddos iptables / etc wont do you much good. but then again if you can ssh into the box it's a small dos attack and not an actual botnet.

__________________
Just199.com cPanel WebHosting and VPS's
Paidforumposting.com The #1 content provider for forums and blogs

Reply With Quote
  #14  
Old 08-11-2009, 07:44 AM
mooseweb mooseweb is offline
Danananana Danananana Batman!
 
Join Date: Dec 2008
Location: Florida
Posts: 1,052
CSF is currently the best free firewall solution out there, if you have any sort of knowledge at all you'll know how to set it up, because it has a pretty WHM Control Panel.

It takes several hours to get everything perfect though, and just because you do not pass all the security checks it has, doesn't mean your server is insecure. You want a minimum of a 100 on your server's security score though. Once you install CSF, you'll know what I mean.

As for DDoS attacks, unless your fairly large your dealing with a small attack from a script kiddie. He's probably just flooding you with packets, so scan the connections and set it so that it bans anyone who uses over 150 connections at one time.
*WARNING: When DL'ing files from FTP, each file is a connection, so be careful with that number.

__________________
Not sure what to put here :-P

Reply With Quote
  #15  
Old 08-11-2009, 09:43 AM
mixmox mixmox is offline
Web Hosting Master
 
Join Date: Sep 2008
Location: Canada
Posts: 1,006
hello and how can i run that scripts?

Reply With Quote
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
Seeking urgent 1 or 2 people for massive joboffer + 1 partner kwakkwak Employment / Job Offers 5 10-10-2007 08:10 AM
URGENT: ddos mitigation NWSTech Dedicated Server 9 09-30-2007 04:33 PM
Massive DDoS ThomasO Hosting Security and Technology 16 09-18-2007 06:28 AM
Massive DDoS Attack on DNS Root Servers ITWeb LLC Domain Names 0 02-10-2007 09:46 AM
DDos / Hitbot Attack? Urgent help? Matrix_Neo Hosting Security and Technology 11 12-14-2006 05:53 PM

Related posts from TheWhir.com
Title Type Date Posted
Three DNS Hosting Providers Report Possibly Linked DDoS Attacks Web Hosting News 2013-06-05 16:50:15
Prolexic Stops Massive DNS Reflection Attack Web Hosting News 2013-05-30 15:50:21
Man Arrested in Connection to Spamhaus DDoS Attacks Web Hosting News 2013-04-26 15:24:34
WHIR TV - Rick from Neustar Discusses DDOS Threats and Defense Blog 2011-09-23 13:52:45
Prolexic Predicts High Volume Packet-Per-Second DDoS Attacks on the Rise Web Hosting News 2011-07-28 14:02:10


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?