<?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>WinDBG &#8211; Phocean.net</title>
	<atom:link href="/tag/windbg/feed" rel="self" type="application/rss+xml" />
	<link>/</link>
	<description>Computer Security Blog</description>
	<lastBuildDate>Fri, 24 Feb 2017 21:17:51 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.9.10</generator>
	<item>
		<title>Review of McAfee Application Control (ex-SolidCore): the ultimate solution to patching?</title>
		<link>/2012/12/14/review-of-mcafee-application-control-ex-solidcore-the-ultimate-solution-to-patching.html</link>
		<comments>/2012/12/14/review-of-mcafee-application-control-ex-solidcore-the-ultimate-solution-to-patching.html#comments</comments>
		<pubDate>Fri, 14 Dec 2012 17:55:18 +0000</pubDate>
		<dc:creator><![CDATA[phocean]]></dc:creator>
				<category><![CDATA[Defense]]></category>
		<category><![CDATA[Reversing]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Vulnerabilities]]></category>
		<category><![CDATA[Application Control]]></category>
		<category><![CDATA[asm]]></category>
		<category><![CDATA[Assembly]]></category>
		<category><![CDATA[backtrack]]></category>
		<category><![CDATA[buffer overflow]]></category>
		<category><![CDATA[hardening]]></category>
		<category><![CDATA[heap]]></category>
		<category><![CDATA[McAfee]]></category>
		<category><![CDATA[Metasploit]]></category>
		<category><![CDATA[ollyDbg]]></category>
		<category><![CDATA[SHA-1]]></category>
		<category><![CDATA[SolidCore]]></category>
		<category><![CDATA[stack]]></category>
		<category><![CDATA[WinDBG]]></category>

		<guid isPermaLink="false">http://www.phocean.net/?p=1394</guid>
		<guid isPermaLink="false">http://www.phocean.net/?p=1394</guid>
		<description><![CDATA[What is McAfee Application Control I had the opportunity to review this security software, and I want to share here the results of my tests. McAfee bought the SolidCore solution and renamed it into McAfee Application Control (along with other features). For convenience, we will keep referring the solution as SolidCore. In a few words, this tool...<br><i class="icon-right-hand"></i> <span class="read-more"><a href="/2012/12/14/review-of-mcafee-application-control-ex-solidcore-the-ultimate-solution-to-patching.html">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<h1>What is McAfee Application Control</h1>
<p>I had the opportunity to review this security software, and I want to share here the results of my tests.</p>
<p>McAfee bought the SolidCore solution and renamed it into <a title="McAfee Application Control" href="http://www.mcafee.com/us/products/application-control.aspx#vt=vtab-Benefits">McAfee Application Control </a>(along with other features). For convenience, we will keep referring the solution as SolidCore.</p>
<p>In a few words, this tool falls into the category of white-listing defense systems. It hardens a Windows system by fingerprinting all executables files of the disk drive and enforcing access control based on this hash. Somehow a sort of Tripwire but with access control and attack detection.</p>
<p>The problem is that McAfee claims that the solution will protect unpatched systems. Such a claim is appealing, because in real life it is not always easy to patch systems in production. Beyond technical considerations, there is always business and management constraints. The solution of McAfee is supposed to prevent vulnerabilities to be triggered thanks to the memory protection features. Look on their website, they say it loudly: &#8220;you can delay patching and it protects from buffer overflows&#8221;.</p>
<div id="attachment_1450" style="width: 594px" class="wp-caption aligncenter"><a href="/wp-content/uploads/2012/12/SolidCore-commercial_sheet.png" rel="lightbox[1394]"><img class="size-large wp-image-1450" title="SolidCore-commercial_sheet" alt="" src="/wp-content/uploads/2012/12/SolidCore-commercial_sheet-940x929.png" width="584" height="577" srcset="/wp-content/uploads/2012/12/SolidCore-commercial_sheet-940x929.png 940w, /wp-content/uploads/2012/12/SolidCore-commercial_sheet-580x573.png 580w, /wp-content/uploads/2012/12/SolidCore-commercial_sheet-303x300.png 303w, /wp-content/uploads/2012/12/SolidCore-commercial_sheet-120x120.png 120w, /wp-content/uploads/2012/12/SolidCore-commercial_sheet.png 1106w" sizes="(max-width: 584px) 100vw, 584px" /></a><p class="wp-caption-text">MacAfee Application Control commercial sheet</p></div>
<p>Really? When you check more thoroughly, you find that the solution operates only in user-mode, leaving all kernel-mode issues on the side. Already, any security specialist should become suspicious and think about the numerous limitations it implies&#8230;</p>
<p>Anyway, such a statement deserves serious testing. Here we go.</p>
<h1>Testing Lab</h1>
<p>The testing environment is composed of:</p>
<ul>
<li>a Windows XP SP1 virtual machine (no patch),</li>
<li>a Windows XP SP1 virtual machine (no patch) with SolidCore installed and enabled,</li>
<li>a Windows virtual machine running WinDBG for kernel debugging,</li>
<li>a Linux virtual machine running Metasploit (Backtrack),</li>
<li>a few vulnerable programs: aurora.html for heap overflows and two executables vulnerable against buffer overflow,</li>
<li>OllyDbg on both machines to observe the exploitation process.</li>
</ul>
<p>The point is simple: test some vulnerabilities against unpatched systems, with and without SolidCore, and compare the results.</p>
<blockquote><p>The purpose here is only to focus on what SolidCore is doing (though we are not going to attempt to reverse the application). I will not get here into explanations on assembly and memory exploitation, so please refer to the many great tutorials that can be found on the Internet.</p>
<p>As mentioned, I am myself a noob in reversing and shellcoding so please drop a comment if you see something wrong.</p></blockquote>
<h1>Installing SolidCore</h1>
<p>Like Tripwire, SolidCore needs to take an image of the system when it is sane.</p>
<p>So, basically, after setting it, there are a few commands to type into a command window to scan the whole disk:</p>
<pre>sadmin so
sadmin enable</pre>
<p>It will look for executables (.exe, .dll, etc.) and build a database using SHA-1 hashes.</p>
<div id="attachment_1406" style="width: 590px" class="wp-caption aligncenter"><a href="/wp-content/uploads/2012/12/SolidCore_activation.png" rel="lightbox[1394]"><img class="size-medium wp-image-1406" title="SolidCore_activation" alt="SolidCore Activation" src="/wp-content/uploads/2012/12/SolidCore_activation-580x413.png" width="580" height="413" srcset="/wp-content/uploads/2012/12/SolidCore_activation-580x413.png 580w, /wp-content/uploads/2012/12/SolidCore_activation-420x300.png 420w, /wp-content/uploads/2012/12/SolidCore_activation.png 933w" sizes="(max-width: 580px) 100vw, 580px" /></a><p class="wp-caption-text">SolidCore commands and status after activation</p></div>
<p>Now, only applications installed before the scan will be allowed. If you drop a new file or move an existing one to a new patch and try to execute it, it will fail like this:</p>
<div id="attachment_1409" style="width: 590px" class="wp-caption aligncenter"><a href="/wp-content/uploads/2012/12/SolidCore_blocking_execution.png" rel="lightbox[1394]"><img class="size-medium wp-image-1409" title="SolidCore_blocking_execution" alt="SolidCore blocking execution of a program" src="/wp-content/uploads/2012/12/SolidCore_blocking_execution-580x317.png" width="580" height="317" srcset="/wp-content/uploads/2012/12/SolidCore_blocking_execution-580x317.png 580w, /wp-content/uploads/2012/12/SolidCore_blocking_execution-500x273.png 500w, /wp-content/uploads/2012/12/SolidCore_blocking_execution.png 787w" sizes="(max-width: 580px) 100vw, 580px" /></a><p class="wp-caption-text">SolidCore blocks the execution of a new executable file</p></div>
<p>After that, whenever you need to install a new application, you have to go through the &#8220;update mode&#8221;. Just enter:</p>
<pre>sadmin bu</pre>
<p>At this moment, the protection is deactivated and you can execute anything. Then, you need to do a new scan and re-enable the protection as done previously.</p>
<p>Also, not all memory protections are activated by default. This is supposed to enable memory randomization (aka ALSR but McAfee made):</p>
<pre>sadmin features enable mp-vasr</pre>
<p>Now, see the enabled features:</p>
<div id="attachment_1412" style="width: 444px" class="wp-caption aligncenter"><a href="/wp-content/uploads/2012/12/SolidCore_features_list.png" rel="lightbox[1394]"><img class="size-full wp-image-1412" title="SolidCore_features_list" alt="SolidCore features list" src="/wp-content/uploads/2012/12/SolidCore_features_list.png" width="434" height="178" /></a><p class="wp-caption-text">SolidCore features list and memory protection (mp-vasr, mp-casp)</p></div>
<p>So far so good, now we can play!</p>
<h1>Let&#8217;s see what is behind the scene&#8230;</h1>
<p>The first thing to notice is that SolidCore installs a service launched with the LocalSystem account.</p>
<div id="attachment_1415" style="width: 594px" class="wp-caption aligncenter"><a href="/wp-content/uploads/2012/12/SolidCore_service1.png" rel="lightbox[1394]"><img class="size-large wp-image-1415" title="SolidCore_service1" alt="SolidCore service" src="/wp-content/uploads/2012/12/SolidCore_service1-940x562.png" width="584" height="349" srcset="/wp-content/uploads/2012/12/SolidCore_service1-940x562.png 940w, /wp-content/uploads/2012/12/SolidCore_service1-580x346.png 580w, /wp-content/uploads/2012/12/SolidCore_service1-500x300.png 500w, /wp-content/uploads/2012/12/SolidCore_service1.png 983w" sizes="(max-width: 584px) 100vw, 584px" /></a><p class="wp-caption-text">SolidCore service</p></div>
<div id="attachment_1416" style="width: 336px" class="wp-caption aligncenter"><a href="/wp-content/uploads/2012/12/SolidCore_service2.png" rel="lightbox[1394]"><img class=" wp-image-1416 " title="SolidCore_service2" alt="SolidCore background service process" src="/wp-content/uploads/2012/12/SolidCore_service2.png" width="326" height="365" srcset="/wp-content/uploads/2012/12/SolidCore_service2.png 408w, /wp-content/uploads/2012/12/SolidCore_service2-268x300.png 268w" sizes="(max-width: 326px) 100vw, 326px" /></a><p class="wp-caption-text">SolidCore background service process</p></div>
<p>Let&#8217;s have a look within a kernel debugging session with WinDbg.</p>
<p>While booting, the target displays a lot of interesting info concerning the McAfee solution:</p>
<pre>Solidcore log buf: F8418B60, F84415C0
K.0004.0008: Nov 30 2012:04:49:09.812: SYSTEM: rtinit.c : 1474: McAfee Solidifier driver version 6.0.1-9049
K.0004.0008: Nov 30 2012:04:49:09.828: SYSTEM: rtinit.c : 1476: DriverEntry @F846E500
K.0004.0028: Nov 30 2012:04:49:10.093: SYSTEM: imgp_rebase.c: 196: <strong>Rebased \Device\HarddiskVolume1\WINDOWS\system32\ntdll.dll to \Device\HarddiskVolume1\Solidcore\vasr\ntdll.dll at 0x5cda0000.</strong>
K.0004.0028: Nov 30 2012:04:49:10.500: SYSTEM: rtinit.c : 129: Booting up with RTEMode = 1
[...]
K.0432.0436: Nov 30 2012:04:49:15.671: ERROR: cap_kern.c : 1106: Failed to compute checksum for '\Device\HarddiskVolume1\WINDOWS\system32\autochk.exe'. err = 1099
K.0432.0436: Nov 30 2012:04:49:15.796: SYSTEM: imgp_rebase.c: 196: <strong>Rebased \Device\HarddiskVolume1\WINDOWS\system32\kernel32.dll to \Device\HarddiskVolume1\Solidcore\vasr\kernel32.dll at 0x65d60000.</strong>
K.0432.0436: Nov 30 2012:04:49:15.828: SYSTEM: imgp.c : 3114: Starting decoying of \Device\HarddiskVolume1\Solidcore\vasr\kernel32.dll (\Device\HarddiskVolume1\Solidcore\k32_c__v.dll)
K.0432.0436: Nov 30 2012:04:49:15.890: SYSTEM: imgp.c : 3118: Finished decoying of \Device\HarddiskVolume1\Solidcore\vasr\kernel32.dll (\Device\HarddiskVolume1\Solidcore\k32_c__v.dll) with err = 0
K.0432.0436: Nov 30 2012:04:49:15.953: SYSTEM: imgp_rebase.c: 196: <strong>Rebased \Device\HarddiskVolume1\WINDOWS\system32\user32.dll to \Device\HarddiskVolume1\Solidcore\vasr\user32.dll at 0x48c60000.</strong>
K.0732.0828: Nov 30 2012:04:49:20.859: SYSTEM: utl.c : 500: Failed to find username, err 0xc000020c, perhaps the service is not running.
K.1312.1316: Nov 30 2012:04:49:21.281: SYSTEM: pkgc_misc.c : 679: <strong>Rebased \Device\HarddiskVolume1\Solidcore\pkgc\10980000\Device\HarddiskVolume1\WINDOWS\system32\_si.dll to 10980000</strong>
K.1312.1316: Nov 30 2012:04:49:21.390: ERROR: imgp.c : 3190: 0001 Failed to set branch target 0x10c46740 from 0x00000000 at VA 0x10a56760.
K.0732.0828: Nov 30 2012:04:49:23.875: SYSTEM: utl.c : 520: Retrying usermode lookup of username [1].
K.0732.0828: Nov 30 2012:04:49:23.890: SYSTEM: utl.c : 476: Found username as WINXP-MCAFEE\phocean
K.1904.1932: Nov 30 2012:04:49:27.078: SYSTEM: pkgc_misc.c : 679: <strong>Rebased \Device\HarddiskVolume1\Solidcore\pkgc\20170000\Device\HarddiskVolume1\WINDOWS\system32\_si.dll to 20170000</strong>
K.1904.1932: Nov 30 2012:04:49:27.453: ERROR: imgp.c : 3190: 0002 Failed to set branch targ et 0x20436740 from 0x00000000 at VA 0x20246760.
[...]</pre>
<p>We learn the driver entry point and that it is relocating a few strategic DLL: ntdll, kernel32, user32 and _si.dll. Ntdll, kernel32 and user32 are obviously the main user-mode API of Windows and we can expect that SolidCore is also putting a few hooks inside them. _si.dll is part of SolidCore and appear to be unlinked while the system is running.</p>
<p>Let&#8217;s look around modules to confirm the position fo the driver:</p>
<div id="attachment_1418" style="width: 594px" class="wp-caption aligncenter"><a href="/wp-content/uploads/2012/12/SolidCore_driver.png" rel="lightbox[1394]"><img class="size-large wp-image-1418" title="SolidCore_driver" alt="SolidCore driver" src="/wp-content/uploads/2012/12/SolidCore_driver-940x815.png" width="584" height="506" srcset="/wp-content/uploads/2012/12/SolidCore_driver-940x815.png 940w, /wp-content/uploads/2012/12/SolidCore_driver-580x503.png 580w, /wp-content/uploads/2012/12/SolidCore_driver-345x300.png 345w, /wp-content/uploads/2012/12/SolidCore_driver.png 945w" sizes="(max-width: 584px) 100vw, 584px" /></a><p class="wp-caption-text">SolidCore driver (WinDbg kernel debugging)</p></div>
<p>So, the McAfee driver is named <em><strong>swin</strong></em>. Quickly looking around, we also find that a DLL is injected in all processes: <strong><em>scinject.dll</em></strong>. Also, see on the screenshot, how <em><strong>kernel32</strong></em> was effectively relocated. So every time the machine will start, the library will be located at a different address (it could be interesting to check the entropy of this randomization, by the way, but this is another topic).</p>
<div id="attachment_1432" style="width: 466px" class="wp-caption aligncenter"><a href="/wp-content/uploads/2012/12/McAfee_SolidCore-DLL_injection.png" rel="lightbox[1394]"><img class=" wp-image-1432 " title="McAfee_SolidCore-DLL_injection" alt="McAfee SolidCore, injection of scinject.dll in processes" src="/wp-content/uploads/2012/12/McAfee_SolidCore-DLL_injection.png" width="456" height="367" srcset="/wp-content/uploads/2012/12/McAfee_SolidCore-DLL_injection.png 570w, /wp-content/uploads/2012/12/McAfee_SolidCore-DLL_injection-372x300.png 372w" sizes="(max-width: 456px) 100vw, 456px" /></a><p class="wp-caption-text">McAfee SolidCore injects the DLL &#8220;scinject.dll&#8221; in running processes.</p></div>
<p>Just to make sure, I checked that the dll does not get injected by the registry setting:</p>
<div id="attachment_1434" style="width: 590px" class="wp-caption aligncenter"><a href="/wp-content/uploads/2012/12/McAfee_Solicore-Registry.png" rel="lightbox[1394]"><img class="size-medium wp-image-1434" title="McAfee_Solicore-Registry" alt="McAfee SolidCore AppInit_DLLs" src="/wp-content/uploads/2012/12/McAfee_Solicore-Registry-580x297.png" width="580" height="297" srcset="/wp-content/uploads/2012/12/McAfee_Solicore-Registry-580x297.png 580w, /wp-content/uploads/2012/12/McAfee_Solicore-Registry-500x256.png 500w, /wp-content/uploads/2012/12/McAfee_Solicore-Registry.png 753w" sizes="(max-width: 580px) 100vw, 580px" /></a><p class="wp-caption-text">McAfee SolidCore does not use AppInit_DLLs</p></div>
<p>Nothing there, so it must be done through a hook.</p>
<h1>First tests: Metasploit</h1>
<p>I was told that SolidCore was doing good against Metasploit, so one of the first thing I did was to fire up Backtrack and play with it against the SP1 &#8220;solidified&#8221; target.</p>
<p>And I have to say that I was quickly disapointed.</p>
<p>Sure, I could not get a Meterpreter session or get a standard payload to work out of the box, whereas it was a piece of cake on the standard SP1.</p>
<div id="attachment_1437" style="width: 590px" class="wp-caption aligncenter"><a href="/wp-content/uploads/2012/12/McAfee_SolidCore-Payload_fails.png" rel="lightbox[1394]"><img class="size-medium wp-image-1437" title="McAfee_SolidCore-Payload_fails" alt="SolidCore and payload failure" src="/wp-content/uploads/2012/12/McAfee_SolidCore-Payload_fails-580x175.png" width="580" height="175" srcset="/wp-content/uploads/2012/12/McAfee_SolidCore-Payload_fails-580x175.png 580w, /wp-content/uploads/2012/12/McAfee_SolidCore-Payload_fails-940x285.png 940w, /wp-content/uploads/2012/12/McAfee_SolidCore-Payload_fails-500x151.png 500w, /wp-content/uploads/2012/12/McAfee_SolidCore-Payload_fails.png 1009w" sizes="(max-width: 580px) 100vw, 580px" /></a><p class="wp-caption-text">SolidCore prevents standard Metasploit payloads (including Meterpreter) to run successfully.</p></div>
<p>But if SolidCore was at least disturbing the exploitation, it did not protect at all against the vulnerability itself. So I got things like this:</p>
<div id="attachment_1435" style="width: 590px" class="wp-caption aligncenter"><a href="/wp-content/uploads/2012/12/McAfee_SolidCore-Metasploit_DoS.png" rel="lightbox[1394]"><img class="size-medium wp-image-1435" title="McAfee_SolidCore-Metasploit_DoS" alt="SolidCore and Metasploit DoS" src="/wp-content/uploads/2012/12/McAfee_SolidCore-Metasploit_DoS-580x433.png" width="580" height="433" srcset="/wp-content/uploads/2012/12/McAfee_SolidCore-Metasploit_DoS-580x433.png 580w, /wp-content/uploads/2012/12/McAfee_SolidCore-Metasploit_DoS-401x300.png 401w, /wp-content/uploads/2012/12/McAfee_SolidCore-Metasploit_DoS.png 801w" sizes="(max-width: 580px) 100vw, 580px" /></a><p class="wp-caption-text">Denial of Service during exploitation attempt with Metasploit: SolidCore will not magically &#8220;patch&#8221; vulnerabilities!</p></div>
<p>A good old denial of service. Note that on the event log, SolidCore itself doesn&#8217;t log the exploitation attempt.</p>
<p>I did several tests and depending on the vulnerability I got:</p>
<ul>
<li>service crash</li>
<li>system instability</li>
<li>complete DoS (system shutdown)</li>
</ul>
<div>So if a script skiddie will not be able to control the target, he will still obviously be able to cause a lot of damage!</div>
<p>It was not really a surprise: McAfee will not patch the system! But think twice when you are said the contrary&#8230;</p>
<h1>More tests, about memory protection: buffer overflows</h1>
<p>As I was also told that McAfee was protecting user-mode apps against buffer overflows, I was even more excited.</p>
<p>I prepared various representative tests:</p>
<ul>
<li>heap overflow, based on Aurora</li>
<li>stack overflows (one base on strcpy, the other one on Windows CreateFile)</li>
</ul>
<p>But first, one thing I wanted to quickly eliminate was the memory randomization feature, named <strong>mp-vasr</strong>:</p>
<div id="attachment_1439" style="width: 594px" class="wp-caption aligncenter"><a href="/wp-content/uploads/2012/12/SolidCore_mp-vasr.png" rel="lightbox[1394]"><img class="size-large wp-image-1439" title="SolidCore_mp-vasr" alt="SolidCore mp-vasr" src="/wp-content/uploads/2012/12/SolidCore_mp-vasr-940x587.png" width="584" height="364" srcset="/wp-content/uploads/2012/12/SolidCore_mp-vasr-940x587.png 940w, /wp-content/uploads/2012/12/SolidCore_mp-vasr-580x362.png 580w, /wp-content/uploads/2012/12/SolidCore_mp-vasr-480x300.png 480w, /wp-content/uploads/2012/12/SolidCore_mp-vasr.png 1280w" sizes="(max-width: 584px) 100vw, 584px" /></a><p class="wp-caption-text">SolidCore mp-vasr IS NOT ALSR</p></div>
<p><strong>mp-vasr is not ALSR!</strong> The function gets always loaded at the same memory address, so there is not process memory randomization at all&#8230; Another disappointment&#8230;</p>
<p>Next step was to try to exploit the stack overflow. The first payload I used displays a message box. It calls LoadLibrary and GetProcAddress to dynamically resolve function addresses.</p>
<p>When we try to exploit the buffer overflow, we get this:</p>
<div id="attachment_1444" style="width: 590px" class="wp-caption aligncenter"><a href="/wp-content/uploads/2012/12/McAfee_SolidCore-Shellcode11.png" rel="lightbox[1394]"><img class="size-medium wp-image-1444" title="McAfee_SolidCore-Shellcode1" alt="SolidCore blocking a shellcode" src="/wp-content/uploads/2012/12/McAfee_SolidCore-Shellcode11-580x405.png" width="580" height="405" srcset="/wp-content/uploads/2012/12/McAfee_SolidCore-Shellcode11-580x405.png 580w, /wp-content/uploads/2012/12/McAfee_SolidCore-Shellcode11-429x300.png 429w, /wp-content/uploads/2012/12/McAfee_SolidCore-Shellcode11.png 668w" sizes="(max-width: 580px) 100vw, 580px" /></a><p class="wp-caption-text">SolidCore causes memory access violation during shellcode injection</p></div>
<p>We have a memory access violation, because the code is trying the access to the address NULL. Weird, let&#8217;s see it with OllyDbg.</p>
<p>First, there is something that looks like a hook in ntdll:</p>
<div id="attachment_1446" style="width: 556px" class="wp-caption aligncenter"><a href="/wp-content/uploads/2012/12/SolidCore-PE.png" rel="lightbox[1394]"><img class="size-full wp-image-1446" title="SolidCore-PE" alt="SolidCore checking against PE signature" src="/wp-content/uploads/2012/12/SolidCore-PE.png" width="546" height="171" srcset="/wp-content/uploads/2012/12/SolidCore-PE.png 546w, /wp-content/uploads/2012/12/SolidCore-PE-500x156.png 500w" sizes="(max-width: 546px) 100vw, 546px" /></a><p class="wp-caption-text">SolidCore checking against PE signature</p></div>
<p>So this thing is checking the code for a PE signature (<em><strong>5A4D</strong></em>). Then, it will go through <em><strong>scinject.dll</strong> </em>(by calling <em><strong>casp_inject_save_addr</strong></em>, wich is the only exported function).</p>
<p>I could not reverse it (which would require much more time and skills than I have now), but at least we know where it is sitting and how it is triggered.</p>
<p>If we continue the execution, we can then see that the buffer overflow is happening very well:</p>
<div id="attachment_1448" style="width: 594px" class="wp-caption aligncenter"><a href="/wp-content/uploads/2012/12/SolidCore-bof.png" rel="lightbox[1394]"><img class="size-large wp-image-1448" title="SolidCore-bof" alt="SolidCore and buffer overflow" src="/wp-content/uploads/2012/12/SolidCore-bof-940x587.png" width="584" height="364" srcset="/wp-content/uploads/2012/12/SolidCore-bof-940x587.png 940w, /wp-content/uploads/2012/12/SolidCore-bof-580x362.png 580w, /wp-content/uploads/2012/12/SolidCore-bof-480x300.png 480w, /wp-content/uploads/2012/12/SolidCore-bof.png 1280w" sizes="(max-width: 584px) 100vw, 584px" /></a><p class="wp-caption-text">SolidCore does not prevent stack overflow!</p></div>
<p>Yes, we have the stack is fully overflowed and we can control EIP! So nothing should prevent us from exploiting it, shouldn&#8217;t it? ;-)</p>
<p>Here we go:</p>
<p><iframe src="http://player.vimeo.com/video/55797517?badge=0" height="375" width="500" allowfullscreen="" frameborder="0"></iframe></p>
<p>This first payload is low-tech, with hardcoded addresses of <em><strong>MessageBoxA</strong></em> and <strong><em>ExitProcess</em></strong>:</p>
<pre>global _start

_start:

 ;MessageBoxA(windowhandle,msg,title,type)
 mov ebx, 0xEEEEEEEF
 add ebx, 0x11111111 ;\0
 push ebx
 push 0x293a2064 ;d :)
 push 0x656e7770 ;pwne
 mov ecx, esp
 xor edx,edx
 push edx ;OK button
 push ecx ;title
 push ecx ;message
 push edx ;NULL window handle
 mov eax, 0x6a216476 ;MessageBoxA
 call eax
 ;exit
 xor edx,edx ;empty edx out
 push edx ;move address of MessageBoxA onto stack
 mov eax, 0x5cdb98fd ;ExitProcess(exitcode);
 call eax ;exit cleanly so we don't crash parent</pre>
<p>Let&#8217;s how it looks in OllyDbg:</p>
<div id="attachment_1452" style="width: 594px" class="wp-caption alignnone"><a href="/2012/12/14/review-of-mcafee-application-control-ex-solidcore-the-ultimate-solution-to-patching.html/solidcore-buffer_overflow_exploitation" rel="attachment wp-att-1452"><img class="size-large wp-image-1452" alt="Buffer overflow exploitation despite McAfee Application Control" src="/wp-content/uploads/2012/12/SolidCore-Buffer_overflow_exploitation-940x564.png" width="584" height="350" srcset="/wp-content/uploads/2012/12/SolidCore-Buffer_overflow_exploitation-940x564.png 940w, /wp-content/uploads/2012/12/SolidCore-Buffer_overflow_exploitation-580x348.png 580w, /wp-content/uploads/2012/12/SolidCore-Buffer_overflow_exploitation-500x300.png 500w, /wp-content/uploads/2012/12/SolidCore-Buffer_overflow_exploitation.png 1047w" sizes="(max-width: 584px) 100vw, 584px" /></a><p class="wp-caption-text">Buffer overflow exploitation despite McAfee Application Control</p></div>
<p>I then tested with another more sophisticated shellcode (sorry, I cannot publish this one as I am not the author), which resolves dynamically the addresses of kernel32 and GetProcAddress. It works as well. The only caveat that I observed is that LoadLibraryA is systemically blocked (after going through some scinject.dll routines, it always returns 0 in EAX, wich means failure).</p>
<p>In other words, a simple shellcode will work as long as the necessary library are loaded. Though most real life programs will already come with at least kernel32 and user32, it still gives a lot of opportunities.</p>
<p>And then, with more shellcoding kung-fu, I am sure it is possible to get something even more target independant. The following two articles from Phrack probably give most hints to achieve this:</p>
<ul>
<li><a title="Phrack62: Bypassing third-party Windows Buffer Overflow Protection" href="http://www.phrack.org/issues.html?issue=62&amp;id=5">Phrack62: Bypassing third-party Windows Buffer Overflow Protection</a></li>
<li><a title="Phrack63: NT Shellcodes Prevention demystified" href="http://www.phrack.org/issues.html?issue=63&amp;id=15">Phrack63: NT Shellcodes Prevention demystified</a></li>
</ul>
<p>But I need much more knowledge and practice in shellcoding before I can get something to work. I will see it later, and let me know if you could go ahead yourself.</p>
<h1>Conclusion</h1>
<p>Clearly, McAfee Application Control aka SolidCore is not an efficient protection against buffer overflows. If you want something much better, update your systems to something like Windows 7 64 bits and use Microsoft EMET to force DEP and ALSR on programs that don&#8217;t support it by default.</p>
<p>Also, no way to delay patching because you have SolidCore. Full exploitation (shellcode) is just made a little bit more difficult, and that&#8217;s it. The systems will still be exposed to many risks like denial of service unless they are patched. Like always, defense in depth and a proper security policy are the foundations to decide on the patching policy, not a tool or a feature.</p>
<p>This is a pity that the marketing teams give the wrong message, because McAfee still surely addresses many use cases. It is surely efficient enough to improve the control on workstations, that, for some reason, are difficult to control. For example, SolidCore will probably be enough to prevent the average Joe to mess the system. Why not being honest and keeping focus on this feature?</p>
<p>On the other hand, if the McAfee guys want to be as ambitious as they claim,  they will have to move SolidCore to the kernel-mode and enhance the memory protections from there.</p>
]]></content:encoded>
			<wfw:commentRss>/2012/12/14/review-of-mcafee-application-control-ex-solidcore-the-ultimate-solution-to-patching.html/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Rootkit in my lab? (Part III)</title>
		<link>/2012/07/22/rootkit-in-my-lab-part-iii.html</link>
		<comments>/2012/07/22/rootkit-in-my-lab-part-iii.html#comments</comments>
		<pubDate>Sun, 22 Jul 2012 07:48:06 +0000</pubDate>
		<dc:creator><![CDATA[phocean]]></dc:creator>
				<category><![CDATA[Forensic]]></category>
		<category><![CDATA[Mac OS]]></category>
		<category><![CDATA[Reversing]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Assembly]]></category>
		<category><![CDATA[BSOD]]></category>
		<category><![CDATA[crashdump]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Regshot]]></category>
		<category><![CDATA[Rootkit]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[WinDBG]]></category>

		<guid isPermaLink="false">http://www.phocean.net/?p=1317</guid>
		<guid isPermaLink="false">http://www.phocean.net/?p=1317</guid>
		<description><![CDATA[First, thanks for all the comments in the previous articles (Part I and Part II). I decided to analyze one the crash I experienced during registry analysis. I could reproduce all the time a BSOD with Regshot. I thought it would be nice to see what I could get with WinDBG. I had my environment set up...<br><i class="icon-right-hand"></i> <span class="read-more"><a href="/2012/07/22/rootkit-in-my-lab-part-iii.html">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p>First, thanks for all the comments in the previous articles (<a title="Rootkit in my lab ? (part I)" href="/2012/06/30/rootkit-in-my-lab.html">Part I</a> and <a title="Rootkit in my lab ? (part II)" href="/2012/07/11/rootkit-in-my-lab-part-ii.html">Part II</a>).</p>
<p>I decided to analyze one the crash I experienced during registry analysis.<br />
I could reproduce all the time a BSOD with Regshot. I thought it would be nice to see what I could get with WinDBG.</p>
<p>I had my environment set up with the suspicious VM configured to debug activated on the serial port, which is a simple pipe on Mac OS X.<br />
Another VM is configured with a serial port as the other end of this pipe, and WinDBG attached to it.<br />
Another method would be to just configure Windows to create a crashdump file with kernel symbols, that you can later load into WinDBG. Of course, the first method offers more opportunities to check and play with the live system.</p>
<p>Then, I just boot the target and trigger the crash, simply by starting a scan with Regshot:</p>
<p style="text-align: center;"><iframe src="http://player.vimeo.com/video/46157626" frameborder="0" width="500" height="281"></iframe></p>
<p>Windows then crashes, WinDBG catches the exception and stops.</p>
<p>So what do we have ?</p>
<p>First, the error type, <em><strong>PAGE_FAULT_IN_NONPAGED_AREA (50)</strong></em>, means that an instruction pointed to an invalid memory address. Let&#8217;s check this.</p>
<p>With <em><strong>!analyse -v</strong></em>, you get the <a href="/wp-content/uploads/2012/07/regshot-BSOD.txt">full error dump</a>.</p>
<div id="attachment_1331" style="width: 727px" class="wp-caption aligncenter"><a href="/wp-content/uploads/2012/07/WinXP-ReversingBox-2.png" rel="lightbox[1317]"><img class=" wp-image-1331 " title="Crashing Instruction" src="/wp-content/uploads/2012/07/WinXP-ReversingBox-2-1024x557.png" alt="" width="717" height="390" srcset="/wp-content/uploads/2012/07/WinXP-ReversingBox-2-1024x557.png 1024w, /wp-content/uploads/2012/07/WinXP-ReversingBox-2-300x163.png 300w, /wp-content/uploads/2012/07/WinXP-ReversingBox-2.png 1206w" sizes="(max-width: 717px) 100vw, 717px" /></a><p class="wp-caption-text">Crashing Instruction</p></div>
<p>It shows the function (nt!CmpGetValueKeyFromCache, offset 0x89) and the memory address where the crash was triggered.</p>
<p>The instruction at this address is:</p>
<pre>80637807 f3a5 rep movs dword ptr es:[edi],dword ptr [esi]</pre>
<p>This instruction is trying to copy 8 bytes at the address pointed by EDI.<br />
EDI has the value of <strong>0xe1285050</strong> at execution time.</p>
<p>And what do we have at this memory location ?</p>
<div id="attachment_1333" style="width: 727px" class="wp-caption aligncenter"><a href="/wp-content/uploads/2012/07/WinXP-ReversingBox-3.png" rel="lightbox[1317]"><img class=" wp-image-1333 " title="EDI pointing to invalid memory section" src="/wp-content/uploads/2012/07/WinXP-ReversingBox-3-1024x671.png" alt="" width="717" height="470" srcset="/wp-content/uploads/2012/07/WinXP-ReversingBox-3-1024x671.png 1024w, /wp-content/uploads/2012/07/WinXP-ReversingBox-3-300x196.png 300w, /wp-content/uploads/2012/07/WinXP-ReversingBox-3.png 1394w" sizes="(max-width: 717px) 100vw, 717px" /></a><p class="wp-caption-text">EDI pointing to invalid memory section</p></div>
<p>Nothing indeed. Note that this corruption persists at every boot.</p>
<p>So what can we conclude?<br />
We can certainly exclude hardware failure, because it is a virtual machine and because the corruption always occur at the same memory region, even after a reboot.<br />
At least, I can now be sure that something in the kernel is definitely corrupted.</p>
<p>Could it be a rootkit trick? Still the question remains, but to me it now looks very, very suspicious. Some rootkit code, poorly written, could have sat in this non-paged memory area and been paged out, causing the BSOD. I have not much knowledge about it at this time but I am going to search on this. At least, I now have good starting point to look at.</p>
<p>That&#8217;s all for today, folks. I wrote it while I am still working on it, so sorry if it looks rough and incomplete. It is sort of live, thoughts are still in process.</p>
<p>Again, I am looking forward to reading your comments and suggestions. (Hopefully) there will be a part IV!</p>
]]></content:encoded>
			<wfw:commentRss>/2012/07/22/rootkit-in-my-lab-part-iii.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Debugging the CrashMe program</title>
		<link>/2011/11/30/debugging-the-crashme-program.html</link>
		<pubDate>Wed, 30 Nov 2011 22:02:47 +0000</pubDate>
		<dc:creator><![CDATA[phocean]]></dc:creator>
				<category><![CDATA[Reversing]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Assembler]]></category>
		<category><![CDATA[buffer overflow]]></category>
		<category><![CDATA[CrashMe]]></category>
		<category><![CDATA[WinDBG]]></category>

		<guid isPermaLink="false">http://www.phocean.net/?p=1163</guid>
		<guid isPermaLink="false">http://www.phocean.net/?p=1163</guid>
		<description><![CDATA[CrashMe, from the WinDbg developpers, may be a helpful application for those in the process of learning how to use a debugger or a disassembler. It simulates several crash situation that you will be able to easily reproduce and examine within these tools.]]></description>
				<content:encoded><![CDATA[<p><a title="CrashMe" href="http://windbg.info/apps/46-crashme.html" target="_blank">CrashMe</a>, from the WinDbg developpers, may be a helpful application for those in the process of learning how to use a debugger or a disassembler.</p>
<p>It simulates several crash situation that you will be able to easily reproduce and examine within these tools.</p>
]]></content:encoded>
			</item>
	</channel>
</rss>
