Computer Help and Spyware Removal Computer Help and Spyware Removal Computer Help and Spyware Removal Computer Help Forums Windows Startup Programs Database Virus, Spyware, and Malware Removal Guides Computer Tutorials Uninstall Database File Database Computer Glossary Computer Resources
 

Welcome Guest ( Log In | Click here to Register a free account now! )



Register a free account to unlock additional features at BleepingComputer.com
Welcome to Bleeping Computer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.
Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

> How to use the self-help guides

This forum contains self-help guides on removing common malware and viruses. These guides can be advanced so please use them at your own risk.

If after following the self-help guide, or you can not find an appropriate guide, then you can receive step-by-step instructions directly from one of our experts by following the instructions in this topic: Preparation Guide For Use Before Posting A Hijackthis Log

> Gdi Scan Tutorial, How to fix the GDI+ JPEG Vulnerability
Grinler
post Sep 27 2004, 11:35 PM
Post #1


Bleep Bleep!
******

Group: Admin
Posts: 31,601
Joined: 24-January 04
From: USA
Member No.: 3



GDI Scan Tutorial and how to fix the GDI+ JPEG Vulnerability


Table of Contents



What is the GDI+ JPEG Vulnerability

GDI+ is a programming interface or API that enables programs to use graphics and formatted text on a video display or printer. A vulnerability, GDI+ JPEG Vulnerability, was found in the DLL gdiplus.dll used by GDI+ that has faulty code when processing JPEG images. People who know how this code can be exploited can craft a specially designed JPEG that can exploit this bug and possibly take control of your machine. If you view an image using an application that has this vulnerability, then it is possible for the remote program to issue commands on your computer at the same security level as your user account. Therefore if your user account is an administrator of your machine, then the remote code will have administrative privileges and be able to have full access to the security of your computer.

Microsoft has released an update for this vulnerability which you can get by going to Windows Update for the operating system update and Office Update for the Microsoft office update. Be sure to do those updates immediately as this tutorial assumes you already have them and is focused on resolving issues for 3rd party applications that may be affected by the GDI+ JPEG vulnerability.


What is GDI Scan


A major problem with this vulnerability is that there are 3rd party, non-microsoft, applications that ship with this exploitable DLL. Since Microsoft's update only updates the DLL that came with the Operating System software, you still may be vulnerable from other applications that it does not upgrade. Microsoft released a GDI+ Detection Tool which will scan your computer and tell you if it found any MICROSOFT programs that may be vulnerable. Unfortunately it does not tell you WHAT programs are vulnerable and just directs you back to windows update and office update. Even worse, it does not let you know if any 3rd party software may be affected, leaving you still in the dark.

Because of this Tom Liston, the person who developed the LaBrea Tarpit honeypot software, has created a tool called GDI Scan that will scan a drive on your computer for files that are possibly vulnerable to the GDI+ JPEG exploit. When it has completed scanning the partition it will create a log that will show all possibly vulnerable DLLs found. You can then use this information to determine what programs are affected and then attempt to upgrade these programs so they are no longer vulnerable.

When you run this tool it will scan the partition you specify for any of the following files:

gdiplus.dll (known to be exploitable)
sxs.dll
wsxs.dll
mso.dll


If it finds these files it will attempt to determine if they are vulnerable to the GDI JPEG exploit. If they are, they will be listed in red in the resulting log file.

It is important to note that the previously listed DLLs can be found in more than one location on your hard drive. If they are located in multiple locations on your computer, the program will check the following locations for the DLL, in this order, and if found uses the DLL it finds first:
  1. Loads the DLL from the same directory the application is installed
  2. Loads the DLL from the current working directory you ran the program from.
  3. Windows 95/98*Grinler will load it from the c:\windows\system directory
  4. Windows NT/2000/XP/2003 will load it from c:\windows\system32
  5. Windows NT/2000/XP/2003 will load it from c:\windows\system
  6. The Windows directory (\windows)
  7. Any directories that are listed in the PATH environment variable.
It is therefore possible for the operating system to be properly patched, but for a copy of the exploitable DLL to still be found elsewhere in your computer, which still allows for the vulnerability.


How to use GDI Scan


Step 1: Download GUI version of gdiscan.exe

You can download GDI Scan from the following link:

http://isc.sans.org/gdiscan.php

Download the GUI version to a location you will remember later.


Step 2: Run gdiscan.exe


Once it is downloaded, double-click on gdiscan.exe and a screen similar to the one below will appear:

Start GDIScan
Figure 1: Start GDIScan




First select the drive, designated by the green box in Figure 1, you would like to scan. Once the drive you want to scan is selected, press the Scan button designated by the red box in Figure 1. The program will now scan the drive letter you specified for any copies of the gdiplus.dll, and associated DLLSs, and display them for you as shown in Figure 2 below.

