Virtualization Security: Are Ptacek/Lawson and Joanna Fighting the Wrong Battle?

I’m getting caught up on my blog reading after my big APAC (that’s Asia Pacific) tour with a half-busted Mac, and noticed Tom’s post at Matasano on detecting unauthorized hypervisors. Tom and Nate have been going back and forth with Joanna Rutkowska on how detectable these things might be. For those of you less familiar with all this virtualization stuff, let’s review a little bit.

There are a lot of different types of “virtualization”, but for purposes of this discussion we’re talking about operating system/platform virtualization. For a bit more background there’s always Wikipedia. OS virtualization is where we run multiple operating system instances on a single piece of hardware. To do this most efficiently, we use something called a hypervisor, which (oversimplified) is a shim that lets multiple operating systems run side by side all nice and happy. The hypervisor abstracts and emulates the PC hardware and manages resources between all the operating systems on top (yes you geeks, I’m skipping all sorts of things like Type 1 vs. Type 2 hypervisors and full vs. partial virtualization). Most people today run the hypervisor as software in a “host” operating system, with multiple “guest” operating systems inside. For example, I’m a massive fan of Parallels on my Mac, and use it to run Windows within OS X (I really should upgrade to version 3 soon).

The simple diagram is: 200708270950

First things first; I feel lucky that Joanna and Ptacek (haven’t met Nate yet) let me in the same room as them. They’re smart, REALLY smart. I’ve also never programmed at that level (I was a DB/web application guy) so sometimes I can miss parts of their arguments.

Joanna has been doing some cool work around something called the Blue Pill and virtualized rootkits. To do my usual over-simplification, on a system not already running a hypervisor, the attacker runs code that launches a hypervisor. The hostile hypervisor drops below the host operating system it launched from, virtualizing the host itself. Now everything the user knows about is virtualized and the malicious hypervisor can Do Bad Things unnoticed. Our diagram becomes:


Joanna originally called this undetectable. Thomas and Nate did an entire Black Hat presentation on how they can always detect this, with some blog posts on Nate’s site and at Matasano.

Problem is, they’re looking at the wrong problem. I will easily concede that detecting virtualization is always possible, but that’s not the real problem. Long-term, virtualization will be normal, not an exception, so detecting if you’re virtualized won’t buy you anything. The bigger problem is detecting a malicious hypervisor, either the main hypervisor or maybe some wacky new malicious hypervisor layered on top of the trusted hypervisor.

Since I barely know my way around system-level programming I could easily be wrong, but reading up on Nate and Tom’s work I can’t see any techniques for detecting an unapproved hypervisor in an already virtualized environment. Long term, I think this is a more important issue (especially on servers). Since Intel will be putting some trusted virtual machines on our hardware by default, maybe that’s where we need to look.

Spinning the wrong wheels perhaps?

No Related Posts

[...] Rich Mogull, reacting to our virtualization work: [...]

By Matasano Chargen » You Can Detect Hypervisor on

Response I just posted at Matasano:

Tom, are we talking around each other?

I was referring to detecting an unauthorized hypervisor that either replaces the expected one, layers on top of it (probably not possible, but I never assume anything’s impossible), or corrupts it. This isn’‘t about Blue Pill, think of it being more about a hijacked hypervisor.

If I’‘m in the guest OS I can detect I’‘m running on a hypervisor, but that’s the "easy" part. How do I know there isn’‘t a malicious hypervisor running vs. the authorized one?

By rmogull on

Found your conversation when I was surfing around looking for help. If I believe that my gmail account above is having the actual problem you are discussing, as in a malicious hypervisor creating all kinds of evil in my computer, how do I get rid of him. Am most frustrated because he even prevents me from sending my mail out now. Please advise.

By joy on

If you like to leave comments, and aren’t a spammer, register for the site and email us at and we’ll turn off moderation for your account.