Can an infected file from a VM infect the host machine?


Recommended Posts

Hi,

If I were to execute an infected file within a VM, could it infect the host machine that the VM is running on?

Cheers

Link to comment
Share on other sites

it is possible

if the virus got crafted for virtualzation (read: sophisticated ) ; most case nope you are safe

Link to comment
Share on other sites

I had a VM just for testing specific keyloggers and stuff but every time I'd extract something in the VM, my main OS's antivirus would pick it up. So I dunno if it did me any good. Reformatted anyway lol.

Link to comment
Share on other sites

Generally No, unless the Malware is VM aware, which most aren't. AV's will pickup malware as you are downloading it in the virtual machine, if for example the AV is monitoring the network traffic. But if you are testing malware in a VM and if the AV on the Host system goes nuts, I wouldn't be concerned. I usually just tell the AV to be quite for the time being.

The one thing you may want to be careful of is having the VM on the same network as your other computers. It could be possible for the infection to escape the sandbox via the network. So it's always a good idea to setup a VM in a way where it can't ping your other machines. To test it simply try pinging the ip addresses of your workstations from inside the VM.

All that being said, I still use sandboxie in a VM environment. It's probably overkill as I usually roll the vm back when I'm done anyway. I'm just so use to running everything sandboxed on my host system.

Link to comment
Share on other sites

I highly doubt it'd ever happen, especially if you use proper virtualization features on your CPU.

Link to comment
Share on other sites

Hello,

Yes.

Virtual machine software (and, sometimes hardware, see this vulnerability alert from US CERT) like any other program can be susceptible to programming errors that allow a specifically-written piece of malware to exit the guest environment and affect the host. That said, malware which actively exploits such things is comparitively rare. It is, however, a good idea to keep your virtual machine software up-to-date with the current version, patches, etc., just like you would the host operating system.

A growing number of malicious programs do contain code to detect if they are running in a virtual machine, under emulation, or attached to a debugger, but this is to exit or crash themselves to prevent analysis of their code.

Regards,

Aryeh Goretsky

Link to comment
Share on other sites

what hypervisor are you using?

something like vmware is more secure as it acts more private, something like openvz is not.... openvz is more like a jailed "vm" rather then a full on hypervisor.

Summary: The vulnerability affects 64-bit operating systems and virtualization software running on Intel CPU hardware.

The U.S. Computer Emergency Readiness Team (CERT) has issued an alert for a dangerous guest-to-host virtual machine escape vulnerability affecting virtualization software from multiple vendors.

The vulnerability, which affects 64-bit operating systems and virtualization software running on Intel CPU hardware, exposes users to local privilege escalation attack or a guest-to-host virtual machine escape.

From the advisory:

A ring3 attacker may be able to specifically craft a stack frame to be executed by ring0 (kernel) after a general protection exception (#GP). The fault will be handled before the stack switch, which means the exception handler will be run at ring0 with an attacker?s chosen RSP causing a privilege escalation.

Affected vendors include Intel Corp., FreeBSD, Microsoft, NetBSD, Oracle, RedHat, SUSE Linux and Xen.

The US-CERT advisory contains a full list of affected software and links to vendor-supplied patches.

VMWare says its products are not affected by this issue.

Link to comment
Share on other sites

Also if you have integration enabled it could easily copy itself to shared folders with the host, but as others said if you don't enable this it is possible if the malware only if it is advanced enough.

Link to comment
Share on other sites

Had it happen to me when I had Win XP running on a VM machine. The virus hit my VM system and then it actually hit my Mac by opening up a Text edit window and started pasting commands into it as if it was a command line instead. Very odd thing. From that point on, I have always run an anti virus on the Mac just in case. Also helps when I get a file from a friend or family member and if it has a virus, I know it is cleaned and can be resent later. (Power point or Word Doc).

Link to comment
Share on other sites

We analyse a lot of malware that comes embedded in all kinds of documents and files during targeted attacks. They get analysed in a VM running on machines connected to a dead-end switch, so that we can check where on the internet the data gets send back to. These VM's get restored to previous snapshots after every analysis and the OS is kept up-to-date with current patch levels. Even in the event that the host machine gets infected (never happened so far), we would just re-image it again.

Link to comment
Share on other sites

This topic is now closed to further replies.