ecurity threats are an ever-present concern when using the Internet. Something as simple as browsing the Internet can introduce malware into a machine. Firewalls, antivirus, and antispyware software and good judgment must be exercised at all times. But no matter how well protected your system is and how careful you are, browsing unknown Web sites puts your system at risk. Consider the highly publicized Microsoft Graphics Rendering Engine Vulnerability. An unpatched system with this vulnerability is subject to being completely taken over by an attacker. Browsing an infected Web site can be enough for this vulnerability to be exploited. Using a virtual machine for Web browsing provides an excellent defense against this type of threat.
To understand how to use a virtual machine for safer browsing, first some terminology needs to be defined:
The entire guest operating system and programs are written into a large virtual hard disk file that resides on the host machine. (Although the figures use Microsoft Virtual PC 2004, the concepts illustrated are generic and applicable to other virtualization products.)
![]() | |
| Figure 1. Enabling Undo Disks |
The undo disks feature is off by default, so you must enable it. The following steps show how to configure it:
![]() | |
| Figure 2. Discarding Change to the Undo Disk |
The advantage of using the virtual machine becomes apparent when you turn off the machine (see Figure 2).
By selecting the option Turn off and delete changes, you restore the virtual machine to the exact same state it was in before it was turned on. If any malware was downloaded, it will be in the undo disk file, which is discarded. The virtual hard disk where the operating system and programs reside is untouched.
In order for safe browsing to work, the virtual machine must connect to the network. How to configure networking in a virtual machine is covered in the next section.
![]() | |
| Figure 3. Networking Options for Host Machine's Network Adapter |
Enabling the host's network adapter causes the guest machine to appear on the network as a separate machine with its own IP address. From a networking perspective, the guest functions the same way as a physical machine equipped with a network adapter. This is typically fine for a home network, but may not work in a corporate environment with a Windows domain because unless the guest machine joins the domain, it will not be authorized and may not be able to use the network. (Note: wireless networking and dialup do not work with a host network adapter.)
The other option to enable network access is Shared networking (NAT), which is referred to simply as NAT in VMware Workstation. With Shared networking enabled, Virtual PC serves as a NAT router that uses the host's IP address to access the network. Since all network access is routed through the host, you can establish network access in a tightly controlled domain. If the host is authorized to use the network, then Shared networking uses the host to connect to the network and then to the Internet. If multiple network adapters are available, you can configure Shared networking only on the first one. A guest using Shared networking cannot communicate with other guest machines on the same host. (Note: wireless networking and dialup do work with Shared networking.)
Regardless of which networking option you choose, if Windows Firewall is enabled only on the host, it will not protect the guest. You must enable Windows Firewall within the guest as well to ensure maximum protection.
![]() | |
| Figure 4. Media Is a Virtual PC Shared Folder; c$ Is a Mapped Drive to the Host Machine |
Remember, the objective is to keep the host safe from any malware that may affect the guest, so don't connect the host's filesystem to the guest. However, at some point, you may want to use the guest's browser to download a file from the Internet and make it available to the host. The safest way to do this is to use Virtual PC's drag and drop feature to transfer files between guest and host because it does not open up a TCP/IP connection between them.
Keeping a guest machine up to date with all Windows Updates, service packs, and security patches is just as important as keeping the host machine up to date. It's easy for a guest machine to get behind on updates because it typically is turned off most of the time. It has to be running to receive updates and they must not be undone when the machine is turned off. Finally, when you are actively using a virtual machine for malware analysis, consider setting your VHD files to read-only to keep any changes inside your virtual machine from being made permanent.
Some have proposed using virtual machines to host honeypots, another security technique that may seem attractive. Should malware damage the virtual honeypot, the argument goes, the virtual machine can be reset. Once again, the malware can determine if it's running in a virtual machine and behave differently, which makes the analysis a waste of time.
With these caveats in mind, you should always undo your changes when you browse unknown Web sites. You can't assume that the virtual machine is free of malware just because it appears to be normal.
| DevX is a division of Jupitermedia Corporation © Copyright 2007 Jupitermedia Corporation. All Rights Reserved. Legal Notices |