Slashdot Mirror


New Linux Rootkit Emerges

Trailrunner7 writes "A new Linux rootkit has emerged and researchers who have analyzed its code and operation say that the malware appears to be a custom-written tool designed to inject iframes into Web sites and drive traffic to malicious sites for drive-by download attacks. The rootkit is designed specifically for 64-bit Linux systems, and while it has some interesting features, it does not appear to be the work of a high-level programmer or be meant for use in targeted attacks. The Linux rootkit does not appear to be a modified version of any known piece of malware and it first came to light last week when someone posted a quick description and analysis of it on the Full Disclosure mailing list. That poster said his site had been targeted by the malware and some of his customers had been redirected to malicious sites."

30 of 172 comments (clear)

  1. Infection method? by Gaygirlie · · Score: 5, Insightful

    How come neither of the links actually describe how this malware infects the machine in the first place? I'd say that's quite an important piece of information completely missing.

    1. Re:Infection method? by hawguy · · Score: 2, Informative

      How come neither of the links actually describe how this malware infects the machine in the first place? I'd say that's quite an important piece of information completely missing.

      I don't think it's self-replicating or installing itself by some vulnerability, I believe it would have to be installed maliciously (perhaps by an employee, or maybe by someone using an unrelated root exploit), or as a Trojan Horse - many people are happy to blindly install unsigned packages on their system, running the installation as root.

      Back in the day, I used to make at least a cursory inspection of the Makefile and sometimes would even look over the source code associated with distributed packages. But now I just install the package without even paying attention to what files are being installed. I am a little careful about where I download my packages from, and almost always installed signed packages by a trusted distributor, but I do install packages from unknown developers from time to time.

    2. Re:Infection method? by hobarrera · · Score: 2

      Indeed. All it says is thay you're redirected to an iframe. How it breaks out of the browser's sandbox and then obtains root priviledges isn't mentioned either. I'm quite interested in how they achieved this too, since it would mean that there's a huge priviledge escalation in linux that nobody noticed.

    3. Re:Infection method? by sl4shd0rk · · Score: 2

      Looks like an infected kernel module so one of the below:
          1) server was cracked, and module compiled
          2) compromised kernel mod in distro

      more likely #1 but probably too early to tell. Grepping kernel sources for some of the text in the module_init binary may be fun:
      http://seclists.org/fulldisclosure/2012/Nov/94

      --
      Join the Slashcott! Feb 10 thru Feb 17!
    4. Re:Infection method? by tyleroar · · Score: 3, Informative

      I think you are confused as to what this is doing. How the malware initially got loaded onto the *NIX box is not discussed in the write-up. The malware does not break out of the browser's sandbox and obtain root privileges. The malware is used to add/change the file being served by the web server. There is no mention of what file the malware was being used to serve up...it could be used just to transparently serve up ads or could be used to serve up some client-side exploits.

      --
      Portland, North Dakota Puppies
  2. Why Only 64-bit by medv4380 · · Score: 2

    Just curious why the root kit is only targeting 64-bit. Is it specifically targeting the intel 64bit spec that allows for privileged escalation, or something like that? Reading the article makes it sound like it's an exploit of the AMD little endian pointers which, since I don't know hardware on that level, I don't know if that means it's actually a CPU exploit or an OS exploit. And if it's a CPU exploit I don't know if it's all AMD64 based including or excluding Intel.

    1. Re:Why Only 64-bit by hobarrera · · Score: 4, Informative

      amd64 is the name of the architecture you normally call "64bits" or "x86_64" every day, and is an extension of "i686".
      The name is so merely because amd came up with it.

      Intel's modern microprocessors are amd64 as well (they just call it a different name).

    2. Re:Why Only 64-bit by quintus_horatius · · Score: 3, Interesting
      FTFA (emphasis added):

      "To hook private functions that are called without indirection (e.g., through a function pointer), the rootkit employs inline code hooking. In order to hook a function, the rootkit simply overwrites the start of the function with an e9 byte. This is the opcode for a jmp rel32 instruction, which, as its only operand, has 4 bytes relative offset to jump to," Georg Wicherski of CrowdStrike wrote in a detailed analysis of the new Linux malware.
      "The rootkit, however, calculates an 8-byte or 64-bit offset in a stack buffer and then copies 19 bytes (8 bytes offset, 11 bytes unitialized) behind the e9 opcode into the target function. By pure chance the jump still works, because amd64 is a little endian architecture, so the high extra 4 bytes offset are simply ignored."

  3. Re:Security through obscurity FAIL by Gaygirlie · · Score: 4, Informative

    Yada-yada-blabber-blabber.

    nobody really uses this OS except hobbyists and niche markets

    Yeah, what with Microsoft, Amazon, Google, Valve and so on. Oh, pssh, they're irrelevant; they count as nobodies, right?

  4. Re:There's a new secure OS called... by Sulphur · · Score: 4, Funny

    There's a new secure OS called Rootkit Server 12 - maybe it's time you nerds started upgrading to it!

    This is the year of the Linux rootkit.

  5. Re:Security through obscurity FAIL by 0123456 · · Score: 2

    Since you're so knowledgeable, maybe you could explain to us which 'weakness' this rootkit is exploiting to get itself installed?

  6. Re:Security through obscurity FAIL by Penguinisto · · Score: 4, Informative

    Dunno about AC, but first glance seems to be that it exploits shitty PHP code in order to get itself hosted onto the websites.

    According to TFA, it appears to target one specific kernel (Debian-based), and tries to do some hokey-pokey with RAM to get itself executed. If you want a better description go to the original report

    TFA gives some details, however:

    The kernel module in question has been compiled for a kernel with the version string 2.6.32-5. The -5 suffix is indicative of a distribution-specific kernel release. Indeed, a quick Google search reveals that the latest Debian squeeze kernel has the version number 2.6.32-5.

    The module furthermore exports symbol names for all functions and global variables found in the module, apparently not declaring any private symbol as static in the sources. In consequence, some dead code is left within the module: the linker can't determine whether any other kernel module might want to access any of those dead-but-public functions, and subsequently it can't remove them.

    ...doesn't say exactly how, but there is one thing that is entirely left out of the equation... if it's a drive-by download, does it definitely require user involvement, or not? According to the original report, the complaints were that they customers were being redirected to a malicious site, but nothing about a trojan being involved.

    --
    Quo usque tandem abutere, Nimbus, patientia nostra?
  7. Re:Security through obscurity FAIL by Penguinisto · · Score: 2

    He may be a bastard, but he makes the trains run on time.

    ...try and submit some shit code onto Linus' lap for kernel inclusion... I dare you. ;)

    --
    Quo usque tandem abutere, Nimbus, patientia nostra?
  8. Re:There's a new secure OS called... by DickBreath · · Score: 2

    > This is the year of the Linux rootkit.

    . . . on the desktop?

    Or on hundreds of millions of Android phones. Or supercomputers. Or TiVos or other DVRs. Or routers, printers, and countless other devices. OMG the world is going to end in 2012!!!

    Better to switch to a safe proprietary OS that has never had a security problem.

    --

    I'll see your senator, and I'll raise you two judges.
  9. Rootkit emerged by Anonymous Coward · · Score: 3, Funny

    Must be specifically targeted at Gentoo then.

  10. Infection Method - Well it's not... by Kagato · · Score: 5, Informative

    If you dig into the articles to some of the raw analysis you'll discover two things.

    1) "It remains an open question regarding how the attackers have gained the root privileges to install the rootkit. However, considering the code quality, a custom privilege escalation exploit seems very unlikely." So it unlikely that they gained root with something new, but it was a web site that was hacked, so the likely vector is something related to what the site it was running. PHP, WordPress, DB Injection, and Apache exploits.

    2) "Based on the Tools, Techniques, and Procedures employed and some background information we cannot publicly disclose, a Russia-based attacker is likely."

    1. Re:Infection Method - Well it's not... by Gaygirlie · · Score: 2

      1) "It remains an open question regarding how the attackers have gained the root privileges to install the rootkit. However, considering the code quality, a custom privilege escalation exploit seems very unlikely." So it unlikely that they gained root with something new, but it was a web site that was hacked, so the likely vector is something related to what the site it was running. PHP, WordPress, DB Injection, and Apache exploits.

      That's what I thought, too, but it should be researched more carefully. If the malware in question was injected in the first place via PHP, WordPress or something similar then that makes this much, much less of an important issue. However, if the malware did indeed use one or another exploit in the kernel or the default GNU userland, well, THAT would be truly news-worthy and should raise some serious flags.

  11. Re:There's a new secure OS called... by slashmydots · · Score: 2, Informative

    There's a new secure OS called Rootkit Server 12 - maybe it's time you nerds started upgrading to it!

    This is the year of the Linux rootkit.

    Why? Linux has been around 85% of all web servers in the world for a loooooong time. You don't target the 15% windows servers to get stuff done.

  12. Re:Security through obscurity FAIL by mlts · · Score: 2

    The rootkit is half the battle as TFA says... what gets me really wondering is the exploit they used to get unfettered root access, especially if SELinux is enabled and enforcing.

    The best short term defense against this? A monolithic kernel that has all modules compiled in, and has module loading disabled. Of course, this loses a lot of functionality.

    Long term, maybe the best defense would be to take the TE (trustchk) system from AIX (which can be configured to not run any binaries that are not in a signed database), have signed kernel modules, and use a TPM + LUKS to ensure that if there is tampering, the boot process stops because there is no key to mount the root filesystem. Yes, TPM is a double-edged sword, but it does do well in guarding against these types of attacks.

  13. Re:Security through obscurity FAIL by K.+S.+Kyosuke · · Score: 2

    Dunno about AC, but first glance seems to be that it exploits shitty PHP code in order to get itself hosted onto the websites.

    How does "first glance" tell you that? And are you talking about code written in the PHP language or about the PHP implementation? And even if you break into a PHP implementation remotely, how do you make the kernel load the module, assuming the administrator isn't an outright idiot and the PHP process isn't running as root?

    --
    Ezekiel 23:20
  14. Re:This is not a rootkit! It's a joke! by maxwell+demon · · Score: 2

    Wrong. A rootkit is code which maliciously takes over certain functionality at root level. How it got installed doesn't matter for its classification as rootkit. Of course most rootkits get installed by some virus, worm or trojan, but a rootkit which some cracker installed by hand is still a rootkit.

    --
    The Tao of math: The numbers you can count are not the real numbers.
  15. Quick fix by AliasMarlowe · · Score: 5, Interesting

    The best short term defense against this?

    Just put
    exit 0
    at the end of your /etc/rc.local and the rootkit becomes unloadable. Just like in Debian Squeeze.

    --
    Those who can make you believe absurdities can make you commit atrocities. - Voltaire
  16. Re:There's a new secure OS called... by Anonymous Coward · · Score: 3, Funny

    A more apt joke would be about Windows Server 2008 or 2012.

    An even more apt joke would be something like:

    # apt-get install windows-server-2008
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    E: Unable to locate package windows-server-2008

    But that doesn't seem to work.

  17. Re:Security through obscurity FAIL by micheas · · Score: 2

    Debian does not have SELinux enabled by default. So that is one barrier that frequently they won't have to cross in getting root access.

    Debian might also have been targeted for its large market share and not having security extension installed by default. Considering the wide range of uses that Debian is put to it seems like maybe they should create a "public server" install profile that includes things like SELinux enabled and checkrootkit and other routine auditing tools installed.

  18. Re:How safe is Linux web-browsing in general? by Gaygirlie · · Score: 3, Informative

    There aren't any known, widespread Linux-based viruses or malware, and the few ones that do exist target server software, Java and/or Flash. And even if you found malware that still made its way in your computer via e.g. a vulnerability in the browser's Javascript - implementation that malware would still have to get root privileges in order to properly hide its existence -- there aren't any known, widespread security holes either in the Linux-kernel or the GNU userland, so if you keep your system up-to-date the chances are very, very slim the code would be able to get root privileges.

    That is to say that if you e.g. used Firefox without Java and with the Flashblock add-on there'd be more-or-less no chances of you getting anything. Don't get scared by articles like this one because, well, this one doesn't spread via the web browser in the first place -- it was likely installed on the system by hand by someone who got access to it because of poor website implementation.

  19. Re:Rootkit loads into memory? by Gaygirlie · · Score: 2

    "The rootkit is designed specifically for 64-bit Linux systems .. The new Linux rootkit is loaded into memory and once there"

    How does this 'rootkit' get executed on the target machine, does it require prior root access in order to sucessfully execute?

    Yes, it does. It contains no exploits whatsoever.

  20. Re:There's a new secure OS called... by mug+funky · · Score: 4, Funny

    no no, read the summary. these boxes were using red hat - "A new Linux rootkit has emerged"

  21. Re:There's a new secure OS called... by quintus_horatius · · Score: 3, Funny

    these boxes were using red hat - "A new Linux rootkit has emerged"

    That would be Gentoo, where we even have to compile our viruses from source (but then the virus is super-optimized).

  22. No rc.local file in Gentoo by IBitOBear · · Score: 2

    So since the "root kit" involves some other vector letting the intruder append something to rc.local (or somehow pivot on whether rc.local ends with an "exit 0") the root kit ins't a root kit but a post-root-promotion exploit.

    --
    Innocent people shouldn't be forced to pay for inferior software development.
    --"Code Complete" Microsoft Press
  23. Re:Is this a rootkit? by lgw · · Score: 2

    A "rootkit" is not "a kit to get root" but "a kit to keep root, once you somehow get it". Rootkits try to make an intrusion undetectable and un-removable, but they don't provide the intrusion.

    --
    Socialism: a lie told by totalitarians and believed by fools.