Slashdot Mirror


Hiding a Rootkit In System Management Mode

Sniper223 notes a PC World article on a new kind of rootkit recently developed by researchers, which will be demoed at Black Hat in August. The rootkit runs in System Management Mode, a longtime feature of x86 architecture that allows for code to run in a locked part of memory. It is said to be harder to detect, potentially, than VM-based rootkits. The article notes that the technique is unlikely to lead to widespread expoitation: "Being divorced from the operating system makes the SMM rootkit stealthy, but it also means that hackers have to write this driver code expressly for the system they are attacking."

33 of 119 comments (clear)

  1. Re:My BIOS has a toggle for virtualization feature by Anonymous Coward · · Score: 5, Informative

    Nope! This isn't using Virtualization mode.

  2. hmm by extirpater · · Score: 5, Funny

    i have norton, problem solved.

    1. Re:hmm by v1 · · Score: 5, Funny


      Isn't that like using a gun to prevent a cold? Yes I suppose it's effective, but still...

      --
      I work for the Department of Redundancy Department.
    2. Re:hmm by extirpater · · Score: 5, Funny

      Isn't that like using a gun to prevent a cold? Yes I suppose it's effective, but still... soldering gun is exactly for this
    3. Re:hmm by Anonymous Coward · · Score: 3, Interesting

      Strongly suggest you spend some time learning about SMM. Hnt: the OS stops running while this takes place in the background - Norton wouldn't have a clue.

    4. Re:hmm by jotok · · Score: 4, Funny

      Yes, but running Norton, he won't have any free RAM for the rootkit to be loaded into.

  3. oooooh scary by ILuvRamen · · Score: 4, Insightful

    Oh boy, I love ridiculously overly dramatic BS! Yes it's very easy for it to hide there and for there to be basically no signs that it's there. OMG everyone run for the hills! Oh wait, malware doesn't just sit there, it does stuff. It runs threads, it reads from and writes files on the hard drive, and it has to at some point send some sort of data over the internet or local network. So yeah, no virus can hide and still cause damage and spread while remaining undetected.

    --
    Google's Super Secret Search Algorithm: SELECT @search_results FROM internet WHERE @search_results = 'good'
    1. Re:oooooh scary by Anonymous Coward · · Score: 5, Informative

      Depending on the BIOS, the chipset itself can be configured to explicitly make it impossible for the OS's kernel to even read or write the specific memory range that it being used for SMM.

      The attack vector is made a lot easier because most BIOS vendors don't blockhole the address range as they need to support USB devices DMAing into the Aseg and Tseg segments (the memory ranges utilized by SMM). This is what you pay for to be able to use a USB keyboard in DOS. Legacy emulation so that all those ancient BIOS interrupt calls continue to work with your latest input devices..

      If there is a modern operating system running, there is a handoff between the OHCI driver and the SMM using a mailbox register on the usb controller so that the BIOS stops using the USB controller. What this means that modulo BIOS services that do things like control fans (and aren't implemented in ACPI), something could slip into SMM quite easily and flip the bit that makes it impossible for your antivirus to find it.

    2. Re:oooooh scary by Anonymous Coward · · Score: 4, Interesting

      FWIW, an even easier vector for stuffing data into the SMM, and not as a BIOS payload (which will be very motherboard specific) is to chain it into the VGA BIOS (which most PCs have..). The VGA bios is nice because it's a very clean interface (as far as option roms go) for getting called and you can chain in the real VGA bios after doing whatever you see fit.

      You can even have it trigger on the first BIOS calls of the windows bootloader so that you can easily overwrite the SMM memory regions in a nice and portable way.

    3. Re:oooooh scary by ILuvRamen · · Score: 3, Insightful

      LEARN HOW TO READ! All I said was this particular gloom and doom bullshit is overstated and shouldn't be as feared as they're making it sound. Where the hell did you get "all viruses aren't dangerous" out of that? All I'm saying is every virus can be detected. All these new "unstoppable supervirus: we're all gonna die!" articles are idiotic and wrong.

      --
      Google's Super Secret Search Algorithm: SELECT @search_results FROM internet WHERE @search_results = 'good'
    4. Re:oooooh scary by j00r0m4nc3r · · Score: 2, Funny

      All these new "unstoppable supervirus: we're all gonna die!" articles are idiotic and wrong.

      That's exactly what the unstoppable supervirus wants you to think!

    5. Re:oooooh scary by cbrocious · · Score: 3, Interesting

      ACPI is even easier and it's far more portable (that is, less specific to a given hardware configuration)

      --
      Disconnect and self-destruct, one bullet at a time.
  4. LiveCD by Anonymous Coward · · Score: 2, Interesting

    With all the security issues that we hear so much about, I have decided that one potential way of avoiding most of them is to run a liveCD distro of whatever OS when working with sensitive data.
    I do all my internet banking via freeBSIE now - yes it takes a veeeeery long time to boot, and I know that it doesn't solve ALL of the problems but it has to eliminate enouogh problems to be a viable solution.
    Agree / disagree ?

    1. Re:LiveCD by Anonymous Coward · · Score: 5, Informative

      If the code runs in SMM and is launched from the BIOS a live CD doesn't avoid the problem.

    2. Re:LiveCD by Technician · · Score: 3, Insightful

      and I know that it doesn't solve ALL of the problems but it has to eliminate enouogh problems to be a viable solution.

      It's time to look at the Intel vPro tm. tech that enables this. Look for demo videos online. The level in the BIOS enables remote powering up machines to push OS updates, remote booting repairing crashed/unbootable Windows machines, etc. This protected level of stuff is beyond the OS and even the power switch. IF it can remote boot an unbootable corrupt Windows partition, write fixes to it and boot it up, there just isn't much that a Live CD can hide. You best bet is to use your own known hardware. Turn off the remote management stuff unless your employer is using it. If the employer is using it, their top level management should be able to detect alterations to the protected area.

      --
      The truth shall set you free!
  5. Difficult in practice by Anonymous Coward · · Score: 5, Interesting

    In theory, SMM is the ultimate rootkit hiding place. In practice, it's difficult to exploit on a wide scale. Getting the system to execute rootkit code in SMM isn't easy. You're going to need an exploitable BIOS bug, or the ability to reflash the ROM. Either is going to be very system-specific.

    1. Re:Difficult in practice by garett_spencley · · Score: 3, Funny

      "You're going to need an exploitable BIOS bug, or the ability to reflash the ROM. Either is going to be very system-specific."

      Exactly. Windows was written to solve this very problem. All this talk about hiding root kits in SMM is one giant leap backwards.

    2. Re:Difficult in practice by moteyalpha · · Score: 4, Interesting

      This is one area where I have worked a bit and there is tremendous potential for abuse of VMM and SMM when you combine it with users that trust a company to deliver binaries. I will not use a binary program, unless I have the source and can verify it is legitimate. A bit of social engineering and the right picture and an uninformed user will be flashing their BIOS while they wait for the security update they think they are getting. If it is done right, this type of program can remain dormant and use no CPU time to give itself away, until it is keyed to act in something like a bot net or some other purpose.

    3. Re:Difficult in practice by Anonymous Coward · · Score: 3, Informative

      [quote]or the ability to reflash the ROM. Either is going to be very system-specific.[/quote]
      Manipulating the ROM image is trivial. It basically consists of the emergency boot block, a small LHARC decompressor, and a mini filesystem (basically a linked list) containing some modules of position-independent code in LHARC archives. If you want to add a module, simply compress it, read out the existing image, append your achive to the list, and write the result back. People have been doing this so often, f.e. for adding the PXE boot rom from the LinuxBIOS project without fully replacing the BIOS.

      Flashing itself is also pretty easy. Take a look at UniFlash, which is a FOSS program written in Pascal that supports virtually every existing flash chip. The procedure is pretty much always the same and very simple. It allows allows for flashing PCE/AGP/PCIe expansion ROMs.

      (You will also find some very interesting details. F.e. on some chips, apparently the hardware flash protection switch can be overridden by a software flag, rendering it absolutely useless.)

      So please stop spreading the myth that BIOS rootkits would be hard or unstable. It's really just that seemingly no-one ever bothered to write a proof-of-concept, since the concept really is too trivial.

    4. Re:Difficult in practice by node+3 · · Score: 2, Informative

      is the term ROM now commonly used for all embedded chips? Erasable, programmable, read-only memory chips, aka EPROMs, are a type of read-only memory chip, aka ROMs.

      As are EEPROMs, which is the specific type of ROM we are talking about here (electronically erasable, programmable, read-only memory), since they don't require a UV light to erase the chips.

      To further confuse things, flash memory (such as SD cards, USB flash drives, internal memory for iPods, cameras, phones, as well as SSD drives) are actually a type of EEPROM, even though they aren't strictly read-only in the sense most people would think. ROM actually refers to the memory being non-volatile and not to it being non-writable.
  6. There could be something to this by lakeland · · Score: 3, Interesting

    Lets say you are an evil terrorist hell-bent on infultrating the American military and wrecking havoc.

    It seems to me that this would be exactly the sort of thing you'd look for. Military machines are specced very precisely, you'd know exactly what hardware was on the system so drivers wouldn't be much of an issue.

    All you'd have to do is sneak your code in here once, and the timebomb would be ticking for when you want to activate it. Yeah, it wouldn't be easy to get it on there, but it means breaking through once allows you to lay a trap for another time. That sounds pretty serious to me.

    1. Re:There could be something to this by PhireN · · Score: 2, Interesting

      Its true, I worked in a company involved in air traffic control over the summer, And the computers which they had to use were old Compaq servers from 1998, of a certain model, with exactly x ram.
      They were using eBay to track down replacements.

  7. IPMI Card Vulnerabilities by landonf · · Score: 4, Interesting

    What about vulnerabilities in onboard IPMI cards? Our new servers have ARM-based cards running Linux. The built-in HTTP server is vulnerable to a widely-known buffer overflow:

    landonf@ahost:~> telnet XXX.XXX.XXX.XXX 80
    Trying XXX.XXX.XXX.XXX...
    Connected to XXX.XXX.XXX.XXX.
    Escape character is '^]'.
    GET /x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/ HTTP/1.0
    Connection closed by foreign host.
    landonf@timor:~> telnet XXX.XXX.XXX.XXX 80
    Trying XXX.XXX.XXX.XXX...
    telnet: connect to address XXX.XXX.XXX.XXX: Connection refused

    Seems like a recipe for compromised data centers, to me. Re-imaging a machine won't touch the IPMI card.

    --
    http://plausible.coop
    1. Re:IPMI Card Vulnerabilities by netcrusher88 · · Score: 3, Insightful

      Yes, but presumably you don't let the entire world get on your DC network. If only trusted people access vulnerable systems, the vulnerabilities are less significant. Yes they're still there, and yes there's still a risk, but what would the cost be of replacing or reprogramming all the IPMI cards? Security is all about risk/reward, except with a few more variables. If your demonstrable risk is minimal, the reward to reduce or eliminate it will also be minimal. If the cost outweighs the benefit, it's just bad business. Even if it is a good idea.

      --
      There's an old saying that says pretty much whatever you want it to.
  8. Looks like an argument for openness to me... by fuzzyfuzzyfungus · · Score: 3, Insightful

    Obviously I don't like hearing about nasty, or potentially nasty, vulnerabilities in common systems; but these sorts of situations do seem like an argument for more openness in computer systems, right down to the dark, embedded corners. Particularly with these dark, embedded, corners taking on more and more functions. If you can pull stuff like this with the BIOS, I hate to think what a full EFI setup could be doing(particularly if the OEM enthusiasm for shittastic bundleware reaches that level of the system). Time and again, we see that we cannot trust what we cannot verify.

    1. Re:Looks like an argument for openness to me... by cdrguru · · Score: 2, Insightful

      The problem is, you would like to turn the "personal computer" into a something that needs attention and continual review and updating. What 99% of the world wants is an email appliance that they can download the latest neat stuff on. We need to move to more of an appliance that needs less, not more administration.

      The second problem is that there is no "administrator", at least no qualified one for most of the home computers in the world. Windows needs some administration, arguably more administration than it gets. Linux can't operate without administration although it can be less frequent but requires more knowledge.

  9. Neither news or an issue by Anonymous Coward · · Score: 2, Informative

    This has already been discussed about two years ago. Basically you can't carry it out because every chipset blocks write access to this memory part by doing a complete remapping of the memory layout in hardware. Together with a very short list of mainboards where the developers forget to set up the necessary flags through the BIOS code.

    1. Re:Neither news or an issue by DigitAl56K · · Score: 2, Informative

      Basically you can't carry it out because every chipset blocks write access to this memory part by doing a complete remapping of the memory layout in hardware. But TFA says someone has carried it out and will demo it in August.
  10. Not really an issue on recent hardware by mjg59 · · Score: 4, Informative

    In system management mode, the processor runs code from memory (SMRAM) that can't be seen by the operating system. The usual way of handling this is to map the SMM memory into the address space at 0xa0000 - that is, where the legacy graphics framebuffer is. Normal accesses to this address space are redirected to the graphics card by the northbridge. In SMM, accesses to this address space are diverted to real memory and the magic code is run.

    Obviously, it has to be possible for the BIOS to put code their in the first place. There's a configuration flag in the northbridge (on recent Intel chipsets, it's byte 0x9d of the PCI configuration space on the host bridge) that controls whether accesses are directed to the graphics hardware or physical memory. The BIOS can set that to do the initial setup. Once it's done that, the bit is flipped and normal code can no longer see the SMM code. The vulnerability lies in the fact that OS code could reset that bit, gain access to the SMRAM and modify it. Any BIOS I've seen from the past couple of years has gone a step further and set an additional bit that prevents this from occuring. Once that bit is set, the only way for normal code to gain access to the SMRAM region is for the machine to be reset. This happens before any OS code gets run, so there's no opportunity to install hostile SMM handlers.

    Is it still possible to exploit? Yes. If the attacker can modify your BIOS they can modify the code that it copies into SMRAM. However, if the attacker can modify your BIOS then they've already won even without using SMM. The initial bootloader uses BIOS calls to read data off disk, so a sufficiently intelligent attack could rewrite that in order to boot a modified kernel. In versions of Windows before Vista, most graphics drivers still made BIOS calls. A modified BIOS could do anything it wanted to with those without looking suspicious in the slightest. Like the article says, it's unlikely that this'll be common. But to be honest, I don't see it happening in the real world at all.

    (Today I have been trying to work out just WTF a Dell laptop does when it enters system management mode in response to a brightness hotkey press. The locking down of SMRAM makes this effectively impossible)

  11. Invisible to anti-virus? by DigitAl56K · · Score: 2, Insightful

    The problem with the "invisible to antivirus" argument is that it assumes the system is pre-infected. To root a remote system you need to get the code onto the system and execute the software that puts it in SMM, and during that process any anti-virus is able to inspect it. The question is will the anti-virus heuristics or signature-based methods actually catch it?

    1. Re:Invisible to anti-virus? by Opportunist · · Score: 2, Interesting

      A signature can only catch what it knows. Now, it may match any variant of a known virus or at least a known exploit strategy, but it as well may not. Malware writers do check their creations against the most used AV kits. In a targeted attack, they usually even know what AV suit their target uses. So it is likely that at the time of launch, no relevant AV suit detects a certain trojan.

      Malware writers ain't dumb. They know they are the offensive player in that game and they use that advantage.

      --
      We used to have a Bill of Rights. Now, with the rights gone, all we have left is the bill.
  12. How specific of a target? by rocketPack · · Score: 4, Interesting

    TFS says the code must be specifically targeted to a particular machine which, on a PC, means a very big challenge.

    On a Mac, however, you could easily target a very large number of people using only a very small number of hardware variations. Could this exploit be better suited to Macs than PCs? On the other hand, it also seems like it would be equally easier to detect the problem, since your algorithm can be fairly specific (both in terms of Macs and PCs), since the code needed to exploit would be rather specific.

  13. I'm Canadian, you insensitive clod! by A+nonymous+Coward · · Score: 2, Funny

    Science Museum of Manitoba, eh!