New BIOS Exploiting Rootkit Discovered
First time accepted submitter mtemar writes with a Symantec analysis of an interesting new trojan/virus. From the article:"There are more and more known viruses that infect the MBR. Symantec Security Response has published a blog to demonstrate this trend last month. However, we seldom confront with one that infects the BIOS. One of them, the notorious CIH, appeared in 1999, which infected the computer BIOS and thus harmed a huge number of computers at that time. Recently, we met a new threat named Trojan.Mebromi that can add malicious components into Award BIOS which allows the threat to take control of the system even before MBR."
Is it really a total surprise that it was discovered initially by a Chinese security firm? Their reaction should have been, " look at this virus we just found that we just made!"
I got here through a series of tubes
Seems I need to drink my coffee a little faster as to write an anti-Trojan.Medromi fix to prevent it from getting in our systems. Lol
When flash BIOS first appeared you had to move a hardware jumper to enable writing it. Then we had systems where you could fix it so that once POST finished the possibility to write the BIOS was physically removed. But people wanted simple Windows based utilities to reflash the BIOS instead of booting from a special floppy or even using the flashers many BIOSes themselves offered, and nobody wanted end users to have to open the case and move a jumper. So the vital security functions were removed. Hilarity ensues.
Democrat delenda est
Name one reason why it is a good idea that application programs or the kernel or ANYTHING ELSE should even be ABLE to screw with the BIOS. There should be a big red PHYSICAL switch which makes the BIOS read-only, and it should only be temporarily turned off to allow updating with the manufacturer's files and NOTHING ELSE.
It tried to overwrite it with garbage, thus corrupting it. Kind of like blowing up your car with dynamite isn't the same thing as stealing it.
Most of the time all CIH succeeded at was trashing the BIOS settings stored in CMOS. Clean the infector, reset the BIOS, save the changes and you were done.
It's amazing how low the understanding of what malware is and does has fallen. By the way, the antivirus industry has been aware that it would be possible to write a bios infector the moment software the update-able bios became available. Fortunately most writers of malware are pretty incompetent as far as programming goes, though this did take about 6 years longer than I expected.
Well some points why the kernel may need to write area of the BIOS off the top of my head:
So if you use full disk encryption such as truecrypt do you just get a trashed drive?
The only real reason a computer needs a BIOS is to run a bootloader, and if that functionality works, then it's probably going to continue to work.
You're obviously nostalgic for the days when software was debugged as thoroughly as possible before shipping because it couldn't be upgraded later, rather than released with known major bugs because 'we can always fix it with a flash upgrade'.
> The only real reason a computer needs a BIOS is to run a bootloader...
Oh how I wish that were still true. Got one word for ya, ACPI.
Democrat delenda est
The real question is why are BIOSes not verified for a digital signature by a hardware component.
Yes, you want to be able to upgrade a BIOS by sending a file to a client. That's an important feature. I just don't get why the file should not, as a requirement, be digitally signed.
Shachar
posting anonymously to not revert moderation
I kind of forgot about coreboot/OpenBIOS. Looking at their motherboard support page, apparently I'm not alone. It's a neat concept, but the BIOS is generally just configured and ignored for most people, including geeks.
Every time I start to have faith in humanity, I ruin it by driving to work between 7 and 8 am.
Another solution is to make sure your BIOS is bug free when you ship. That involves paying your coders slightly more than minimum Chinese wage.
Seven puppies were harmed during the making of this post.
Preface: I know a thing or two about BIOS hacking.
Given the very limited space available in the average PC Flash BIOS chip, how fancy can this possibly be, ? Many of them only have 2MB, already close to capacity with just the stock BIOS. This doesn't leave a whole lot of space for adding an attack module, and it would have to do some fancy footwork to survive past the protected-mode switch. Modern operating systems don't use the BIOS at all past the bootloader, once the native device drivers take over. It might be possible to punt out some other chunk of the BIOS to make room, but that's playing with fire. If the machine becomes unbootable, the rootkit won't get very far.
CIH was a very trivial virus. All it did was blindly clobber things with zeroes. It had no way of "rooting" a box. It would simply toast your OS, and if your BIOS chip supported the one flash command CIH knew, it would blank that out as well, rendering your machine unbootable. That's what we get for outsourcing even our virus writing ot China :P
-Billco, Fnarg.com
Can we really trust sky-falling advisories from companies such as Symantec? #ProfitMotive
And DDR2/3/4
And PCIe/16 Graphics
All timings & lane skews handled by BIOS
-nB
whois gawk date unzip strip find touch finger mount join nice man top fsck grep eject more yes exit umount sleep dump
And how do you propose the units in the field get fixed?
Put the BIOS image on a microSD mask ROM. Then open the case, snap out the old BIOS card, insert new BIOS card, close the case.
Another solution is to make sure your BIOS is bug free when you ship. That involves paying your coders slightly more than minimum Chinese wage.
Which is great until a new CPU is released and you don't support it and can't upgrade the BIOS to do so. I've seen a number of AMD users complaining because they'd been told that if they bought an AMD motherboard today they would still be able to use it for future generations of AMD CPUs, only to find that the motherboard manufacturer couldn't be bothered to issue a new BIOS two years later to support the new chips even though the hardware would work with them.
And HT/QPI. Hell, you have to get the PCIe buses walked enough to even see the BIOS boot ROM on the south bridge. Not a full initialization but enough to read the contents of the boot ROM into cache and/or RAM.
"In Russia, BIOS rootkit exploits YOU!"
/. memes and can move on, right? ;)
"Al Gore invented the rootkit"
"It's Bush's fault"
"All your BIOS are belong to us!" (Okay, haven't heard this one for a while)
There.. now we're done with all the
Look back up at my post, now look back down, you're on the Internet. Now look back up. I'm a signature.
ACPI is a cluster fuck, but do you have any ready reason why it could not all be done in the OS, perhaps a unique module particular to the individual motherboard, rather than the BIOS?
... in other words, ACPI?
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...
Your example is the exception because usually a new CPU means a new socket, which means a new motherboard. Besides last minute patches are usually to fix bugs that get discovered through having a large number of users, not to support new hardware. And your argument is irrelevant in the context of being able to update your BIOS through moving a jumper or even changing the physical chip like in the old days. What happens is that if you allow a company a path of least resistance, then management and employees will make sure to do the minimum effort required. Just like software patches were a rare thing before the prevalence of the internet. Now multi-hundred gigabyte release day patches are the norm. Why? Because companies are fucking lazy and sloppy and if you give them an inch they take a mile. I'm in favor of not giving them that inch.
Seven puppies were harmed during the making of this post.
Expect more of this. a full command environment with access to all the hardware on the system before the os boots? it's almost as if it was written 'for' virus and malware makers.
no, DMI training (AFAIK that is not part of ACPI)
whois gawk date unzip strip find touch finger mount join nice man top fsck grep eject more yes exit umount sleep dump
So what about UEFI, will it make this type of threat more difficult or (much) easier? Also, it seems all my servers are safe from this even if they'd be running MS-Windows, because they use a cheap RAID card to detect the hard drives and then boots from one of them. Another mitigation is an encrypted root filesystem because hook.com won't be able to find a login program. Until they modify it to infect the encryption software, of course. Best way to defend against this would be to use TPM with a signed kernel, which is virtually non-existent today.
I guess conventional wisdom is that formal verification to ensure that a BIOS is bug free is too expensive for this market segment.
If you change the CPU, you must open your case and manipulate the hardware anyway. Changing a jumper to allow BIOS update wouldn't be a big deal in that case.
The Tao of math: The numbers you can count are not the real numbers.
If you change the CPU, you must open your case and manipulate the hardware anyway. Changing a jumper to allow BIOS update wouldn't be a big deal in that case.
In case you didn't notice, the post I was replying to was suggesting that you make the BIOS bug-free and not upgradeable at all rather than making the BIOS upgrade more complex.
When the OS requests the BIOS to flash itself, the old bios should check that the new one has a correct public key signature from the manufacturer. Three could be a physical switch on the mobo for (the tiny minority of) people who wanted to use an unsigned bios.
But wouldn't the use of a BIOS password pretty much put a quick end to this? Ignoring backdoor/default passwords, of course.
But wouldn't using a BIOS password pretty much put a quick end to this? Ignoring backdoor/default passwords, of course.
Superstition IS a virus!
No modern man runs that code or respects the ideas behind it.
"This post is an artistic work of fiction and falsehood. Only a fool would take anything posted here as fact."
My house mate and I caught a virus back in 1997 that infected executables, MBR, and lodged itself in his BIOS. He had to run McAfee 7 times before it finally cleared out. A BIOS infecter isn't new.
Flash BIOS is a convenience to manufacturers, normal end users usually couldn't give a shit. They have no idea what it is, what it does, or why they should care. If it doesn't make their system play games or run Office faster, they don't care.
When you want something built, come see me. If you want correct grammar and spelling, get a F*ing liberal arts student.
If your bootstrap code and code that allows for an "emergency BIOS reload from CD" early in the boot process is read-only, there will be a way to recover from any BIOS infection.
Knowledge is how to play a game, intelligence is how to win, wisdom is knowing what game to play.
Real old school, and I am very surprised we even allow this to happen even today after all this time.
And of course, do they really care if Joe Average needs to buy a new mobo or laptop because theirs is bricked....? Possibly not, chances are it might even be from the same vendor... Writing this from my ASUS - not my choice an insurance replacement. My favoured method of bricking is spilt beer :D
I would love to live in your perfect world. Silicon development is HUGELY complex. Yes you could theoretically release perfect hardware (from the device to the gate level) but the R+D costs would prevent anyone actually buying it.
There's a few newer ones, and AMD is supporting it for all of thier 14h cpu and chipsets so I think its just a matter of time till you get more options.
Should have never got rid of that jumper that required a little bit of human protection.
---- Booth was a patriot ----
It seems like the trivial fix here is to sign the code and only allow flashing of signed images after boot. It would be nice to be able to flash anything during boot for hacking/testing/whatever, but anyone using the windows-based flash software is likely to be okay with just signed code from the manufacturer.
Isn't this what those TPM chips were designed for in the first place before they hijacked into being tools for draconian DRM?
Didn't he get gunned down in LA, after that Vibe magazine party?
Hey! I'm a west-coast, DU / Tupac kind of guy!
"Flyin' in just a sweet place,
Never been known to fail..."
It used to be IBM would reset these for you if you could prove you owned the machine. I think you had to send them into to IBM or have an onsite visit, but it was possible.
It's not quite the same as back then they were EPROM's and not EEPROM's or flash. So you'd have to actually pull the chips out, erase them with a UV Lamp and then programming then in a Burner.
It's a long story but after I left high school in New Jersey I had entrusted a friend Mark to ship my possession to California where I had moved to. Instead it stole it all.
After moving I started a large collection of BIOS for XT, AT 80286 motherboards. I had written code that was floating around the BBS's that would harvest the BIOS and dump out ROM images that you could burn on to EPROM and install in to another Motherboard.
So I had made several sets of the latest AMI bios for some friends back home. Well Mark asked a mutual friend to get a copy of the BIOS from me, but not tell me who it was really for.
Well I found out and prepared a special BIOS just for him.
Mark was a big warez guy. He was sharing floppies with everyone.
So I took a copy of the Friday the 13th virus. Also know as Jerusalem B that would slow your PC down to a crawl and every time you ran a program it's file size would grow. It was very easy to detect and clean and mostly harmless. I removed the malicious payload , but made sure it still propagated normally.
The virus was only around 2000 bytes, and ran as a TSR.
I found some empty space in the ROM image, and xor encrypted it and placed it in and added hooks so when you format a floppy (Int 13) it would install the virus TSR.
From there it would then attach itself to any exe file that get's ran.
So I burned the EPROM's and sent them over. I was hearing story's from friends how he was loosing his mind. He'd clean all his disks. Then go to make someone a copy and it would be infected. No one would trade disk with him.
He never did figure out how he kept getting infected.
Revenge is sweet.
I am always doing that which I can not do, in order that I may learn how to do it. - Pablo Picasso
some boards have dual bios and now update from bios as well.
Like those floppy disks or something. Enable/Disable physical write option for CMOS/BIOS.
Ant(Dude) @ Quality Foraged Links (AQFL.net) & The Ant Farm (antfarm.ma.cx / antfarm.home.dhs.org).
The problem with signed BIOSes is that the verifying process could fail due to a current BIOS defect resulting from, at your choice, obsolescence, incompabilities from motherboards/CPUs's, previous failed BIOS update, etc..
In that case, the BIOS update becomes impossible, even for many dual-BIOS motherboards.