How to protect yourself from the Windows Metafile Vulnerability
Table of Contents
- What is the WMF Vulnerability
- Protection Methods
- How to tell if your computer is vulnerable
- Steps to take before installing the Microsoft Patch
- Downloads and MD5
- References
- WMF patch installation instructions
- WMF patch removal instructions
- Using shimgvw.bat to unregister shimgvw.dll
- Using shimgvw.bat to register shimgvw.dll
- Manual instructions for unregistering shimgvw.dll
- Manual instructions for registering shimgvw.dll
What is the WMF Vulnerability
A recent vulnerability has been found in the Windows MetaFile image type. A specifically crafted Windows MetaFile can be used to run code on your computer that will allow the exploiter to install programs or change settings on your computer. One known application that can be exploited is the Windows Picture and Fax Viewer (SHIMGVW.DLL) or other Windows applications that can handle Windows MetaFiles. If you visit a web site that contains one of these types of image files or open one of these image files, then your computer will be exploited as per the instructions in the MetaFile. As of now, there is no patch for this exploit, while there is a steadily increasing amount of sites that are using this exploit.
Protection Methods
There are currently two methods of reducing your chances of getting infected with this exploit. We recommend that you use both methods to add extra protection until an official Microsoft patch is released. Once the Microsoft patch is released you can uninstall The first method is to install an unofficial patch created by Ilfak Guilfanov. This patch has been extensively tested and has been found to block the WMF exploit. It does this by patching the Escape() function in the gdi32.dll file so that it ignores that SETABORTPROC parameter that the exploit uses. This patch actually patches the vulnerable function, so that you do not need to disable any image viewer programs if that is your wish. Instructions for installing this patch can be found below. The second method is to unregister the shimgvw.dll file so that Windows Picture and Fax Viewer does not open these files when you visit a web site that contains this type of image. To do that you need to unregister the DLL using the instructions below. I have created a simple script that will unregister or register this .DLL in the event that you do not feel comfortable running these commands on your own. Once you unregister this DLL, the Windows Picture and Fax Viewer will no longer work. To enable it you will be able to run the script again to register the DLL so that the program works once again. I advise that you only do this when Microsoft releases the official patch. Please note, that unregistering the DLL does not fix the vulnerability. It only decreases your chance of getting exploited. Steps to take before installing the Microsoft Update Now that Microsoft has released their WMF vulnerability update there are some steps that need to be taken before you install it so that your computer is back to normal operation. The first step is to uninstall the unofficial hotfix. Instructions on how to do this can be found here: HotFix uninstallation instructions After that has been completed you should register the Shimgvw.dll file. Instructions on how to do this can be found here: Register Shimgvw.dll with script Register Shimgvw.dll manually Once this has been completed, reboot your computer and visit http://www.windowsupdate.com and install the update.
How to tell if your vulnerable Not only has Ilfak Guilfanov released a patch for this vulnerability, but he has also released a tool to check to see if you are vulnerable. To check to see if your computer is vulnerable download the WMF Vulnerability Checker and run the program. When the program starts, simply press the OK button and it will will tell you whether or not you are vulnerable. The WMF Vulnerability Checker will check to see if the Escape() function ignores the SETABORTPROC parameter. If it does ignore this parameter, it will state that you are not vulnerable, otherwise it will state that you are. If you are vulnerable, then you need to install the patch described above. Please note, that only unregistering the shimgvw.dll will still show you as vulnerable with the checker. In order to be seen as not vulnerable, you need to install the patch.
Downloads Both fixes are for use on Windows XP, 2000, and 2003. If you are using Windows ME, then you should follow the manual instructions given below. Windows 95 and 98 users do not have the shimgvw.dll file. MD5
File |
MD5 Sum |
| Shimgvw.bat | 96827b1ecf18066b11922260838f451a |
| wmffix_hexblog14.exe | 15f0a36ea33f39c1bcf5a98e51d4f4f6 |
| WMF Vulnerability Checker | ba65e1954070074ea634308f2bab0f6a |
References http://www.microsoft.com/technet/security/advisory/912840.mspx
http://www.kb.cert.org/vuls/id/181038 http://www.hexblog.com
Method 1 - Install the WMF Patch
- Download wmffix_hexblog14.exe and
save it to your desktop.
- Double-click on the wmffix_hexblog14.exe icon found on your desktop.
- Press the Next button.
- Read the license agreement, and if you agree, select I accept the
agreement,
and press the Next button.
- Change the directory where you would like it installed, or if the default
directory is fine, press the Next button.
- Now review that everything is how you would like it installed, and press
the
Install button.
- When it prompts if you would like to reboot, select Yes, restart
the computer now and press the Finish button.
- Your computer will now be patched so that WMF files cant exploit your computer.
- Click on the Start button.
- Click on the Control Panel link.
- Double-click on Add or Remove Programs.
- Click on the entry labeled Windows WMF Metafile Vulnerability HotFix to
select it.
- Click on the Remove button.
- When it asks if you would like to remove the HotFix press the Yes button.
- Reboot the computer if it asks.
- The hotfix should now be removed from the computer.
- Download shimgvw.zip and save it to your desktop.
- Extract shimgvw.zip to your desktop.
- You should now have the file shimgvw.bat on your desktop.
- Double-click on shimgvw.bat.
- At the menu press the number 1 to unregister the DLL. When the DLL is unregistered
you will see a notification appear that states DllUnregisterServer
in C:\Windows\SystemFolder\shimgvw.dll succeeded.
If you get a message after you pick your choice that states that This MS-DOS program has terminated, you can simply press the OK button and then close the DOS Windows by clicking on the X.
- The script will close and you have now disabled the Windows Picture and Fax Viewer.
- Download shimgvw.zip and save it to your desktop.
- Extract shimgvw.zip to your desktop.
- You should now have the file shimgvw.bat on your desktop.
- Double-click on shimgvw.bat.
- At the menu press the number 2 to unregister the DLL.
When the DLL is unregistered you will see a notification appear that states DllRegisterServer
in C:\Windows\SystemFolder\shimgvw.dll succeeded.
If you get a message after you pick your choice that states that This MS-DOS program has terminated, you can simply press the OK button and then close the DOS Windows by clicking on the X.
- The script will close and you have now enabled the Windows Picture and Fax Viewer.
- Click on the Start button and then
the Run field.
- In the run field type %WinDir%\System32\regsvr32.exe
-u shimgvw.dll and press the OK button. (In Windows
ME, substitute System32 with System)
When the DLL is unregistered you will see a notification appear that states DllUnregisterServer in C:\Windows\SystemFolder\shimgvw.dll succeeded.
- You have now disabled the Windows Picture and Fax Viewer.
- Click on the Start button and then
the Run field.
- In the run field type %WinDir%\System32\regsvr32.exe
shimgvw.dll and press the OK button. (In Windows
ME, substitute System32 with System)
When the DLL is unregistered you will see a notification appear that states DllRegisterServer in C:\Windows\SystemFolder\shimgvw.dll succeeded.
- You have now enabled the Windows Picture and Fax Viewer.
This is a self-help guide. Use at your own risk.
If you have any questions about this self-help guide then please post those questions in our AntiVirus, Firewall and Privacy Products and Protection Methods forum and someone will help you.
Edited by Grinler, 13 July 2006 - 03:41 PM.



Back to top








