Concept of Virtual Machines and Honeypots Detection Techniques
In “Who is Hacking Me?“, I mentioned using Nmap to do a service probe on a low interaction honeypot. I wrote briefly how to do it in my last post. The “How” part of this article [add link to the previous article] is not uninteresting, but it is the “Why” part I’d like to focus on. You know, we hackers know why things are done so, not just how. So,
Why does the methodology work?
First, ask yourself :
How do you tell a human from a computer?
The CAPTCHA solution : You test the target to recognize some text in an image. If the target passed the test, it’s likely human. If not, it’s likely computer. The idea is that computers cannot do image recognition well, and actually quite bad.
Generalizing, we ask the target to do things only a human can do well but not computers. If the target being tested fails our human test, we conclude it with certain confidence that it is not human.
Well, CAPTCHA works for computers and humans. What about real services and emulated services?
In the same manner, the concept is that : an emulated service and a real service is technically different in implementation, and that difference makes them distinguishable. By targetting these differences, it gives you a hint to the identity of the service.
Let’s go through yet another real example. One question people loves to ask is :
How do I analyze a malware with anti-virtual-machine technology? It does not run in my vmware! Should I use a physical machine?
Wait, but it runs in my VirtualBox. Oh!
Go download any SdBot online or any found in the wild. They are normally armed with an anti-VM (anti-virtual machine) module, which stops the bot execution if it detects it’s in a VM. You can try that in VMWare, specifically VMWare. Then, go try it in VirtualBox. But, save yourself some time, I have tested already. =)
Wrong question, what you shouldask is :
How does the SdBot tell between VMware and a physical machine?
It works because there are technical differences between the implementation of a VM and a physical machine. It is the same idea of emulated services and real services mentioned in the previous article. When I said that it is because of technical differences, it means it is related to its implementation.
Precisely, SdBot running in VirtualBox but not VMware means that SdBot is not anti-VM but anti-VMWare because it is specifically targetting VMWare, but not VirtualBox.
Consider these points :
- VMWare could set a register when a physical machine doesn’t.
- There’s a dhcpd service provided by the VMware which is not generally present in real machines.
- Some instructions in physical CPU are not implemented/supported in VMware.
These techniques are all based on the principle above.
Though, the above also implicated something else : the anti-vm techniques are specific to certain implementations, and you can use some less common virtual machine implementation (VirtualBox, Xen, etc… ) and the SdBot WILL execute, because the anti-vm technique does not apply to VirtualBox, Xen, etc. However, there is no guarantee the anti-vm technique can only hit one implementation, it can target multiple implementation weaknesses.
So, if you have to analyze SdBot in a virtualized environment. You do not need to run it on a physical machine with test automation to take care of the environment. You can create an environment or disable the technique or whatsoever. That is how it works behind the scenes. That goes the same for honeypots in the general idea. So, happy honeypot hunting!
English
Recent Comments