LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 03-14-2010, 06:15 AM   #1
Goni
LQ Newbie
 
Registered: Sep 2005
Posts: 26

Rep: Reputation: 15
Unhappy massive DDoS .. need advice / help


Hi,
My website is being abused and thrown at a massive DDoS attack. The attack is simple, SYN + http flood. Here is a sample of it,

Code:
Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7 (.NET CLR 3.5.30729)
Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1

Host: 85.100.227.159
Http Code: 200 	Date: Mar 14 05:08:28 	
Http Version: HTTP/1.1 	Size in Bytes: 3174
Agent: Opera/9.02 (Windows NT 5.1; U; ru)
Hosts are random, but all the agents have 1 thing in common, the word ru and rv. It seems like a botnet, I see around 20,000 syn connections in netstat. I have tried, floodmon, apf and all sort of iptables magics, none of them are working. I even have tried in Firebox x550e hardware device, that even goes to it's knees. Traffic volume is around 20Mbps not that much.

What I am doing right now is taking each IP from apache access_log and netstat output and using iptables to block it, but that also not helping out. apf also not helping at all. Seems like someone is having fun with PitBull Bot V5 PRiVaTE Sh3llBoT or something similar.

Would love to hear from your experiences, help ... anything ..

m stuck ...

Goni

Last edited by Goni; 03-14-2010 at 06:16 AM. Reason: update
 
Old 03-14-2010, 08:06 AM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
You could rate limit the connections by modifying this approach :
http://www.debian-administration.org/articles/187
 
Old 03-14-2010, 08:08 AM   #3
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: Slack14.2/Many
Posts: 5,573

Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
Hey can you use this too

[DELETED]

Last edited by unSpawn; 03-14-2010 at 08:50 AM.
 
0 members found this post helpful.
Old 03-14-2010, 08:40 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by linus72 View Post
Hey can you use this too
No you can't. It's neither suitable or effective. Whatever was posted in that thread has nothing to do with GNU/Linux or Linux Security but is only the result of boredom. I suggest you do not post such "advice" in this forum, even if meant jocularly.
 
Old 03-14-2010, 08:43 AM   #5
Goni
LQ Newbie
 
Registered: Sep 2005
Posts: 26

Original Poster
Rep: Reputation: 15
Or, if you guys know any host which can cater with syn and http floods? PM me if possible.
 
Old 03-14-2010, 08:53 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
If you search this forum you'll see replied time and time again that any end-point "solutions" simply won't work. If you can't get help from your hosting provider or their upstream then you best shut down your webserver and sit it out. Here's a nice discussion: http://www.linuxquestions.org/questi...ttacks-597364/ and here's some background docs: http://staff.washington.edu/dittrich/misc/ddos/.

Last edited by unSpawn; 03-14-2010 at 08:57 AM. Reason: //More *is* more
 
Old 03-14-2010, 10:09 AM   #7
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
So, are you hosting this site ? I know most routers have an option to protect against syn and ddos. Now, I'm not sure if this will help if you're up against a large botnet, never had such a thing happen.

May want to try:
http://forums.digitalpoint.com/showthread.php?t=1031456
 
Old 03-14-2010, 10:28 AM   #8
spampig
Member
 
Registered: Feb 2010
Location: /Earth/UK/England/Hampshire
Distribution: Debian, Ubuntu, CentOS, Slackware
Posts: 262
Blog Entries: 2

Rep: Reputation: 56
I don't think anything will really be able to stand up to a decent, genuine DDoS attack. If you have thousands of hosts all firing out SYN packets to the same IP you might as well take a pee in the ocean. Things like rate control are fine and dandy, but there is still overhead in processing the request. I've seen some of the 'angry spammer' DDoS attacks on clients and with all the best will in the world they mostly succeed in disrpupting service. Whilst some defence is better than none a true 'massive DDoS attack' as the title suggest is something you really can't do a great deal about.
 
Old 03-14-2010, 11:16 AM   #9
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
I just remember a program I found long ago that is very good against port scanner, but it may have some use against DDOS as well:

http://labrea.sourceforge.net/labrea-info.html

Also see:
http://www.secureworks.com/research/threats/ddos/

I'm no expert and have never used this to stop a DDOS, but if you want "anything", well here it is.
 
1 members found this post helpful.
Old 03-14-2010, 01:13 PM   #10
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
Change your web server IP.
 
0 members found this post helpful.
Old 03-14-2010, 05:24 PM   #11
devnull10
Member
 
