Distributed SSH brute-force assaults
Discussion
Anyone here running SSH servers spotted an increase in distributed brute-force assaults recently?
I usually get a few script kiddies a day running the usual dictionary attack on my server, I just watch the logs as they try loads of different usernames followed by 10 or so dictionary attempts at root, all from the same IP. If they're being a nuisance I may stop what I'm doing and launch a counterstrike on their IP
However the pattern appears to have changed. I'm now getting multiple *different* IP addresses all trying root only, and only a few tries per IP - there's no real target to attack back. Remote machines are from all over the shop - australia, russia, china, the UK, the USA, etc.
It's not a DDoS since there's no denial of service - my bandwidth isn't being overloaded and they will NOT guess my password (it's random, and I have quite a weird memory so can store crap like this).
Is that you Silent1 pissing about with a botnet?
I usually get a few script kiddies a day running the usual dictionary attack on my server, I just watch the logs as they try loads of different usernames followed by 10 or so dictionary attempts at root, all from the same IP. If they're being a nuisance I may stop what I'm doing and launch a counterstrike on their IP

However the pattern appears to have changed. I'm now getting multiple *different* IP addresses all trying root only, and only a few tries per IP - there's no real target to attack back. Remote machines are from all over the shop - australia, russia, china, the UK, the USA, etc.
It's not a DDoS since there's no denial of service - my bandwidth isn't being overloaded and they will NOT guess my password (it's random, and I have quite a weird memory so can store crap like this).
Is that you Silent1 pissing about with a botnet?

Yep, see these all of the time. A few customers of mine get this type of attack very frequently whilst others only get a couple per day. Unfortunately, the tools to do these types of attacks are much easier to use and anyone with a reasonable amount of Linux knowledge can run it. A couple of years ago and you really needed to know what you were doing and had to run all sorts of commands to prepare for it.
To be honest, I have been helping a couple of customers run through their logs and understand what is going on (IPS). Its quite amazing to run through what they see and block. Most recently I had my local council suffer a consolidated attack from Serbia and another customer had someone trying to break into their network. Its common and only going to get worse. The only problem is the time it takes, but never seen a successful one yet.....
To be honest, I have been helping a couple of customers run through their logs and understand what is going on (IPS). Its quite amazing to run through what they see and block. Most recently I had my local council suffer a consolidated attack from Serbia and another customer had someone trying to break into their network. Its common and only going to get worse. The only problem is the time it takes, but never seen a successful one yet.....
cyberface said:
However the pattern appears to have changed. I'm now getting multiple *different* IP addresses all trying root only, and only a few tries per IP - there's no real target to attack back. Remote machines are from all over the shop - australia, russia, china, the UK, the USA, etc.
Not seen this type, but see all the others you mentioned.JamieBeeston said:
Two words.
Hardware Firewall
If you've not got one, slap yourself, then get one!
J
I won't be rude enough to ask for free consultancy - I know this is your business - so if a good answer *would be*, then don't waste your time, just point me at some resources Hardware Firewall
If you've not got one, slap yourself, then get one!
J