GDIScan.exe Results
Figure 2: GDIScan.exe Results




You can then click on the Clipboard button, designated by the red box, to copy the contents of the results to your clipboard. Then paste the results into a notepad or other document that you can refer back to later.

For Windows 95/98*Grinler Users

It is important to note that this application was designed specifically for XP,2000, or NT. This does not mean, though, that you can not use it in Windows 95, 98, or ME. In order to view the results properly we will need to create an RTF (Rich Text Format) document. Run the program as described above and when it is finished scanning your partition follow these steps:
  1. Click on the Clipboard button to copy the contents of the log into memory.
  2. Click on Start, then Run, and type notepad and press the OK button.
  3. When the notepad is open, click on the Edit menu, and then select Paste. The contents of the log should now be in the notepad.
  4. Click on File and then Save As.
  5. When the Save As dialog box opens change the following:
    1. Change the Save In drop down selection box to the Desktop
    2. Change the Save As Type drop down box to All Files.
    3. Enter log.rtf into the File Name field
  6. Press the Save button
  7. Minimize your desktop and you should now see a icon on your desktop called log.rtf. Double-click on this icon and it will either open in Word, if you have it, or Wordpad if you don't. You should now see the proper formatting in the log.

How do I interpret the results

Now that we have this log, I bet you are wondering what you are supposed to do with it. Well as of right now, the only DLL that we know for sure is exploitable is the gdiplus.dll. So we focus on those listings that contain that DLL and are the proper version or lower.

If it states that it finds DLLs in directories like Windows\$NtUniinstallKB you can safely ignore them. These directories are created in case you want to uninstall various Microsoft updates. Therefore it would not be strange to see the older DLLs there.

NOTE: Previously I had stated that files found in the \Windows\WinSxS directory could be safely ignored. It has been brought to my attention that this information was actually incorrect. The \Windows\WinSxS directory is where Windows stores it's side-by-side DLLs. Side-by-side DLLs are used to allow multiple versions of the same DLL to exist in Windows at the same time. The Operating System maintains a list of which applications use which side-by-side DLL. This allows different versions of the same DLL to coexist on the same computer and have multiple applications share them. Therefore if you see outdated DLLs found here you may want to see if they can be updated via OfficeUpdate, Windows Update, or replacing it with the redistributable. As always make a backup copy first of the DLL found in the \WinSxS first. - Thanks to Donald Smith for the clarification.


Lets take an example from the log above and see how we can interpret the results:

Exploitable DLLs
Figure 3: Exploitable DLLs that were found


As you can see from the above figure, gdiscan found two exploitable copies of gdiplus.dll on my machine. One is in the FolderSizes directory and the other is in the WS_FTP Pro directory. I now know that I need to visit the web sites of these applications and see if there are any updates available. If there are, we download them, install them, and hope they fix the problem, which we can check by running gdiscan.exe again after the installation is complete. If the problem still exists, then you should contact the software manufacturer and explain the situation.

Another workaround may be to download the latest gdiplus.dll from Microsoft. This fix may cause problems with your software if the developers of that software added extra functionality into their copy of the gdiplus.dll. Therefore, please make a backup of the existing gdiplus.dll before you do this method.

You can download this file from the following link:

Platform SDK Redistributable: GDI+

When you download this file, run it and extract the files to c:\gdiplus. Then navigate to c:\gdiplus, and you will find it contains the DLL, gdiplus.dll. Simply copy this DLL over the known exploitable one from the log to replace it. Now that you have replaced that program's gdiplus.dll it should not be exploitable.


Conclusion


Now that you know how to check your system for GDI+ JPEG exploit it is advisable that you do so immediately. At the time of this writing more reports are coming out about tools and sample code to take advantage of this vulnerability. The sooner you run this tool and fix any of the exploitable copies of this DLL on your system, the safer you will be.


--
Lawrence Abrams
Bleeping Computer Advanced Internet Security Concepts
BleepingComputer.com: Computer Support & Tutorials for the beginning computer user.


--------------------
Lawrence
Become a BleepingComputer fan: Facebook
Follow us on Twitter!
Go to the top of the page
 
+Quote Post
3 Pages V  < 1 2 3  
Start new topic
Replies (30 - 37)
Grinler
post Oct 12 2004, 11:06 AM
Post #31


Bleep Bleep!
******

Group: Admin
Posts: 31,601
Joined: 24-January 04
From: USA
Member No.: 3



QUOTE
1. Can you expand a bit on the C:\ I36 directory? I have also the ASMS folder within with a bunch of numbered subfolders.


Many manufactures or computer vendors copy the entire i386 directory from the microsoft cd to your computer so that if you need to access those files later, to install drivers etc, you can copy the files directly off your hard drive instead of the cdrom.

QUOTE
2. I did DL from MS the gdiplus.dll they offer- it is version 3102.1360. Yey my system shows a .dll version # 3102.2180. A newer version than the one they are giving me? Just wondering.


