, 2008-01-08
There have been recent reports of an MBR (Master Boot Record) rootkit in the wild and, of course, we have been following up these reports and doing our own analysis.
An MBR is the first sector of a storage device such as a hard disk, and is generally used for bootstrapping the operating system after the computer's BIOS has done its startup checks. Basically, if you can control the MBR, you can control the operating system and therefore the computer it resides on.
MBR-based attacks have been around since the MS-DOS era. Viruses such as Stoned, Michelangelo, Junkie and Tequila used this technique to infect systems, and it is quite incredible to see that almost ten years later, we are again facing attacks on the MBR.
As we have seen, malicious code that modifies a system's MBR is not a new idea -- notable research in the area of MBR-based rootkits was undertaken by Derek Soeder of eEye Digital Security in 2005. Soeder created "BootRoot", a PoC (Proof-of-Concept) rootkit that targets the MBR.
In 2007, Nitin and Vipin Kumar of NVLabs published a second PoC MBR rootkit called "Vbootkit", which was able to exploit the latest version of Microsoft Vista.
So, where do we stand right now? The bad news is that this time the MBR rootkit is not in the form of a PoC demonstration, but is an active threat found in the wild and infecting computers through drive-by exploits via Web sites. Symantec detects this threat as Trojan.Mebroot.
Trojan.Mebroot takes control of the system by overwriting the MBR with its own code. Analysis of Trojan.Mebroot shows that its current code is at least partially copied from the original eEye BootRoot code. The kernel loader section, however, has been modified to load a custom designed stealth back door Trojan 467 KB in size, stored in the last sectors of the disk.
The main problem is that some versions of Microsoft Windows allow programs to overwrite disk sectors directly (including the MBR) from user mode, without restrictions. As such, writing a new MBR into Sector 0 as a standard user is a relatively easy task. This issue has been known for quite some time, and still affects the 2K/XP families, while Vista was partially secured in 2006 (after Release Candidate 2) after a successful attack demonstration made by Joanna Rutkowska. The attack is called the "Pagefile Attack".
Rootkits themselves are hardly a new threat, but the inclusion of the MBR as part of the infection is not considered common. They were previously demonstrated as possible, but were not identified in the wild. Now that this has changed, we expect to see more variants targeting the MBR to appear in the future.
For now, Trojan.Mebroot seems to run successfully only on Windows XP (all Service Packs) due to some hard-coded values inside the attack code. For a complete analysis of the threat, please refer to our writeup for Trojan.Mebroot.
There appears to be a link between Trojan.Mebroot and Trojan.Anserin. Similarities such as the main distribution Web site and the polymorphic packer used in both threats suggest that they may be closely related.
Note: The rootkit cannot be removed while the OS is running, as it must be removed while the rootkit code itself is not running. During our tests, running the "fixmbr" command from within the Windows Recovery Console successfully removed the malicious MBR entry.
To help prevent similar attacks in the future, and if your system BIOS includes the Master Boot Record write-protection feature, now is a good time to enable it!
I would also like to thank Silas Barnes for his contribution to this analysis.
