4 ms·
The real question is, do all emulators differ in some consistent way from all "real" machines, and more so than "real" machines differ among themselves? The ans
by asciilifeform 17y ago
The real question is, do all emulators differ in some consistent way from all "real" machines, and more so than "real" machines differ among themselves? The answer is almost certainly "no", and if it were "yes", the fix ought to be trivial, because there is no fundamental magic which emulators introduce and one might easily detect unspoofably.
- tptacek 17y agoYes. The predictable difference is timing.
- asciilifeform 17y agoHypothetically, software could be fed false outputs from timer-register reads in much the same way as it is fed false outputs from privileged instruction calls in VMWare. I am not aware of any publicly available emulator which does this, however. Alternatively, one could use automated means to find sections of a binary which behave in a logically distinct manner (branch differently in at least one place) when emulated instruction timings are twiddled. Then turn the disassembled section red in your debugger and attack it manually.
- vorador 17y agoThis paper may be of interest to you : http://handlers.sans.org/tliston/ThwartingVMDetection_Liston_Skoudis.pdf http://handlers.sans.org/tliston/ThwartingVMDetection_Liston...
- framiere 17y agoThanks for the paper, it was a nice read. I was stunned to see how straightforward it was. Basically by order of appearance you look for * well know files, or registry keys * patterns in a memory dump * use a great hack called "the red pill" using the SIDT instruction * vm specific hardwares * specific instructions/capabilities
- tptacek 17y agoThis is all very old stuff. VMWare is very easy to detect, as it (a) was based on software virtualization, which has a heavy footprint, and (b) made no attempt to be hard to detect. But the available evidence is that even if you're hardware-virtualizing, there are reliable, millisecond-fast techniques you can use to profile the microarchitecture to detect (say) jumps to hypervisor code in instruction sequences that should run natively. Nate Lawson, Peter Ferrie and I presented some of these at Black Hat a couple years ago. The gap (in functionality and in performance) between an emulator and a cycle-accurate simulator of an actual chipset is large.
- asciilifeform 17y ago> The gap (in functionality and in performance) between an emulator and a cycle-accurate simulator of an actual chipset is large On the other hand, there is a large degree of fuzziness in the behavior (between individual machines) of the features within this gap. For example, profiling and high-resolution timing instructions are not equally available on all x86 CPUs. As for the chipset, most of the interesting features are very poorly (if at all) standardized. I hypothesize that a thorough emulator detector written today will have many false alarms on actual bare hardware. Let's also not forget that not a single emulator has yet been written with the explicit goal of being undetectable by hostile code. High-resolution timers could always be fudged, a tick table consulted for spoofing the requisite intervals, etc. if we know what to expect from the raw hardware. And if one day emulator-writers fall far behind anti-debugger trick specialists, the hardware ICE could make a come-back.