Registered: Jan 2010
Location: Lancashire
Distribution: Slackware Stable
Posts: 572

Rep: Reputation: 120Reputation: 120
Quote:
Originally Posted by nimnull22 View Post
Change your web server IP.
The attack is likely hitting whatever IP the DNS resolves to , so changing may have little effect. In any case, it would certainly be easy for the attackers to just switch to the new IP!
 
1 members found this post helpful.
Old 03-14-2010, 08:02 PM   #12
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
Quote:
Originally Posted by devnull10 View Post
The attack is likely hitting whatever IP the DNS resolves to , so changing may have little effect. In any case, it would certainly be easy for the attackers to just switch to the new IP!
I do not think botnet uses DNS resolvers.
But anyway, as I already have suggested here, the only way is to filter all IPs one was attacked from or if it necessary - to block whole network. If ISP refuse to help with it, one need linux computer with 2 ethernet cards, configured like bridge, and manually add IP range.

That can help. But it needs some patience.

Last edited by nimnull22; 03-14-2010 at 08:05 PM.
 
0 members found this post helpful.
Old 03-15-2010, 02:52 AM   #13
Web31337
Member
 
Registered: Sep 2009
Location: Russia
Distribution: Gentoo, LFS
Posts: 399
Blog Entries: 71

Rep: Reputation: 65
nimnull22 changing IP is absolutely useless since attackers most commonly hunting down domain(specific site or other service). Please don't give such a bad advices.
Blocking IP ranges isn't a big help either. B-net is b-net after all, so you may occasionally block your own future customers of provided services.
There are NO tools(those who claim they can help to stop ddos with some magic wand are liars) that can stop ddos. Only way to limit it's impact is to analyze traffic/logs of attacked application and make some strategy of filtering requests on either firewall or application side.
In your case, if you run webserver your solutions may be in reviewing logs, finding out some sequence and trying to block it. Say if attackers use similar user-agent string or refer to similar script, there is a way to block them or limit number of requests per interval of time, etc.
Anyway, ddos can be of different types. What's an impact of current situation? They overload your network channel? Or making a dos for cpu resources or memory? does your webserver returns 50* errors under that load?
If you want some help over this, post some part of logs or traffic dumps so we can possibly suggest something. Any additional information about current situation is welcome.
 
Old 03-15-2010, 04:19 AM   #14
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,248
Blog Entries: 8

Rep: Reputation: 235Reputation: 235Reputation: 235
Have you tried Snort? Maybe you can use it to intercept a request before it reaches the apache server and block (through iptables) the address if its requests matches the patterns that you have. This is more like a preemptive defense and I think it's a lot better than checking out logs of apache and netstat. It saves a lot of resources as well.
 
Old 03-16-2010, 06:50 PM   #15
unixfool
Member
 
Registered: May 2005
Location: Northern VA
Distribution: Slackware, Ubuntu, FreeBSD, OpenBSD, OS X
Posts: 782
Blog Entries: 8

Rep: Reputation: 158Reputation: 158
Quote:
Originally Posted by konsolebox View Post
Have you tried Snort? Maybe you can use it to intercept a request before it reaches the apache server and block (through iptables) the address if its requests matches the patterns that you have. This is more like a preemptive defense and I think it's a lot better than checking out logs of apache and netstat. It saves a lot of resources as well.
Enabling Snort inline isn't a trivial task. It isn't something that he's going to be able to immediately deploy, either.

Also, something's going to take the load and end up getting tilted and in this case, it may well be the firewall...the firewall and/or kernel may tilt anyways when just trying to track the connections. AND, the system is going to try to log the activity, which may impact the system's resources.

I believe another user mentioned upstream blocking (at the perimeter router...I don't mean a Linksys home gateway). Blocking upstream is the better method, as the router/switch is designed to handle such loads and leaves the other security layers less taxed and more able to deal with things that make it through.

DDoS are difficult to mitigate. Some BIG companies can do this but those companies usually own their own backbone.
 
  


Reply

Tags
nginx



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Hello / DDoS attacks cybernet2u Linux - Security 7 11-21-2009 09:30 PM
DDOS attack help me dheeraj4uuu Linux - Security 9 05-31-2009 03:07 PM
Concerning DDoS attacks joji_in_changwon Linux - Security 13 11-27-2007 11:12 AM
DDOS Attack studiofos Linux - Security 3 09-12-2006 03:42 AM
Ddos Mag|c Linux - Security 2 08-16-2003 09:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 01:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration