The Hail Mary Cloud and the Lessons Learned 99
badger.foo writes "Against ridiculous odds and even after gaining some media focus, the botnet dubbed The Hail Mary Cloud apparently succeeded in staying under the radar and kept compromising Linux machines for several years. This article sums up the known facts about the botnet and suggests some practical measures to keep your servers safe."
Re: (Score:2)
Not quite. It's retarded admins that use password authentication on public facing SSH services. I have had a public facing SSH server for over 5 years now and it ONLY permits key-based authentication. I have NEVER had an unauthorized login. But them I'm an unpublished no-name IT guy who only follows those "best practices" that the so-called experts keep railing on about but don't seem to follow themselves.
I am certain you can also have a secure Windows server that has a public facing connection on the inter
Re: (Score:3)
Re: (Score:1)
Debian 6.
Re: (Score:3)
Actually, not permitting root logins via SSH was one of the points he repeated several times. He also said, explicitly, "There's no safety in high port numbers anymore.". Perhaps he's wrong, but he did consider your point.
Personally, I don't feel very exposed, so I'm not willing to do much more than that, plus picking a secure password. I may have set things up so that no SSH logins are possible in any way, but I'd need to check again to find out. (I'm not much of an administrator, and my system isn't i
Re:Nothing you can do? (Score:4, Interesting)
Not to mention several routers use admin and support ssh connections.
Router software virtually never gets updated.
Re: (Score:2)
Re: (Score:2)
not permitting direct login as root at all is a good idea - it what su was invented for (amongst other things)
Acually, on a new Freebsd install, out of the box, ssh to root was not permitted nor was su to root.
So on new installs, you have to pick your poison before you walk away from the console.
The rationale for not allowing su to root is because an attacker who (by what ever means) logs into some random account has a dramatically more advantageous position than one banging on the doors of ssh. That being said, unless you have convenient access to the console you are going to
have to choose ssh or su or something
Re: (Score:1)
This is one reason why people recommend sudo instead of su. The admin logs in as himself and gains root privilege using his personal password. There is no shared root password, so you only have to disable the old admin's account and sudo access. The root password can be set to something very unique/random and perhaps entered into a physical logbook that is kept under lock and key by the management, or just obliterated if you know you can recover systems through local physical access regardless of password
Re: (Score:2)
This is one reason why people recommend sudo instead of su. The admin logs in as himself and gains root privilege using his personal password. There is no shared root password, so you only have to disable the old admin's account and sudo access.
The problem with sudo is that often the complexity of setting it up is time consuming when you have a fleet of admins for a large network, or even a small network with more than a couple admins. Not only do you have to kill the departing admin's account, you have to review the sudoers to make sure no other accounts crept in there as a root equivalent. Some middle management account it unlikely to ever discover they have sudo capability, so someone could simply add that account to sudoers as a root equivale
Re: (Score:2)
Re: (Score:1)
This is one reason why people recommend sudo instead of su. The admin logs in as himself and gains root privilege using his personal password. There is no shared root password, so you only have to disable the old admin's account and sudo access.
They recommend it as safer in theory.
In practice sudo is source of jokes like:
Q: H0w d0 I h4ck ubuntu?
A:
user
user
sudo
user
Re: (Score:2)
Re: (Score:2)
Sorry i meant to say only allow su to root only from the physical console
I didn't even know it was possible to limit su to a specific terminal. I suppose with SELinux it would be, or via pam.
Re: (Score:2)
Sorry i meant to say only allow su to root only from the physical console
I didn't even know it was possible to limit su to a specific terminal. I suppose with SELinux it would be, or via pam.
I'm sure with SELinux you could permit su access only from the console (yours or the remote NSA one).
Re: (Score:1)
the reason for seeing so many admin attempts is all those god damn cheap routers that have admin/pw setups by default.
Re: (Score:1)
Yeah, that's a great idea if you're a) a hosting provider or b) a security researcher. Ignore the problem and prevent your users from easily reaching their hosts.
You cracked the fucking case, Murder She Wrote's Angela Lansbury.
Re:Nothing you can do? (Score:5, Insightful)
I think this article points to the fact the author is retarded.
Considering the retarded author in question is someone who is a respected author on OpenBSD ''pf'', firewalls and security in general, I think your answer prove you are the retarded one.
Re: (Score:1)
It's not just banal, it's insulting and contradictory. He takes time out of his busy writing schedule to pan port-knocking, says he could tell you how to do it easily but won't, and falsely equates it to just adding bits of complexity, when it in fact adds a time domain as well.
My favorite part is when he says:
There's nothing magical about TCP/UDP ports. It's a 16 bit number, and in our context, it's just another alphabet.
Like iterating over 16 bits multiplied by the password database is trivially fast. This is some real ivory tower shit, but I guess that's to be expected when you are hyping the botnet equivalent of
Re: (Score:2)
Re:NOT-Nothing you can do? (Score:3)
He actually mentions port knocking, but I think he mis-understands it. He makes a mathematical argument, without addressing the fact that the sequence of ports can be as long as you want. He seems to think port knocking is used to grant access, when most of the users I know who use it do so only to start sshd so that they can then log in via secure means.
But having to log in from a multitude of places is pretty common. Less common these days than in the past is having to log in from some random machine.
Re: (Score:3)
Re: (Score:3)
That won't help if tomorrow someone finds a vulnerability in the openssh server that enables to bypass that (maybe something like this one from 2011 [exploit-db.com]). And that someone instead of announcing it worldwide (i.e. the NSA) start to use it to deploy their own backdoors in your server. Not having access to the service in the first place will avoid potential future exploits on it. Of course, could be exploits for the portknocker daemon, but as is simpler than the sshd (or any other service you have published that i
yep, PermitRootLogin without-password (Score:2)
Yeah we always don't allow root login with a password, only with a key. In sshd config:
PermitRootLogin without-password
I wish the argument were named differently. I think some people have been scared that would allow roologin with no authentication . "require-secure-key" would more accurately describe what it does.
Re: (Score:2)
true, but they brute "root", not "jeleay" (Score:2)
You don't see the bots trying a million passwords with user "jeleay", they are trying "root", so not allowing root via password is significant.
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Problem with that is you cannot trust users to secure their keys any more than you can trust them to choose good passwords. Once you give them a keyfile they can change the password to whatever they want, or leave it naked.
Really if you want to excercise hard security, it should be both password and key. No, not password protected key, password stored on the remote host and require a key. What's truly retarded is the failure of most people including crypto software developers to see the use case for this,
Denyhosts (Score:5, Informative)
Re:Denyhosts (Score:5, Informative)
Another useful software for auto-banning bad accesses is fail2ban [fail2ban.org] which can also handle other services, like exim, vsftp, apache, etc.
Re:Denyhosts (Score:4, Informative)
I second that: DenyHosts is now mandatory on all the Linux servers I manage, and allows one to protect servers against that type of attacks with minimal effort.
Please note that the author did not mention Denyhosts since his servers run OpenBSD, which incorporates DenyHosts functionality through ''pf'', its packet filter/firewall software (see the brute-force configuration of pf for more details).
iptables -m limit (Score:2)
You can do the same with iptables on Linux using the module "limit". See the manual page for "iptables-extensions" for the details. DenyHosts may have it's good points, but mostly it just complicates things. There is already a lot of functionality in the packet filte
Re: (Score:2)
Even before fail2ban came along, it occured to me to code up something roughly equivalent to it. It was a rather sad looking shell script but it did the job. This is something so un-new that there are pre-packaged workarounds for it now.
Re: (Score:2)
(i think the default is 5 failed attempts in 20 minutes)
Ubuntu server 10.04 LTS from April, 2010 has this default:
AGE_RESET_VALID=5d
So 7200 minutes, not 20, in the case of my unmodified defaults.
So I think you're wrong about staying below the threshold of denyhosts. I've collected about 2400 IP addresses in /etc/hosts.deny since 2010. I suspect all of us that pay attention to log files and set up denyhosts back then have collected approximately the same set of 2400. Incidentally, about 50% of those IPs are Chinese, the last time I looked.
As for the article I
Re:Denyhosts (Score:5, Informative)
If you like DenyHosts - look at fail2ban. It has all the functionality of the older DenyHosts project and more. You can ban based on more than failed ssh logins - but any type of logfile imaginable. With customized responses to X login failures per Y time units for Z service. You'll find it in the repo's for all debian/rhel based distributions.
Re: (Score:2)
Low intensity ssh brute-forcing. (Score:5, Insightful)
This is about the low-intensity password brute-forcing via ssh that's been going on for years -- the only difference between this and any other password brute-forcing via ssh is that fail2ban and such scripts are ineffective, because the attempts are so low-frequency that it's practically impossible to distinguish them from users fumbling their passwords.
The simple solution is to disable password authentication for all users, and make them use keys -- this renders you 100% safe from this botnet. If that's infeasible, be damn sure you've disabled password authentication for root (i.e. "PermitRootLogin no" or "PermitRootLogin without-password" if you still want key-based root logins). If you do allow password logins for any or all users, enforce strong password requirements.
Re: (Score:2)
you still have a login name, just using a cert instead of a password.
Re: (Score:1)
low-intensity bruteforcing is not dangerous - therefore it does not matter that fail2ban doesn't help. Basically, all fail2ban does is turning a fast bruteforce attack into a low-intensity one anyway.
Tricky passwords is enough - they can't guess them in a lifetime with a low-intensity attack. Do not force people to change passwords (except if there ever is a security breach), that makes it much easier for them to put up with really long passwords. And if you live in a part of the world where your keyboard h
Re:Low intensity ssh brute-forcing. (Score:5, Interesting)
low-intensity bruteforcing is not dangerous - therefore it does not matter that fail2ban doesn't help. Basically, all fail2ban does is turning a fast bruteforce attack into a low-intensity one anyway.
Yes, of course -- what's dangerous is not the low intensity attack itself, but that they command enough bots to make low-intensity attacks have a reasonable chance of success against lousy passwords. And that's only dangerous in combination with the fact that you're permitting users to have lousy passwords.
Tricky passwords is enough - they can't guess them in a lifetime with a low-intensity attack.
Amen, brother. That's absolutely enough -- if you enforce it.
The main reason I suggested key-based auth first is because some fools' idea of "make sure users use strong passwords" is to force users to change their passwords frequently, and tell them to use strong passwords (e.g. not derived from a single english word), and maybe enforce silly requirements such as "must have at least one letter and one numeral"; this inevitably results in "password1" the first month, "password2" the next month, and so on.
Re: (Score:2)
Re: (Score:2)
why did he not say "Linux, BSD, and Other OSes
Maybe because the default setting in BSD [freebsd.org] is
PasswordAuthentication = no
and
PermitRootLogin = no
Could that be why he didn't mention the botnet logging into to lots of BSD boxes with password authentication?
Re: (Score:2)
No. No it could not. The first reason is because it is disingenuous to imply that the Hail Mary Cloud is succeeding in breaking into "lots" of Linux boxes. It is also the default on every decent Linux distribution out there that root logins via ssh are not allowed. Also, as you said, it is the default setting. Perhaps you were unaware of the word default and what it means, because the last ti
Re: (Score:2)
This is really one of those literal RTFM situations...
Notice I was talking about password authentication?
As noted above, PasswordAuthentication defaults to no on FreeBSD.
How about some popular Linux flavors?
Ubuntu? Debian? Fedora?
Those are the top 3 in usage, right? So I checked those and guess what?
PasswordAuthentication defaults to yes.
So yeah, could that be why he didn't mention the botnet logging into to lots of BSD boxes with password authentication?
Correct me if I'm wrong..
Perhaps you could bother to read the whole comment yo
Re: (Score:2)
No. It's really more of a "You're a troll who is misrepresenting the facts" situations. I did read what you wrote, and as I said: No!.
Who cares what PasswordAuthentication defaults to, when PermitRootLogin is no? The chances that they will brute force a root account password with "PermitRootLogin no" is just as equal to zero. Furthermore, with PermitRootLogin yes the chances are also zero if a strong passwor
Re: (Score:2)
You're totally off topic. If anyone is a troll, it's you. Sadly, it appears you're just an idiot who spouts off without even knowing the basics of what is being discussed.
The botnet being discussed tries to login with a series of usernames over time with each member of the botnet attempting to guess a different password for each username in the series.
So PermitRootLogin is irrelevant to defending against it, other than presumably it might eventually try root among all the other usernames it's attempting.
Hav
Re: (Score:2)
Re: (Score:2)
Now that you've changed your tune, it's obvious you realize you were wrong all along. Of course, with your posting history on other things, that's not much of a shocker, is it? You have a lot of these "misunderstandings".
The botnet doesn't need a privileged user. It can generally use the machine's resources for whatever it desires, including making outgoing connections to compromise more hosts, with just a non-privileged user.
Re: (Score:2)
Re: (Score:2)
I'm just posting to say I haven't seen:
>... Plonk.
For years. As in 15, at least. Wow.
Note that this is judgement-neutral, I'm just saying 'hi' to once-familiar term, this is judgement-neutral!
Re: (Score:1)
I sure as hell... I mean, ordinary users, not I of course, but normal users certainly DO fsck up my seldom-used passwords... I mean their seldom... DAMMIT!
Re: (Score:1)
(...) fail2ban and such scripts are ineffective, because the attempts are so low-frequency that it's practically impossible to distinguish them from users fumbling their passwords.
I'm sorry but that's just nonsense. Ordinary users don't often fsck up their login 3 or 4 times in a row. The boxes in the HM cloud will and so the operators will fairly quickly run out of usable host for their brute force attack. How's that ineffective?
OK, in fairness, "practically impossible" was way too strong a wording -- calling it "nonsense" is exactly right. What I should have said is that the commonly deployed algorithms can't be made to reliably distinguish them by simply tweaking the parameters (time to remember, and allowed number of fails in that time). Better algorithms absolutely could block these, eventually, with no risk of bothering legitimate users. Specifically: distinguish between legitimate usernames (or conceivably-fumbled usernames)
Re: (Score:2)
Funny quote from article (Score:2)
"I'm not really in a mind to offer help or advice to the people running those scripts, but it might be possible to scan the internet from 255.255.255.255 downwards next time."
Yes, start with all the multicast addresses. That'll work for them! ;)
Executive summary (Score:5, Informative)
"I've managed to get my name on slashdot a lot"
"Use key auth instead of passwords"
"My references are my own blog posts"
There's nothing interesting to see here. Don't allow password logins to your system, because you can't trust people to use good passwords. It's 2013, there's no cake for pointing this out.
Re: (Score:2)
simple fix (Score:2)
STOP USING PASSWORDS FOR AUTHENTICATION! why not only allow connections in authorized_keys??? if you feel so inclined, add a password on top of the authorized key.
there is only so much programmers can do to make it user friendly and secure.
Re: (Score:2)
Agree to simple fix, but this is OLD (Score:2)
Ow please.. This is so old.. haven't allowed pasword logins in the last decade or so..
Why on earth would anyone have allowed password logins for the last 10 years? Or: Ever?
Someone that's savvy enough to get a shell account is savvy enough to use a key pair.
It's 2013. I mean, seriously, PASSWORDS? for SSH?? You must be joking.
-f
Re: (Score:2)
Keys are good for security, but random passwords of 8 characters (and even less) are totally safe against online brute force attacks. Passwords are frequently needed when new systems are installed. After all, you can't go moving keys around on an USB stick every time a new host is set up.. Using passphrases on the SSH keys is fine, but if we neglect the security of the keys themselves, it turns an online attack into an offline attack: the keys are much easier to brute force, and it can be distributed
This is not a new game (Score:3)
Pick a host from our pool, assign a user name and password (picked from a list, dictionary or pool)
Implies that each host will, from a predefined directive, try certain user names. I have seen ones better coordinated than that, where they are going through the list alphabetically across a large number of systems. To me this implies a tighter degree of central control on the attack.
...). Any sane admin has root disabled for ssh access, in particular, so the number of attempts they make on that is irrelevant; and the rest shouldn't be allowed much of anything, ever.
That said, the list of users that they try are almost always first names only, aside from the usual collection of system names (root, toor, admin, oracle, games
At any rate, my point remains: this is an old game they've been doing. Interesting that we now have assigned a name to the botnet but otherwise not really news. It would be interesting to know more about the systems that are part of it, but they mostly come from the usual collection of countries and hence your likelihood of getting useful information on them is pretty well zero.
Some more guidance on setting up SSH (Score:2, Informative)
Here is the guide we provide to the SSH users at our University: https://it.wiki.usu.edu/ssh_description [usu.edu]
Some of the major points: