Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FylNO-0007E6-5j for qemu-devel@nongnu.org; Fri, 07 Jul 2006 04:07:50 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FylNM-0007Dm-Hu for qemu-devel@nongnu.org; Fri, 07 Jul 2006 04:07:49 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FylNM-0007Dj-EZ for qemu-devel@nongnu.org; Fri, 07 Jul 2006 04:07:48 -0400 Received: from [66.249.82.198] (helo=wx-out-0102.google.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FylNj-0005Uc-Br for qemu-devel@nongnu.org; Fri, 07 Jul 2006 04:08:11 -0400 Received: by wx-out-0102.google.com with SMTP id s9so1107112wxc for ; Fri, 07 Jul 2006 01:07:47 -0700 (PDT) Message-ID: Date: Fri, 7 Jul 2006 10:07:47 +0200 From: "G Portokalidis" Subject: Re: [Qemu-devel] Have any ideas about how to detect whether a program is running inside QEMU? In-Reply-To: <20060707012114.4a4a0c44@c1358217.kevquinn.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1152168950.6324.302.camel@aragorn> <20060706204640.GA28903@aplik.cl> <20060707012114.4a4a0c44@c1358217.kevquinn.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Actually, i have also noticed this. It implies that an exploit might not succeed (this usually the case with most exploits), since the attacker supplied shellcode will not be at the "expected" location. My question is, does anybody know why this happens? Why this difference when running qemu with kqemu and without... I wonder if there is way to override this behaviour. Cheers, G. PS: I'm also responsible for the qemu derivative Argos. We make sure that the attacker will never get to run his code to determine whether he is running withing a VM. Of course there always some type of attacks that we would not be able to detect. On 07/07/06, Kevin F. Quinn wrote: > On Thu, 6 Jul 2006 16:46:40 -0400 > Daniel Serpell wrote: > > > But there is a way to detect virtual machines under x86, see > > http://invisiblethings.org/papers/redpill.html > > > > But if you run qemu without direct instruction copying, it won't > > work (and qemu will run slower), because qemu will correctly > > emulate the unprivileged instructions. > > Out of interest, sidt returns limit:base 07ff:c0372000 on my > host, and 07ff:f0050000 on a linux guest with kqemu, and 07ff:c04b5000 > on the same linux guest without kqemu, which illustrates the point. > > I used the following code: > > #include > int main(int argc, char **argv) { > unsigned char idtr[6]; > __asm__ ("sidt %0" : "=m" (*&idtr)); > fprintf(stdout, > "IDTR: limit %2.2x%2.2x base %2.2x%2.2x%2.2x%2.2x\n", > idtr[1],idtr[0],idtr[5],idtr[4],idtr[3],idtr[2]); > } > > which doesn't need executable heap (my kernel is PaX-enabled), unlike > the redpill version, but is gcc-specific. > > -- > Kevin F. Quinn > > > _______________________________________________ > Qemu-devel mailing list > Qemu-devel@nongnu.org > http://lists.nongnu.org/mailman/listinfo/qemu-devel > > > >