LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 12-19-2008, 11:21 AM   #16
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116

This talk about distributed attacks is interesting because I am seeing none of it. I continue to see the "traditional" attack every 5 seconds or so from one IP which gets banned on the 6th attempt by the script I use.

I wonder if the distributed attacks are not common, or if they are just targeted at IP addresses of known high-value targets.
 
Old 12-19-2008, 11:33 AM   #17
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by unixfool
I don't know if you guys have checked your logs lately but I've noticed a trend. Whereas maybe six months ago, there was rampant large scans from IPs, now the trend is distributed scanning.
I've noticed the same thing, starting around November of '08. I talked about it a little bit in post #7 on this thread: http://www.linuxquestions.org/questi...ilures-685110/

I have had to take some extra security measures because now there are only a couple attacks coming from each IP (not enough to get banned - or delayed in my case).
 
Old 12-19-2008, 11:53 AM   #18
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 rweaver View Post
Of course they are, we adapted so they're adapting to our measures. They're still searching for lowest hanging fruit (and lets not forget a lot of these attempts are coming from bot nets now.)

Lets take a quick step into the realm of the absurd just for comparison sake...

Lets assume there are 5m distributed hosts, they know your account name, your machine can take the traffic and load (heh) from the attempts, and your fail2ban is setup for 10th attempt is banned. That equates to them making ~45m c/h.

That is just about equal to having a password cracker running at about 15k c/s (my servers average) locally (54m c/h).

Do the math on how long it will take them to figure out your 16+ character unique password of mixed case, numbers, and common symbols. It's completely absurd.

The chances of a remote exploit on a daemon, hell on ssh itself, are far higher than your password being broken *IF* your password is good.

Don't get me wrong, I'm not saying you shouldn't take additional precautions, but the first precaution taken should be a strong password if the system has to be accessible from the outside via passwords, because without it, the rest of the protections are just offering a false sense of security. The better solution is to use passwords in conjunction with keys... but that can be problematic in some situations.
I think you're missing the point. If the attackers can dodge your fail2ban, that's one thing. If you're layering your security properly, the new trend of attack will fail...BUT most people tend to totally rely on (key word here) passwords and tools such as denyhosts and fail2ban. A key point is the fact that you keep mentioning strong passwords. Key-based authentication is the stronger solution. There are also other solutions that you can apply to the SSH config file. max-tries itself could stop attacks...that doesn't make the attacks go away, though. There are a lot of misconceptions around SSH that should be put to rest. With the amount of headlines on SSH compromises this year, you'd think that people would learn to harden their systems...they aren't, which is why we post here in the security forums.

The reason why I mentioned the new trend was that there is very little mention of it on these forums. That is a critical change in trending and one that will not be apparent unless you look at your logs with the understanding that one IP showing 30 times in a log could be a concerted attack.

I don't think that this is trivial. A very large percentage of the US (I don't know world stats) is broadband-capable. With dual-core machines and broadband access, factored with scaled attacks of distributed bruteforcing of passwords, the chance of success is much higher than if it were one machine conducting the attacks. And, keep in mind that the average user isn't particularly focused on security as we are here, so the success rate in attacking such an individual's system will be even higher.

So, yeah, this is dependent upon how well you harden your services and FWs. The security oriented won't have issues, but this forum is only a sub-segment of a large forum. Sometimes, big organizations need to have a service as open to the internet as possible. It helps in organizing your security posture if you know the methods that malicious users are using to go under the radar.

I've lost count of the amount of posts in these forums that state that an admin has a compromised machine and that it was compromised because they were unaware of some attack that has been around for ages...

Last edited by unixfool; 12-19-2008 at 12:00 PM.
 
Old 12-19-2008, 12:05 PM   #19
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 anomie View Post
I've noticed the same thing, starting around November of '08. I talked about it a little bit in post #7 on this thread: http://www.linuxquestions.org/questi...ilures-685110/

I have had to take some extra security measures because now there are only a couple attacks coming from each IP (not enough to get banned - or delayed in my case).
BINGO! Cool!

The most concerning thing to me is the fact that I don't see this being somehow tracked using security event management tools (BASE, ArcSight, and such). This isn't particularly a thing to worry about for the average user, but I work with a huge managed security services provider...I don't think we track such attacks (which means we may not be seeing things that companies are paying us to see). :/

This does sound like something that Snort may be able to detect, provided there are good SSH rules in place to detect such activity.
 
Old 12-19-2008, 12:51 PM   #20
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
In my prior post, I mentioned using an ids to trigger on dead-zone queries, not each host. Invalid port attempts on clients could be summarized and analyzed before triggering an alert.

I do get your main point however, that a large bot net could try a large number of possibilities against a large number of targets with little or no repetition of IP addresses, and be able to take their time about it. Using repeated behavior from a single IP will not offer any protection.