But *I* want to be able to access my company's network (all behind a fixed IP) from any location. SSH is one of those methods, VPN is another. I may be connecting from my iPhone or from a MacBook and a Vodem, both of which may either be using any packet switched GSM service from GPRS up to HSDPA and have an IP address allocated by whichever network provider is supplying the phone / modem (i.e. Vodafone here, one of many abroad), or using WiFi in either public hotspots or via a Cloud account, again random IP address.
How would a hardware firewall make any difference here? (I have a NAT router which I've configured with a load of rulesets and port-forward settings, but it's probably not considered a 'firewall' by you pros - it's small business level kit)
I don't want to keep myself out, and to all intents and purposes I will appear to my network the same as all these script kiddies, except I have the key and they don't. I could blacklist any IP that appears in my logs, but since the 'try the door to see if it's open' prodding is coming from loads of different IPs, it would end up putting extra load on the router.
The attacks aren't a problem since you can't log into my network over SSH using the root login anyway
but they would be if the bandwidth consumed by bogus login attempts became significant.You could always run the ssh server on an unusual port, which might reduce the number of attempts. Port knocking might also be a good tool.
tank slapper said:
You could always run the ssh server on an unusual port, which might reduce the number of attempts. Port knocking might also be a good tool.
Yup.. this is one of the first things I do on a managed server.As for the questions above.
A decent Hardware firewall will stop bruteforce whilst leaving the port open to the world, it will monitor the connections, and too many connections in too short a time and it will ban the user.
You can also have the firewall updated in a similar manner to 'pop-before-smtp' whereby you visit a certain webpage, or check your email, and this updates the firewall with the new IP and you're allowed in..
Or you could leave one, secure and port changed box open, close the rest down and use this box to relay to the rest, meaning only one, hardend box it public facing for SSH..
there are many many options here.. allowing a 'strong password' to be your security just shouldnt be one of them.
J
JamieBeeston said:
tank slapper said:
You could always run the ssh server on an unusual port, which might reduce the number of attempts. Port knocking might also be a good tool.
Yup.. this is one of the first things I do on a managed server.As for the questions above.
A decent Hardware firewall will stop bruteforce whilst leaving the port open to the world, it will monitor the connections, and too many connections in too short a time and it will ban the user.
You can also have the firewall updated in a similar manner to 'pop-before-smtp' whereby you visit a certain webpage, or check your email, and this updates the firewall with the new IP and you're allowed in..
Or you could leave one, secure and port changed box open, close the rest down and use this box to relay to the rest, meaning only one, hardend box it public facing for SSH..
there are many many options here.. allowing a 'strong password' to be your security just shouldnt be one of them.
J
The reason for the OP was that I was detecting distributed SSH root password attempts. Most script kiddies so far have tried a bruteforce from one machine, leaving them vulnerable both to your suggestion of blocking any IP that tries too many connections within a certain amount of time (my router does this, also to defeat port scan attempts), and also spending long enough knocking at my door for me to notice and launch 'offensive security' (some of these machines are zombies with well established security holes which can be taken down, some are kids with Linux boxes messing about, and generally leave you alone if you fill up their logs with warnings). However if you distribute the SSH door 'knocks' across loads of different IPs, then that particular methodology isn't going to work! This was the whole point of my post... I can't believe the kiddies now have control of botnets... it will be a sad day when someone with hardly any hacking skills can compromise enough machines to control a decent-sized botnet to annoy people with.
Problem with moving the SSH port is that it's security by obscurity - nmap my machine with super-slow scan and leave it running for a couple of days (to defeat the 'too many connections from same IP' IDS stuff) and you'll find it eventually.
Everything is backed up and all business critical data is encrypted.
Please don't think I'm being complacent Jamie - I'm not and I sure as hell don't think that I'm 100% secure - no system is that actually can perform server jobs (you have to let *some* people in!) - don't get me wrong. I'm also not in the ISP business and probably don't know half of your knowledge, but when it comes to hacking / cracking / etc. I'm not exactly clueless, so give me a *tiny* bit of credit....

cyberface said:
Problem with moving the SSH port is that it's security by obscurity - nmap my machine with super-slow scan and leave it running for a couple of days (to defeat the 'too many connections from same IP' IDS stuff) and you'll find it eventually.
Everything is backed up and all business critical data is encrypted.
Everything is backed up and all business critical data is encrypted.
but just because it rhymes doesn't mean it's not a valid practise 
Like anything, make it the only string in your bow and it'll soon snap.. but use it in conjunction with a few of the others and you're much safer.
Remember, we're not talking about stopping a hacker determined on getting you here.. we're talking about stopping a speculative portscan...
Anyone determined will always find a way in, be it logical, physical, emotional or mental!
J
JamieBeeston said:
cyberface said:
Problem with moving the SSH port is that it's security by obscurity - nmap my machine with super-slow scan and leave it running for a couple of days (to defeat the 'too many connections from same IP' IDS stuff) and you'll find it eventually.
Everything is backed up and all business critical data is encrypted.
Everything is backed up and all business critical data is encrypted.
but just because it rhymes doesn't mean it's not a valid practise 
Like anything, make it the only string in your bow and it'll soon snap.. but use it in conjunction with a few of the others and you're much safer.
Remember, we're not talking about stopping a hacker determined on getting you here.. we're talking about stopping a speculative portscan...
Anyone determined will always find a way in, be it logical, physical, emotional or mental!
J
But yeah, avoiding kiddies and the vandals who think they are the network equivalent of graffiti 'artists' tagging peoples' servers is the main priority for your clients, and every little helps. I found out recently that the relatively simple task of using Multi NAT with a couple of servers running different OSes and switching a few port forwards makes what would be a relatively simple enumeration exercise *really* confusing - it's security by obscurity as the ports are still open on both machines, but for the hacker you're looking at a couple of IP addresses that appear to be serving identical services on a couple of ports but 'feel' different in other ways... and raising a bit of confusion in the attacker's mind is always good 
As you say, a good hacker will always get in, and in large organisations it's nearly always the last two
Good old social engineering attacks. With the social engineering attacks for my network meaning you'll have to get *me* and me alone to divulge my passwords, I'm mostly concerned with stopping the half-decent hackers.The kiddies I will easily defeat, unless they pay someone for a botnet big enough to DDoS my meagre network connection (and then I'd try to use something else whilst dealing with my ISP to try to identify and kill the traffic before it hits me). The elite will probably be able to get in. What I'm concerned about it being able to prevent the half-decent hacker... it keeps me on my toes and means I need to know the same skills / techniques, always good fun

ssh root@<server>
password: <correct password>
Invalid Username or password.
Call me grumpy, call me cynical, tell me I'm not a happy go lucky altruistic geekette... but all of my machines are set to disallow root to appear directly.
Ohh... and try that mass logon shit? It'll IP ban you via iptables. Forever.
That does not, however stop the little turds for trying. I think the only thing that would is a plane ticket/lift to site and a 12 gauge to the box.... possibly the user as well.
password: <correct password>
Invalid Username or password.
Call me grumpy, call me cynical, tell me I'm not a happy go lucky altruistic geekette... but all of my machines are set to disallow root to appear directly.
Ohh... and try that mass logon shit? It'll IP ban you via iptables. Forever.
That does not, however stop the little turds for trying. I think the only thing that would is a plane ticket/lift to site and a 12 gauge to the box.... possibly the user as well.
I've seen this, i would guess it's done by somthing simular to a botnet on IRC that people use to always SYNflood wioth as they can be updated within an hour and can go from 100bots to 10,000 in around 24hours. also these can be configured to use proxy's and scan mass IP ranges. Having ran IRC servers for over 5 years i had to cope woth plenty of DDOS attacks and therefore on one occasion had to give someone a taste of their own medison (for a week!) and i've seen a screenshot of an old friends botnet that took down bigbrother onlince (the first on) had around 240,000 bots.. madness!
take a look at this, it seems a nice guide to securing SSH from brute force attacks
http://www.la-samhna.de/library/brutessh.html
Liam
take a look at this, it seems a nice guide to securing SSH from brute force attacks
http://www.la-samhna.de/library/brutessh.html
Liam
shocker-z said:
I've seen this, i would guess it's done by somthing simular to a botnet on IRC that people use to always SYNflood wioth as they can be updated within an hour and can go from 100bots to 10,000 in around 24hours. also these can be configured to use proxy's and scan mass IP ranges. Having ran IRC servers for over 5 years i had to cope woth plenty of DDOS attacks and therefore on one occasion had to give someone a taste of their own medison (for a week!) and i've seen a screenshot of an old friends botnet that took down bigbrother onlince (the first on) had around 240,000 bots.. madness!
take a look at this, it seems a nice guide to securing SSH from brute force attacks
http://www.la-samhna.de/library/brutessh.html
Liam
That's a useful resource... as I pointed out SSH is configured to disallow login as root; however it doesn't say so, it still asks for password and merely returns 'invalid password'. I've also configured my box to delay return authentication for the 6th attempt at incorrectly logging in... so dictionary attacks are slowed down considerably. This sounds like the iptables ruleset in that linked tutorial - it's built into OS X anyway (except that 3 successful logins doesn't trigger the same behaviour)...take a look at this, it seems a nice guide to securing SSH from brute force attacks
http://www.la-samhna.de/library/brutessh.html
Liam
Knockd sounds cool (rather like secret combinations of 'knock three times followed by two' to get access
and sounds very sekrit squirrel, but my whole scenario is connecting securely to my core network (which *is* reasonably secure IMO) from really random and insecure environments. I'm talking Wifi clotspots, public and Cloud, Vodem HSDPA stuff, basically mobile radio internet where I assume (with palladium-lined, scandium-edged tin-foil hat firmly wedged over my skull) all transmissions are being monitored and all packets are being collected for later analysis by supercomputers. Or just the t
t at the back of Starbucks with an iPhone or a Zaurus SL5000D, a Prism2 card and some h4x0r tools. For wireless networks, it adds an extra layer of obscurity, but once you know about it and can look for the signature, then wireshark / ethereal is your friend.Anyway this has drifted WELL off topic. I was originally pointing out that I only ever saw kiddies trying dictionary attacks from the same IP, easily blacklisted, easily ignored, all trying various random usernames (fun checking which language wordlist they were using for the users....). I assumed all these guys were complete noobs with Linux pretending they were hackers. Now the sshd-prods seem to originate from different servers from everywhere, someone is using a botnet. And this is a change - if the kiddies can now use botnets then we have a problem. If this is actually the skilled / pros / criminal gangs just keeping their botnets in order to collect data for future use, then
knows what their plans are. May be worth collecting the IPs regardless - nobody should be SSHing into my server except me, and anyone else is effectively an intruder and may be part of a larger network.And, of course, any bot zombie will be controllable by the master somehow... reverse engineer that API and you've got control - or at least the ability to crash the zombie at will
May have to do that sort of shit from a DHCP IP from a broadband modem or something, some of these botnets are owned by serious organised crime.... 
tank slapper said:
Botnets are going to become a massive problem in the future I think. I was reading about this earlier, which doesn't bode well.
The thing that gets me is the article cites various experts confirming something I've long suspected. For the most part, home users are not the problem. There is far more 'fire power' available from compromising, say, IBM's EMEA network (which is a largely undefended mess monitored by the useless and used by the dumb) than there is in all the Virgin Media customers in the UK on 20Mbit/s links. Indeed, when I did bother to poke around the SSH attacks my remote server was having, I traced them back to Venezuela; but not, as Cyberface found in his case, a Cybercafe... but a CoLo facility, big corporate bandwidth in other words.
It would not surprise me to learn that home user machines are simply caught in the cross-fire these days (they just happen to be susceptible to the same cruft a Windows machine inside corporate land is) and that botnet owners consider them utterly useless due to being unreliable.
TheLearner said:
tank slapper said:
Botnets are going to become a massive problem in the future I think. I was reading about this earlier, which doesn't bode well.
The thing that gets me is the article cites various experts confirming something I've long suspected. For the most part, home users are not the problem. There is far more 'fire power' available from compromising, say, IBM's EMEA network (which is a largely undefended mess monitored by the useless and used by the dumb) than there is in all the Virgin Media customers in the UK on 20Mbit/s links. Indeed, when I did bother to poke around the SSH attacks my remote server was having, I traced them back to Venezuela; but not, as Cyberface found in his case, a Cybercafe... but a CoLo facility, big corporate bandwidth in other words.
It would not surprise me to learn that home user machines are simply caught in the cross-fire these days (they just happen to be susceptible to the same cruft a Windows machine inside corporate land is) and that botnet owners consider them utterly useless due to being unreliable.

Of course, if I get a virtual server from a co-lo facility as a private individual or small company, and then run a bunch of hacking tools off it using the nice fat bandwidth offered, then that's my business (and probably breaks my terms and conditions with the co-lo company) - if this is what you've seen Sarah then it's probably some drunk idiot having a play with the company hosted server. No way would a customer last long playing this sort of game with one of Jamie's boxes, no doubt, but maybe a Venezuelan hosting facility would be more lax. But it's a business to them, and reports of abuse do their business no favours.
What *would* be a problem is if it were possible to compromise *all* of a co-lo's boxes (say all their windows boxes, or all their Linux boxes) due to a day-zero exploit and then use all of them as a botnet. One box playing silly buggers (like the cybercafe in Venezuela I found) isn't going to kill you. But, again, there are people at co-los whose job is to ensure this shit doesn't happen. And the co-los who are responsible for a high-profile DDoS will go out of business.
IBM - that's frankly more frightening. My experience with large corporate networks (even those maintained by IBM under outsource) is with City firms and the 'large corporate bandwidth' is largely internal and web servers outsourced. In most cases it'd be trivial to botnet the entire firm's desktop installed base and attack any internal target, but all packets destined for the internet go through proxy servers in 99% of cases I've seen. Any non-standard packet (ICMP reflectors, for example) get binned straight away, and only HTTP requests are typically let through. I suppose you could try to DDoS someone like this but the proxy server should rate-limit the requests anyway, and it'd appear to the target as if most of the packets were coming from one IP - so easy to block at the ISP level.
If large corporate IT entities like IBM are as open to the internet as you claim.... and have as much bandwidth as you say... then I'm surprised they haven't been 'done' already. Remember though if there is any web proxying going on, or if they have any sort of firewall to limit the type of packets that can be sent in and out, then there's only so much a cracker would be able to do. As to whether the network is administered by muppets.... well I know you've worked for IBM but I'd still claim that the people who look after the front-line interface between the corporate network and the internet wild-west know their shit. The business risk (legal and reputational) of 'IBM DDoSing Oracle' or something like that is so utterly enormous that you have to hire knowledgeable network security people to secure that big fat corporate bandwidth. And at least regularly get some proper whitehats to test this for you from the outside.
The thing about home Windows boxes on ADSL USB 'modems' is that once you've cracked one, you have the ability to send
ed up TCP/IP packets about which is a lot more damaging than harnessing a load of corporate PCs to keep requesting web pages. I've never seen a bank network which would allow you to SSH out on to the wild-west of the internet, let alone let you send out a malformed packet or a reflector (which creatively takes the piss by sending a duff packet with a forged originating address... the receiving machine (with more bandwidth) sends the 'bad packet' response 'back' to the forged originating address, which is your target).There are various commentators calling for the removal of raw socket APIs from consumer operating systems for this very reason.
The reason for the OP was that it 'looked' like kiddies have control of botnets now. My hunch now is that isn't the case whatsoever. My gut feeling is that botnets are going to become harder and harder to control - for two reasons - firstly that it's harder to exploit a system in the first place (with the all-incoming-ports-open Windows USB ADSL modems largely being replaced by NAT routing 802.11 routers these days for consumer kit, and more malware meaning more people using anti-virus and network-monitoring 'internet defence' tools), and secondly because they are valuable resources to organised crime and there is literally trade in these networks. The kiddies aren't going to exploit enough machines and create a big network without being noticed (because they'll do something silly to show off with it) and then having it stolen from them by the big boys.
Interestingly, the usual attacks have reverted to single-IP dictionary searches for now. Seemed to be a one-off.... perhaps a botnet owner was testing something....
Listen to Jamie - he knows what he is talking about.....
On the question of firewalls though, please do no underestimate the additional security that one will provide above that of a router / modem configured with a simple firewall. One quick note though, we are talking about some additional percentage points of security getting towards 100%, but you will never achieve 100% as this is just not possible. But a good quality router with a firewall configured (and I mean a business solution, not some cheapy PCWorld special) will cover up to say 90% of security. A good quality firewall will add additional 5% or so on top. The more security that you want, the more expensive it becomes, but as is the case as you push towards the 99% security at least. Not everyone needs high security, but its worth being aware of what you need and want before you start spanking money.
Its all about risk and understanding that if you want 100% security for your internet connection, the only answer is to be not connected - which pretty much defeats the objective! So anything that you do will be a risk, but its a case of figuring out what risk is involved and if you really need to do it. Then you can look to sort out the relevant security systems to add the layers of protection that you need.
On the point of firewalls though, what you need is something that has the power and ability to keep track of connections and understand the state that they are in. This is what a stateful firewall does and ensures that the traffic it lets through is valid and appropriate for the connection. A simple router firewall (even if they say stateful, they rarely are) will simply match the traffic to the rule you have configured and you are through - in either direction. A proper stateful firewall doesn't need to have bi-directional rules for example, if the traffic is allowed through one way, only the correct traffic responding to this will come back. Its a simple thing, but makes a massive difference. With a stateful firewall you have a much more sophisticated rulebase and they are processed in sequence. That way you can setup what you want and when you want it. Also, using a firewall from a leading supplier will be more secure than a router - its about the business and what they have to loose! We are seeing a change in the characteristics of attackers these days. For example, they are targeting vendors router vendors as they are typically not as well configured as a firewall and they do not have the same level of functionality.
What do I recommend? Get a decent firewall. They are not expensive and depending on what you want, you can spend from £500 to £1500 for a small business solution. Some are easier than others, but there are solutions to address pretty much anything that you want. For example, I work for a vendor who sells firewalls and our solutions are a little higher on the cost scales, but what we provide is the ability to load balance multiple ISP's - so why not have 2 x 8Mbps ADSL connections and load balance (inbound and outbound) both a the same time. Its a cracking product but no everyone needs it. However, underneath the features its still a damn fine firewall and some of my customers would not be using anything else, especially since the business and reputation depends on it.....
Other vendors are also available
On the question of firewalls though, please do no underestimate the additional security that one will provide above that of a router / modem configured with a simple firewall. One quick note though, we are talking about some additional percentage points of security getting towards 100%, but you will never achieve 100% as this is just not possible. But a good quality router with a firewall configured (and I mean a business solution, not some cheapy PCWorld special) will cover up to say 90% of security. A good quality firewall will add additional 5% or so on top. The more security that you want, the more expensive it becomes, but as is the case as you push towards the 99% security at least. Not everyone needs high security, but its worth being aware of what you need and want before you start spanking money.
Its all about risk and understanding that if you want 100% security for your internet connection, the only answer is to be not connected - which pretty much defeats the objective! So anything that you do will be a risk, but its a case of figuring out what risk is involved and if you really need to do it. Then you can look to sort out the relevant security systems to add the layers of protection that you need.
On the point of firewalls though, what you need is something that has the power and ability to keep track of connections and understand the state that they are in. This is what a stateful firewall does and ensures that the traffic it lets through is valid and appropriate for the connection. A simple router firewall (even if they say stateful, they rarely are) will simply match the traffic to the rule you have configured and you are through - in either direction. A proper stateful firewall doesn't need to have bi-directional rules for example, if the traffic is allowed through one way, only the correct traffic responding to this will come back. Its a simple thing, but makes a massive difference. With a stateful firewall you have a much more sophisticated rulebase and they are processed in sequence. That way you can setup what you want and when you want it. Also, using a firewall from a leading supplier will be more secure than a router - its about the business and what they have to loose! We are seeing a change in the characteristics of attackers these days. For example, they are targeting vendors router vendors as they are typically not as well configured as a firewall and they do not have the same level of functionality.
What do I recommend? Get a decent firewall. They are not expensive and depending on what you want, you can spend from £500 to £1500 for a small business solution. Some are easier than others, but there are solutions to address pretty much anything that you want. For example, I work for a vendor who sells firewalls and our solutions are a little higher on the cost scales, but what we provide is the ability to load balance multiple ISP's - so why not have 2 x 8Mbps ADSL connections and load balance (inbound and outbound) both a the same time. Its a cracking product but no everyone needs it. However, underneath the features its still a damn fine firewall and some of my customers would not be using anything else, especially since the business and reputation depends on it.....
Other vendors are also available
Gassing Station | Computers, Gadgets & Stuff | Top of Page | What's New | My Stuff





