MoneySavingExpert under DDoS attack
11pm, 30th October 2007 - Geek, News, Web, Security, Sysadmin, Hardware
Last weekend, MoneySavingExpert (my old employer) was the subject of what appears to be a fairly hefty DDoS attack. It has been reported on several blogs and shortly afterwards on Digg.
There has been much speculation about why it's happening just now and who could be behind it but, as always, without any data to analyse there's no way of making any guess more accurate than a wild stab in the dark. There has also been much wailing and gnashing of teeth about the powerlessness one feels when being attacked by half the internet. Not that the tech team over at Money Saving Towers were wailing or gnashing their teeth, they just got in and fixed the problem. By Sunday afternoon there was a static holding page up which I could actually request and receive in a browser and by Monday morning the site appeared to be back up and running as usual although I think the forums were still down at that time.
There are some things that can be done when you are the victim of a DoS attack. If MoneySavingExpert can survive it, then so can you.
How you deal with a DoS depends greatly on how it's happening. If you don't already know why your site is down, start trying to find the reason. Log files and aggregated statistics are always the first two places I look.
At my current place of employment, we have a series of graphs generated using Orca and RRDTool for each of our servers. These graphs show us everything from CPU load to disk space used to the number of open TCP connections to the machine's uptime. If a particular server is causing the problem then I can load all of its graphs in a single window and scroll down the list looking for anything unusual. If the problem is with a particular website then I can load up just the servers that website affects. If I don't know which part of our system is the cause of the downtime, then I can load them all up.
Unusual patterns in log files can also be an indicator that something is wrong. If I notice that one IP address has requested more web pages than the next ten combined then I start to suspect that something is wrong at that IP address. If I notice that today's log file is twenty times the size of yesterday's log file, then I'm going to want to have a look inside both of them. At this stage, all I'm doing is gathering information because I don't even know if it's a deliberate DoS or just some other sort of site outage. Either way, the logfiles often hold the answer.
There are many different ways a DoS can be caused. Simply flooding a webserver with ten times the normal number of requests it has to deal with is a crude but effective method. This method will often cause your upstream bandwidth provider to start dropping packets because it can't keep up the pace. Even if your webserver could serve all the requests, some of them won't make it all the way there. Other types of DoS exist, however, and it's worth mentioning some of them here.
There are plenty of vulnerabilities in the off-by-one-buffer-overflow category that will cause a program to crash. These are inevitably classed as denial of service vulnerabilities because that's usually all that can be exploited with them. The important thing to note is that you don't need a large botnet or even a small one to cause a DoS to someone using this method. All an attacker needs is a single computer with the ability to anonymise it's payload through something like ToR or a list of proxy servers. Every crash (i.e every request) is going to cause several minutes of downtime.
Another class of DoS attack is caused by requesting a page that causes a lot of resource usage, such as requesting '%' from a badly written search function. If the page is vulnerable, this example will cause the result set of the search to include every row in the database. This will chew up large amounts of CPU and RAM even if it only actually displays the top ten results.
A DoS attacker could also request pages that cause lots of logging to occur, hence filling up the victim's file system. I have actually caused this to happen completely by accident on one guy's website. Apparently, in the space of about half an hour I caused 60GB of log files to be generated on their webserver. Luckily, they knew what I was doing and had my phone number so they could ask me to stop.
These sorts of attacks - the ones that cause resource starvation on your webserver - can be caught with an IDS such as Snort, any decent firewall or a dedicated appliance. Once you can identify the packets that are part of the DoS it is simply a matter of knowing how your firewall/IDS is configured and configuring it to drop those packets.
The other sort of DoS attack - the sort that attacks the services that support your site rather than the site itself - cannot be stopped by you. They will require the people who run the service that failed to do whatever they need to do to survive the attack. In the case of MoneySavingExpert, it appears that they have requested the services of ProLexic, a company that specialises in mitigating the effects of bandwidth-based DDoS attacks. Essentially, ProLexic point all of the victim's traffic at their own servers, filter out the bad requests and pass the remaining requests on to the real webservers. It's a simple but effective tactic that works against the crude but effective attack.
Related posts:
Clever girl...Galumph went the little green frog one day.
Time to move on
Distribution and layers
They took my shower !
Comments
Analyzing log files from a DDoS can be a tedious and nearly impossible task.. imagine the number of entries and relationships you must establish. I think one would need some tool to do that, but that would be the job for a IDS. Diverting the traffic from the victim to a filter company is a good idea (for the victim) but wouldn't the company need massive amounts of bandwidth/processing power? That would be costly.
By the way, what's wrong with your RSS? It doesn't show any of your posts..
Analysing and filtering the DDoS is precisely what ProLexic do. They have written custom software for exactly that purpose.
You're also right about it being costly, however most DDoS attacks are followed by an extortion attempt. Sometimes the amount requested will be less than the cost of fighting the attack but a successful extortion attempt is usually followed by another and another and another...
Some DDoS attacks are started by someone who is just holding a grudge against the victim. When that happens, you just have to balance the cost of mitigating the attack against the cost of not doing any business for several days.
There's a great article somewhere about the founder of ProLexic and how he got started with this company. He just had a good idea one day about how he could stop a DDoS and convinced someone who was under attack to give him some money and let him have a go. It worked, and the rest is history.
I'm not sure about the RSS feed... it's supposed to be generated every time I update my blog but it appears to have failed the last time. I re-generated it manually. Thanks for letting me know... I don't subscribe to my own RSS feed so I probably wouldn't ever have noticed !
I found this blog very informative. Keep it up
There are various DDOS protection tools and some companies even provide solutions for this. Its not a thing I'd worry too much, there will be a downtime. If a DDOS attack takes place then I'd go to AWSTATS and then sort the ips based on the requests and then block them using htaccess.