Is the one that shows 3102.2180 being seen as vulnerable or possibly vulnerable?

QUOTE
3. I realize that after replacing the vulnerable dll with the new one I should scan again. But, how do I check to see that the dll is doing its thing--irrespective of vulnerability?


Just test the applications that seem to use the possibly vulnerable dll. If they work fine then you are ok. As always make a backup in case you discover problems in the future.


--------------------
Lawrence
Become a BleepingComputer fan: Facebook
Follow us on Twitter!
Go to the top of the page
 
+Quote Post
EdBee
post Oct 12 2004, 11:43 AM
Post #32


Forum Regular
***

Group: Members
Posts: 208
Joined: 13-July 04
Member No.: 1,385



Thanks for the response-I've already replaced the vulnerable-version in the 1386 Dir on one machine--but it's doubtful that I will ever be able to test/evalute it because I don't think its being used--I will check to see later.

Your question--the newer file is in SYSTEM32\gdiplus--version 5.12600.2180 and is not shown as vulnerable--I am presuming that this dll will be the one used if I do anything with JEPGs.--I will check this also.

I would like to know more about the" side by side" stuff-- I will read furiously--TKS thumbup.gif thumbup.gif


--------------------
EDBEE from NMUSA- RENOWNED MALWARE FIGHTER AND SWORN ENEMY OF ALL INTERNET HIJACKERS
Go to the top of the page
 
+Quote Post
Grinler
post Oct 12 2004, 11:58 AM
Post #33


Bleep Bleep!
******

Group: Admin
Posts: 31,601
Joined: 24-January 04
From: USA
Member No.: 3



I would leave the system32\gdiplus alone. Only replace if its an older version and showing as vulnerable


--------------------
Lawrence
Become a BleepingComputer fan: Facebook
Follow us on Twitter!
Go to the top of the page
 
+Quote Post
dkharada
post Oct 12 2004, 04:36 PM
Post #34


New Member
*

Group: Members
Posts: 3
Joined: 7-October 04
Member No.: 3,411



I still have one gdiplus.dll left after replacing with the downloaded dll. It only shows up when I do a scan. Please advise.

C:\Program Files\MSN\MSNCoreFiles.BAK.FEC69D39-ADBA-4928-98F0-3571AA97ABDF\gdiplus.dll
Version: 5.1.3102.1316 <-- Vulnerable version
Go to the top of the page
 
+Quote Post
Grinler
post Oct 12 2004, 04:52 PM
Post #35


Bleep Bleep!
******

Group: Admin
Posts: 31,601
Joined: 24-January 04
From: USA
Member No.: 3



In the tutorial it tells you of a downloadable redistributable from microsoft. Please follow the instruction on downloading and replacing the one that you are aseeing as fvulnerable. I am inferring from the pathname that it is a backup file and you are probably not using it, but it is safer to replace it anyway


--------------------
Lawrence
Become a BleepingComputer fan: Facebook
Follow us on Twitter!
Go to the top of the page
 
+Quote Post
dkharada
post Oct 12 2004, 05:27 PM
Post #36


New Member
*

Group: Members
Posts: 3
Joined: 7-October 04
Member No.: 3,411



I don't want to be a bother, but I am not able to locate that file. Is there some trick to finding it. It doesn't show when I check show hidden files.

Thanks for your quick response.
Go to the top of the page
 
+Quote Post
Grinler
post Oct 12 2004, 07:25 PM
Post #37


Bleep Bleep!
******

Group: Admin
Posts: 31,601
Joined: 24-January 04
From: USA
Member No.: 3



Click on start, then run, and paste in the following into the field:

C:\Program Files\MSN\MSNCoreFiles.BAK.FEC69D39-ADBA-4928-98F0-3571AA97ABDF\

And press the ok button. That should open the directory if it exists


--------------------
Lawrence
Become a BleepingComputer fan: Facebook
Follow us on Twitter!
Go to the top of the page
 
+Quote Post
dkharada
post Oct 12 2004, 07:42 PM
Post #38


New Member
*

Group: Members
Posts: 3
Joined: 7-October 04
Member No.: 3,411



I guess it doesn't exist.

Thank you for your help. I guess I will have to live with the situation and hope I don't use it.
Go to the top of the page
 
+Quote Post

3 Pages V  < 1 2 3
Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 22nd November 2009 - 01:41 AM


Advertise   |   About Us   |   Terms of Use   |   Privacy Policy   |   Contact Us   |   Site Map   |   Chat   |   Tutorials   |   Uninstall List
Discussion Forums   |   The Computer Glossary   |   Resources   |   RSS Feeds   |   Startups   |   The File Database   |   Virus Removal Guides

© 2003-2009 All Rights Reserved Bleeping Computer LLC.