實驗了下 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;
}