My point is that legitimate connections will never do certain things, like trying to logging in as root. You don't need to detect repetition. A single attempt against root or system account is enough to ban an IP. Quick and Easy. You don't need to be alerted every time. To quote the Don from Godfather's pizza, "Just Do It". Combined with other measures like using public key authentication (as I already mentioned) and "AllowUsers", a bot net can't guess a password if you don't use one. Trying password authentication at all is enough evidence to ban that IP. Legitimate users won't use password authentication. By changing your own behavior from password authentication to using keys, you have made the behavior of the attacker very easy to detect.

The dead-zone and booby trapped ports example I gave would have fewer false positives than very complicated and comprehensive ids rules. I was extending my argument of using certain behavior as definite evidence to inside the firewall. By triggering on items that are definitely illegitimate, you could have that IP be blocked by the host automatically without alerting you each time. Besides, I'm sure your tools can analyze, issue periodic summaries and only send out an alarm if there is an emergency. If you are having a distributed attack launched from inside your firewall, than someone should get 400 alerts an hour to wake them up to that fact.

You were posting about a certain change in behavior in the attacks that evade simple detection based on repetition. There are other behaviors, like port and IP discovery that are just as easy to detect. Maybe I should have stated it this way from the onset. I'm not saying you should abandon your more thorough and comprehensive tools. I'm saying that very simple, layered techniques can be employed automatically to eliminate the low hanging fruit, so that your commercial tools can concentrate on the dedicated attacker.

---
P.S.
AFAIK, we are paying attention to the links.

Last edited by jschiwal; 12-19-2008 at 01:10 PM.
 
Old 12-26-2008, 11:42 AM   #21
alexhwest
Member
 
Registered: Dec 2008
Location: Cleveland, OH
Distribution: Ubuntu
Posts: 30

Rep: Reputation: 15
I know that distributed hits will not trigger listing tools, however, I thought I would mention a useful tool that is built right in to iptables. You do not need another tool to add to your allow or deny files. Just use iptables to do the job:

iptables -A INPUT -i eth0 -p tcp -m tcp --dport 22 -m state --state NEW -m recent
--update --seconds 60 --hitcount 4 --name SSHATTEMPTS --rsource -j DROP

iptables -A INPUT -i eth0 -p tcp -m tcp --dport 22 -m state --state NEW -m recent
--set --name SSHATTEMPTS --rsource

This will add any connections to port 22 to a list, and after 4 hits in 60 seconds, it will drop them. So alter to your wishes.
 
Old 12-26-2008, 02:50 PM   #22
unixfool
Member
 
Registered: May 2005
Location: Northern VA
Distribution: Slackware, Ubuntu, FreeBSD, OpenBSD, OS X
Posts: 782
Blog Entries: 8

Rep: Reputation: 158Reputation: 158
Yeah, this is similar to what I use with pf.

Code:
block in log quick from <bruteforce>
pass in log quick proto { tcp, udp } from any to any port ssh \
        flags S/SA keep state \
        (max-src-conn 15, max-src-conn-rate 5/3, \
        overload <bruteforce> flush global)

Last edited by unixfool; 12-26-2008 at 02:54 PM.
 
Old 12-28-2008, 10:26 AM   #23
Oxagast
Member
 
Registered: Aug 2003
Location: Mocksville, NC, USA
Distribution: Gentoo, Slackware.
Posts: 410

Rep: Reputation: 30
I've been getting a LOT of these in the past few months in my logs too. I assumed it was a botnet or something, because most of them are coming from valid websites, that I'm guessing were compromised. The thing that makes me think its a botnet is that it's usually almost exactly the same users and passwords they try each time. Won't get into any reasonably secure system that way, but some users will leave their username as their password, and if they have a common name..., and I've seen tons of boxes with the user "guest" and password "guest" or "test" and "test" or variations thereof.
 
Old 12-29-2008, 09:06 AM   #24
slimm609
Member
 
Registered: May 2007
Location: Chas, SC
Distribution: slackware, gentoo, fedora, LFS, sidewinder G2, solaris, FreeBSD, RHEL, SUSE, Backtrack
Posts: 430

Rep: Reputation: 67
if you are on DSL or a cable modem you will see them almost daily. Its not uncommon at all to get scanned like 10-15x a day from a cable modem.

With proper system security configurations you _should_ be fine and not lose sleep over it.

Last edited by slimm609; 12-29-2008 at 09:14 AM.
 
  


Reply



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
Securing /tmp. Script kiddie problem redir Linux - Security 5 12-13-2006 10:19 AM
Fatal weakness in Linux cov Linux - Software 71 07-05-2005 04:13 AM
Modem for win and lin, and kiddie proofing unholy Linux - Hardware 3 02-09-2004 05:07 PM
What would you say is the most basic Linux weakness wayloud Linux - Security 3 12-09-2003 04:15 AM
how to find the virus shierly Linux - Security 2 03-16-2001 12:28 AM

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

All times are GMT -5. The time now is 05:22 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