实验了下 vmware和xen 都检测出来了,各位喜欢XX的人可以试用下。
不过现在的发行版喜欢默认安装xen,谁知道是不是honypot呢?
/* gcc -Wall -o checkVM checkVM.c * check linux OS in VMare ?
* by alert7
*/
#include <stdio.h>
struct idtr
{
unsigned short limit;
unsigned int base;
} __attribute__ ((packed));
unsigned int get_addr_idt()
{
struct idtr idtr;
asm("sidt %0" : "=m" (idtr));
return idtr.base;
}
int main()
{
unsigned int ptr_idt;
ptr_idt=get_addr_idt();
printf("IDT Addr %p \n",ptr_idt);
if ( (ptr_idt>>24)==0xc0)
printf("Real Linux\n");
else
printf("Maybe in VMare\n");
return 0;
}