<?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>Matthieu Suiche&#039;s blog &#187; Articles</title>
	<atom:link href="http://www.msuiche.net/category/articles/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.msuiche.net</link>
	<description>Happiness only real when shared.</description>
	<lastBuildDate>Thu, 26 Aug 2010 09:14:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Reply to HBGary &#8212; and personal notes.</title>
		<link>http://www.msuiche.net/2009/11/16/reply-to-hbgary-and-personal-notes/</link>
		<comments>http://www.msuiche.net/2009/11/16/reply-to-hbgary-and-personal-notes/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 02:00:54 +0000</pubDate>
		<dc:creator>Matthieu Suiche</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Forensics]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[windd]]></category>

		<guid isPermaLink="false">http://www.msuiche.net/?p=369</guid>
		<description><![CDATA[One HBGary developper wrote a blogpost about windd entitled &#8220;Windd &#8211; Almost there, but not quite&#8230;&#8220;. HBGary says *they* but I would like to say to readers that windd is a project that I developped and maintain alone, on my spare time. More and more people are using windd so it looks I have to<a href="http://www.msuiche.net/2009/11/16/reply-to-hbgary-and-personal-notes/">&#160;&#160;[ Read More ]</a>]]></description>
			<content:encoded><![CDATA[<p>One HBGary developper wrote a blogpost about windd entitled &#8220;<a href="https://www.hbgary.com/community/shawnblog/">Windd &#8211; Almost there, but not quite&#8230;</a>&#8220;.<br />
HBGary says *they* but I would like to say to readers that windd is a project that I developped and maintain alone, on my spare time.</p>
<p>More and more people are using windd so it looks I have to explain some things about the behavior of Windows Memory Manager and windd itself. Reading HBGary blogpost really made me feel enthusiastic because I recently complained about the lack of feedback on windd which is really frustrating when you lead a free project.</p>
<p>As you probably know early version of windd were open-source, but mainly because of the lack of feedback windd is no more open-source but still free. As far I have seen, <a href="http://www.reactos.org/pipermail/ros-dev/2009-November/012340.html">open-source doesn&#8217;t mean people understand what you wrote or read the code</a>, it is more like a philosophical aspect like &#8220;We have access to the source&#8221;. Anyway, people are still free to send me an e-mail, at matt/msuiche/net if they have questions about the internal behavior of Windd, to insult me or just to thank me.</p>
<p>Back to HBGary blogpost, we can read :</p>
<ul>
<li>Is windd acquiring all of the available physical memory on the system?</li>
<li>Would a “raw format” image dump of a 64-bit vista machine load properly into HBGary’s Responder?</li>
<li>Should windd memory images that contain greater than 4GB of ram be considered admissible in court?</li>
<li>Was windd really the first tool to support physical memory acquisition on Windows 7? (as claimed by the author)</li>
</ul>
<p>Author replied &#8220;No&#8221; to all questions above.</p>
<p>In this blogpost, I am going to provide details about the bug for both technical and no technical people by explain how windd works. The main problem with HBGary article is that they mix accessible physical memory and accessible physical memory address spaces. So I assume most people do not even know the difference between these two *things*.</p>
<p>In July 2008, Mark Russinovich wrote a very well explained article about Windows Physical Memory Manager entitled &#8220;<a href="http://blogs.technet.com/markrussinovich/archive/2008/07/21/3092070.aspx">Pushing the Limits of Windows: Physical Memory</a>&#8220;. In this article Mark also used a tool written by Alex Ionescu (co-author of Windows Internals 5th) called &#8220;meminfo&#8221; to retrieve information related to Windows PFN Database.</p>
<p>In this article Mark explains what physical memory, physical address space and PFN Database are.<br />
For lazy readers here is a short summary.</p>
<p><center><img src="http://blogs.technet.com/blogfiles/markrussinovich/WindowsLiveWriter/PushingtheLimitsofWindowsPhysicalMemory_878B/image_thumb_4.png"/></center><br />
Figure above is the <strong>physical address space</strong>.<br />
<strong>Red</strong> blocks are <strong>devices address space</strong>, <strong>blue</strong> blocks are <strong>physical memory</strong> and the &#8220;Inaccessible RAM&#8221; (only by Windows) is a reserved space in the physical memory for the Operating System to proceed to the translation from Virtual to Physical addresses.<br />
Joanna Rutkowska paper entitled &#8220;<a href="http://www.invisiblethings.org/papers/cheating-hardware-memory-acquisition-updated.ppt">Defeating Hardware Based RAM Acquisition</a>&#8221; is a good reading if you want to know more about &#8220;Red blocks&#8221;.</p>
<p><img src="http://blogs.technet.com/blogfiles/markrussinovich/WindowsLiveWriter/PushingtheLimitsofWindowsPhysicalMemory_878B/image_thumb_9.png"/><br />
Figure above comes from meminfo tool which display Memory Manager physical memory blocks. These entries describe how the physical memory is &#8220;splitted&#8221; in the physical address space which interpreted by the CPU. For the remind, DMA Access provides access to <strong>physical memory</strong> and not to the <strong>physical address space</strong>.</p>
<p>We firstly notice the highest physical page is 0&#215;120000 (1179648) which correspond to <strong>size of the physical address space</strong> and NOT to the <strong>size of physical memory</strong>.<br />
Secondly we notice physical addresses are above 4GB even if the machine has only 4GB installed. To retrieve the size of installed/detected physical memory we have to add the size of each block as follows:<br />
(0x9F000 &#8211; 0&#215;1000) + (0xDFE6D000 &#8211; 0&#215;100000) + (0&#215;120000000 &#8211; 0&#215;100002000) = 0xFFE09000 (~4GB)</p>
<p>#1 Bug HBGary is talking about only concerns the RAW memory dump generation with windd (v1.3.0.x &#60;= Version &#60; v1.3.0.20091113 (fixed version)).<br />
The bug was the following: Windd was reading blue blocks and wrote them directly in a raw dump file like the DMA-way, then it means red-blocks were missing. Impact was the PFN database was invalid which means Virtual to Physical address translation was impossible. BUT windd <strong>DOES</strong>  acquiere all available physical memory. Present version of Windd produces a &#8220;CPU-like&#8221; memory dump (physical memory address space) and fills red blocks with null pages.</p>
<p>#2 Second question was about HBGary’s Responder. I don&#8217;t know this product and I never used it. But it would mean HBGary does not support DMA-style memory dump.</p>
<p>#3 For the third question, please refer to #1 and #2.</p>
<p>#4 Regarding the last question about the fact that I claimed that windd was the first tool support physical memory acquisition I do not remember saying that. I just remember I claimed several times windd was a great tool because it can produce <strong>Microsoft crash dumps</strong> which has great advantages mainly because of Windbg. Then, windd also aims at being used by troubleshooters and/or kernel developpers and not only by forensics investigators.</p>
<p>For instance in your blogpost I can read &#8220;<i>NOTE: HBGary’s Responder does not yet fully support the automatic analysis of Windows 7 which is why HBGary had elected to not publicly advertise Windows 7 acquisition support</i>&#8221; &#8212; The difference between windd and average memory acquisition tools is this point: This problem does not exist with WinDbg. Windbg supports Microsoft Crash Dump since Microsoft started to work on Windows.<br />
Analysis is very important, if someone produces a dump and is unable to analyse it this is more or less like if someone would say &#8220;I have a new car but I do not know how to drive it&#8221;. </p>
<p>Thanks again to HBGary for helping me to improve windd utility and I hope they like the new version.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.msuiche.net/2009/11/16/reply-to-hbgary-and-personal-notes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft Crash Dump Analysis weaknesses.</title>
		<link>http://www.msuiche.net/2008/10/16/microsoft-crash-dump-analysis-weaknesses/</link>
		<comments>http://www.msuiche.net/2008/10/16/microsoft-crash-dump-analysis-weaknesses/#comments</comments>
		<pubDate>Thu, 16 Oct 2008 20:56:02 +0000</pubDate>
		<dc:creator>Matthieu Suiche</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Forensics]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.msuiche.net/?p=73</guid>
		<description><![CDATA[I’m going to discuss about Microsoft Crash Dump Analysis weaknesses, but in fact this blogpost is somehow an introduction to the next version of Win32DD 1.2. Indeed, the next version of win32dd will have crash dump generation implemented and some others things you’ll enjoy too. Any reader who is interested in this topic is encouraged<a href="http://www.msuiche.net/2008/10/16/microsoft-crash-dump-analysis-weaknesses/">&#160;&#160;[ Read More ]</a>]]></description>
			<content:encoded><![CDATA[<p>I’m going to discuss about Microsoft Crash Dump Analysis weaknesses, but in fact this blogpost is somehow an introduction to the next version of <a href="http://win32dd.msuiche.net">Win32DD 1.2</a>. Indeed, the next version of win32dd will have crash dump generation implemented and some others things you’ll enjoy too.</p>
<p>Any reader who is interested in this topic is encouraged to refer to Andreas Schuster articles about <a href="http://computer.forensikblog.de/en/2006/03/dmp_file_structure.html">the dmp file format</a>, Mark Russinovich &#8220;<a href="http://blogs.technet.com/markrussinovich/archive/2008/07/21/3092070.aspx">Pushing the Limits of Windows: Physical Memory</a>&#8220;, and Alex Ionescu&#8217;s excellent tool &#8220;<a href="http://www.alex-ionescu.com/?p=51">meminfo</a>&#8220;.</p>
<p>What’s the content of the full memory crash dump (*.dmp) files? In fact this is not a really a full memory snapshot. Only pages from <a href="http://www.msuiche.net/2008/09/17/retrieving-mmphysicalmemoryblock-regardless-of-the-nt-version/">MmPhysicalMemoryBlock</a> ranges are copied.</p>
<p>For your information MmPhysicalMemoryBlock structure looks like that: </p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw4">typedef</span> <span class="kw4">struct</span> _PHYSICAL_MEMORY_DESCRIPTOR <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; ULONG NumberOfRuns;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; PFN_NUMBER NumberOfPages; <span class="co1">// NumberOfPages * PAGE_SIZE is physical memory size.</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; PHYSICAL_MEMORY_RUN Run<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span>; <span class="co1">// NumberOfRuns is the total entries.</span></div>
</li>
<li class="li2">
<div class="de2"><span class="br0">&#125;</span> PHYSICAL_MEMORY_DESCRIPTOR, *PPHYSICAL_MEMORY_DESCRIPTOR;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw4">typedef</span> <span class="kw4">struct</span> _PHYSICAL_MEMORY_RUN <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; PFN_NUMBER BasePage;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; PFN_NUMBER PageCount;</div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span> PHYSICAL_MEMORY_RUN, *PPHYSICAL_MEMORY_RUN;</div>
</li>
</ol>
</div>
<p>Here is how look the physical memory layout under Windows Vista 32bits with 1GB of RAM.<br />
Only blue blocks are copied into the crashdump file while reading the MmPhysicalMemoryBlock, red blocks are reserved for devices, and others are not-reserved pages.</p>
<p><center><a href='http://www.msuiche.net/wp-content/uploads/2008/10/phymem.png'><img src="http://www.msuiche.net/wp-content/uploads/2008/10/phymem.png" alt="" title="phymem" class="aligncenter size-full wp-image-75" /></a><br />
(Figure 1: Overview of Physical Memory Layout)</center></p>
<p>To identify these not-reserved pages I wrote a tool, available to <a href="http://www.msuiche.net/tools/memhole.v.0.1.20081016.zip">download here</a> (This version only works under Vista 32bits and above, with administrator privileges), to list drivers address ranges and system memory address ranges.</p>
<p><center><a href='http://www.msuiche.net/wp-content/uploads/2008/10/capture.png'><img src="http://www.msuiche.net/wp-content/uploads/2008/10/capture_small.png" alt="" title="capture" class="aligncenter size-full wp-image-76" /></a><br />
(Figure 2: Windows Vista 32-bits with 1GB of RAM)</center></p>
<p>In the sample above, there are 66 not-reserved pages (0,025%) including spare space at offset 0&#215;00000000. (This page is well know from people who read <a href="http://www.ivizsecurity.com/research/preboot/preboot_whitepaper.pdf">Jonathan Brossard research </a>about pre-boot password.). This page is not used during the O.S. is running, and the Run[0].BasePage is always equal to 1 (=0&#215;00001000). It means there is at least one &#8220;not reserved&#8221; page with a fixed address which won&#8217;t be in the full crash dump memory during the BSOD process.</p>
<p>These pages could be used to hide code from crash dump without any hooks or structures modification. Full memory snapshot with classical tool can be a solution, but you no more benefit of the powerful crash dump analysis WinDbg&#8217;s feature. Win32dd 1.2 will take care of this problem to provide to forensics investigators a most powerful memory imager.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.msuiche.net/2008/10/16/microsoft-crash-dump-analysis-weaknesses/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>X-Files. Episode 2. *Squeeze*</title>
		<link>http://www.msuiche.net/2008/04/30/x-files-episode-2-squeeze/</link>
		<comments>http://www.msuiche.net/2008/04/30/x-files-episode-2-squeeze/#comments</comments>
		<pubDate>Wed, 30 Apr 2008 14:18:41 +0000</pubDate>
		<dc:creator>Matthieu Suiche</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[SandMan]]></category>

		<guid isPermaLink="false">http://www.msuiche.net/?p=46</guid>
		<description><![CDATA[As said previously, it&#8217;s really easy to find proof of plagiarism when an open-source tool is released and whan this source is reimplemented into a commercial software without compliance. Andreas published a new article called The implementation by Vendor &#8220;S&#8221;. In this article, he has explained what are the differences between the implementation of XpressDecode<a href="http://www.msuiche.net/2008/04/30/x-files-episode-2-squeeze/">&#160;&#160;[ Read More ]</a>]]></description>
			<content:encoded><![CDATA[<p>As said <a href="http://www.msuiche.net/2008/04/29/x-files-episode-1-deep-throat/">previously</a>, it&#8217;s really easy to find proof of plagiarism when an open-source tool is released and whan this source is reimplemented into a commercial software without compliance.  Andreas published a new article called <a href="http://computer.forensikblog.de/en/2008/04/implementation_by_vendor_s.html#more">The implementation by Vendor &#8220;S&#8221;</a>. In this article, he has explained what are the differences between the implementation of XpressDecode in <a href="http://sandman.msuiche.net">SandMan</a> and the Microsoft OS Loader&#8217;s one.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.msuiche.net/2008/04/30/x-files-episode-2-squeeze/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>X-Files. Episode 1. *Deep throat*</title>
		<link>http://www.msuiche.net/2008/04/29/x-files-episode-1-deep-throat/</link>
		<comments>http://www.msuiche.net/2008/04/29/x-files-episode-1-deep-throat/#comments</comments>
		<pubDate>Tue, 29 Apr 2008 20:13:09 +0000</pubDate>
		<dc:creator>Matthieu Suiche</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Forensics]]></category>

		<guid isPermaLink="false">http://www.msuiche.net/?p=45</guid>
		<description><![CDATA[Andreas, recently published an interesting article called &#8220;The 3 Vendors&#8221;. This article is talking about GPL rights violation against researchers who share their knowledge. And also demonstrate, how this kind of violation can be easily identified through code flowchart. It sounds like the beginning of a series&#8230;]]></description>
			<content:encoded><![CDATA[<p>Andreas, recently published an interesting article called <a href="http://computer.forensikblog.de/en/2008/04/the_3_vendors.html">&#8220;The 3 Vendors&#8221;</a>. This article is talking about GPL rights violation against researchers who share their knowledge. And also demonstrate, how this kind of violation can be easily identified through code flowchart. It sounds like the beginning of a series&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.msuiche.net/2008/04/29/x-files-episode-1-deep-throat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New attack released &#8211; Windows has been vulnerable for 8 years.</title>
		<link>http://www.msuiche.net/2008/03/18/new-attack-released-windows-has-been-vulnerable-for-8-years/</link>
		<comments>http://www.msuiche.net/2008/03/18/new-attack-released-windows-has-been-vulnerable-for-8-years/#comments</comments>
		<pubDate>Tue, 18 Mar 2008 19:15:57 +0000</pubDate>
		<dc:creator>Matthieu Suiche</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[SandMan]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.msuiche.net/2008/03/18/new-attack-released-windows-has-been-vulnerable-for-8-years/</guid>
		<description><![CDATA[In November 2007 at PacSec&#39;07, Tokyo, Japan, Nicolas Ruff and I (Matthieu Suiche) presented how to create a readable physical memory dump from the undocumented Microsoft hibernation file. Last month, I published an open-source public version of this project called SandMan Framework. This framework allows manipulating the hibernation file for offensics (malicious) or forensics uses.<a href="http://www.msuiche.net/2008/03/18/new-attack-released-windows-has-been-vulnerable-for-8-years/">&#160;&#160;[ Read More ]</a>]]></description>
			<content:encoded><![CDATA[<div align="right"><iframe src='http://digg.com/tools/diggthis.php?u=http%3A//www.msuiche.net/#' frameborder='0' scrolling='no' height='80' width='50'></iframe></div>
<p><strong>In November 2007</strong> at <em>PacSec&#39;07, Tokyo, Japan</em>, Nicolas Ruff and I (Matthieu Suiche) presented how to create a readable physical memory dump from the <strong>undocumented</strong> Microsoft hibernation file.</p>
<p>
Last month, I published an open-source public version of this project called <a href="http://sandman.msuiche.net" target="_blank"><strong>SandMan Framework</strong></a>. This framework allows manipulating the hibernation file for offensics (malicious) or forensics uses.</p>
<p>
Today, I am going to release a Proof of Concept of the <i>sandman attack</i> using SandMan Framework. This PoC consists in elevating a user CMD shell to SYSTEM level under Windows XP SP3 <strong>RC1</strong>.
</p>
<p>
Sandman Framework offers a wide range of possibilities, <strong>both offensive and defensive</strong>. Like <em>cryptographic keys retrieving in popular encryption software (e.g. TrueCrypt, GPG), privilege<br />
escalation (cf. PoC), login without any password, and so on</em>.
</p>
<p><strong>All Windows versions are concerned</strong>, from Windows 2000 up to Windows 2008, Windows Vista SP1 included (and possibly Windows Seven).
</p>
<p>
The following video shows how the system can be subverted in a few minutes. The following points are highlighted:</p>
<p><strong>* </strong>Deactivating hibernation feature <strong>does not solve</strong> the problem.<br />
<strong>* </strong>The sandman attack affects <strong>every Windows version</strong>, from Windows 2000 to Windows 2008, 32- and 64-bit alike.<br />
<strong>* </strong>We can <strong>read and write everything everywhere</strong> in the physical memory (RAM).<br />
<strong>* </strong> This attack is feasible in <strong>real life</strong> on every computer <strong>with no hardware requirements</strong>.<br />
<strong>* </strong><strong>The attack has no time limitation</strong>. If a computer has been hibernated one<br />
week ago, extracting his physical memory is still possible.</p>
<p>
<em>This is far more powerful than other recently demonstrated attacks against physical memory, like Cold Boot and FireWire attacks.</em>
</p>
<div align="center"><object width="672" height="504"><param name="movie" value="http://www.dailymotion.com/swf/x4pv79d&#038;v3=1&#038;related=1"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.dailymotion.com/swf/x4pv79&#038;v3=1&#038;related=1" type="application/x-shockwave-flash" width="672"  height="504" allowFullScreen="true" allowScriptAccess="always"></embed></object><br /><b><a href="http://www.dailymotion.com/video/x4pv79_new-attack-windows-vulnerables-for_tech" target="_blank">New attack released &#8211; Windows has been vulnerable for 8 years.<br />Generic Privilege Escalation under Windows XP SP3 RC1.</a></b></div>
<p></p>
<blockquote><p>&#8220;keep you free from sin, till the sandman he comes&#8221;<br />
<em> (Enter SandMan — Metallica)</em></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.msuiche.net/2008/03/18/new-attack-released-windows-has-been-vulnerable-for-8-years/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SandMan 1.0.080226 is out!</title>
		<link>http://www.msuiche.net/2008/02/26/sandman-10080226-is-out/</link>
		<comments>http://www.msuiche.net/2008/02/26/sandman-10080226-is-out/#comments</comments>
		<pubDate>Tue, 26 Feb 2008 19:31:18 +0000</pubDate>
		<dc:creator>Matthieu Suiche</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Reverse Engineering]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.msuiche.net/2008/02/26/sandman-10080226-is-out/</guid>
		<description><![CDATA[Since Windows 2000, Microsoft provides a feature called Hibernation also know as suspend to disk that aims to save the system state into an undocumented file called hiberfil.sys. This file contains all the physical memory saved by the Operating System and aims to be restored by the user the next time the computer is powered<a href="http://www.msuiche.net/2008/02/26/sandman-10080226-is-out/">&#160;&#160;[ Read More ]</a>]]></description>
			<content:encoded><![CDATA[<p>Since Windows 2000, Microsoft provides a feature called <strong>Hibernation</strong> also know as suspend to disk that aims to save the system state into an <strong>undocumented file</strong> called <strong>hiberfil.sys</strong>. This file contains all the physical memory saved by the Operating System and aims to be restored by the user the next time the computer is powered on. Live forensics analysis is used to use <strong>physical memory dump</strong> to recover information on the targeted machine. One of the main problems is to obtain a readable physical memory dump, <strong>hibernation is an efficient way to save and load physical memory. </strong>Hibernation analysis has notable advantages. System activity is totally frozen, therefore coherent data is acquired and no software tool is able to block the analysis. The system is left perfectly functional after analysis, with no side effects.</p>
<p><strong>The hibernation file opens two valuable doors</strong>: The first one is <em>(live?)</em> <strong>forensics analysis</strong> for defensive computing. Hibernation is an efficient and easy way to get a physical memory dump. But the main issue about it was: How to read the <strong>hiberfil.sys</strong>? That’s how the idea of SandMan born. The second one is a new (<em>ou pas</em>) concept we will be introduced and called “<strong>offensics</strong>” which is a portmanteau from “offensive” and “forensics”. If we can read <strong>hiberfil.sys</strong>, can we rewrite it? The answer is: <em><strong>Yes, with SandMan you can.</strong></em></p>
<p><a href='http://www.msuiche.net/wp-content/uploads/2008/02/sandman_sample1.png' title='sample 2'><img src='http://www.msuiche.net/wp-content/uploads/2008/02/sandman_sample1.png' alt='sample 2' /></a></p>
<p>SandMan was firstly introduced at <strong>PacSec, Japan in November 2007</strong>, slides are available in the SandMan section. </p>
<p><strong>* SandMan</strong> provides a <strong>C Library</strong> and a <strong>Python portage</strong>.<br />
<font size="1"><br />
Here is a sample of implementation in Python.</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="co1">#!/usr/bin/python</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">#</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">#</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">#Module Name:</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co1"># </span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1"># &nbsp; &nbsp;sample1.py</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1"># </span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">#Abstract:</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1"># </span></div>
</li>
<li class="li2">
<div class="de2"><span class="co1"># &nbsp; &nbsp;- Display target version.</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1"># &nbsp; &nbsp;- Build a physical memory dump from a hibernation file.</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1"># </span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">#Environment:</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1"># </span></div>
</li>
<li class="li2">
<div class="de2"><span class="co1"># &nbsp; &nbsp;- Python</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1"># </span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">#Revision History:</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1"># </span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1"># &nbsp; &nbsp;- Matthieu Suiche</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co1"># </span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">import</span> <span class="kw3">sys</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">import</span> sandman</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2"><span class="kw1">if</span> <span class="kw2">len</span><span class="br0">&#40;</span><span class="kw3">sys</span>.<span class="me1">argv</span><span class="br0">&#41;</span> != <span class="nu0">3</span>:</div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="kw1">print</span> <span class="st0">&quot;Matthieu Suiche &#8211; http://sandman.msuiche.net/&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="kw1">print</span> <span class="st0">&quot;Usage: sample.py hiberfil.sys physical_dump.vmem&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="kw3">sys</span>.<span class="me1">exit</span><span class="br0">&#40;</span><span class="nu0">1</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">s = sandman.<span class="me1">hiber_open</span><span class="br0">&#40;</span><span class="kw3">sys</span>.<span class="me1">argv</span><span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">ver = sandman.<span class="me1">hiber_get_version</span><span class="br0">&#40;</span>s<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">print</span> <span class="st0">&quot;Windows version %d.%d.%d<span class="es0">\n</span>&quot;</span> % <span class="br0">&#40;</span>ver &amp; 0xFF, <span class="br0">&#40;</span>ver &amp; 0xFF00<span class="br0">&#41;</span> &gt;&gt; <span class="nu0">8</span>, ver &gt;&gt; <span class="nu0">16</span><span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">print</span> <span class="st0">&quot;Generate physical memory dump&#8230;&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">sandman.<span class="me1">hiber_dump</span><span class="br0">&#40;</span>s, <span class="kw3">sys</span>.<span class="me1">argv</span><span class="br0">&#91;</span><span class="nu0">2</span><span class="br0">&#93;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2"><span class="kw1">print</span> <span class="st0">&quot;Done.&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">sandman.<span class="me1">hiber_close</span><span class="br0">&#40;</span>s<span class="br0">&#41;</span></div>
</li>
</ol>
</div>
<p></font><br />
<strong>*</strong> Furthermore, SandMan is <strong>open-source</strong> and released under <i>GNU General Public License v3</i>, you can have further information on the <i>Google SVN</i> at the following link: <br /><a href="http://code.google.com/p/sandmanlib/">http://code.google.com/p/sandmanlib/</a>.</p>
<p><strong>*</strong> Actually, SandMan supports 32bits version of the hibernation file from <strong>Windows XP to Windows 2008 Server</strong></p>
<p><strong>To download SandMan, go to the section dedicaced to SandMan here:<br /> <a href="http://sandman.msuiche.net/">http://sandman.msuiche.net/</a>.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.msuiche.net/2008/02/26/sandman-10080226-is-out/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Windows Vista and unexported kernel symbols (Part II, 32bits version)</title>
		<link>http://www.msuiche.net/2007/01/31/windows-vista-and-unexported-kernel-symbols-part-ii-32bits-version/</link>
		<comments>http://www.msuiche.net/2007/01/31/windows-vista-and-unexported-kernel-symbols-part-ii-32bits-version/#comments</comments>
		<pubDate>Wed, 31 Jan 2007 21:31:22 +0000</pubDate>
		<dc:creator>Matthieu Suiche</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Reverse Engineering]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.msuiche.net/2007/01/31/windows-vista-and-unexported-kernel-symbols-part-ii-32bits-version/</guid>
		<description><![CDATA[This paper exposes part II of my previous article about Windows Vista and internals structures. This one is talking about the 32bits version and aims to show new authencity tricks. Download it from the following link: Windows_Vista_32bits_and_unexported_kernel_symbols.pdf Cheers,]]></description>
			<content:encoded><![CDATA[<p>This paper exposes part II of my previous article about Windows Vista and internals structures. This one is talking about the 32bits version and aims to show new authencity tricks.</p>
<p>Download it from the following link:<br />
<a href="http://www.msuiche.net/papers/Windows_Vista_32bits_and_unexported_kernel_symbols.pdf"> Windows_Vista_32bits_and_unexported_kernel_symbols.pdf</a></p>
<p>Cheers,</p>
]]></content:encoded>
			<wfw:commentRss>http://www.msuiche.net/2007/01/31/windows-vista-and-unexported-kernel-symbols-part-ii-32bits-version/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Windows Vista 64-bits and unexported kernel symbols.</title>
		<link>http://www.msuiche.net/2007/01/01/windows-vista-64-bits-and-unexported-kernel-symbols/</link>
		<comments>http://www.msuiche.net/2007/01/01/windows-vista-64-bits-and-unexported-kernel-symbols/#comments</comments>
		<pubDate>Mon, 01 Jan 2007 00:00:00 +0000</pubDate>
		<dc:creator>Matthieu Suiche</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Reverse Engineering]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.msuiche.net/?p=13</guid>
		<description><![CDATA[Hi, I&#8217;m gonna published my (the?) first paper of the year 2007 !! :) This article is talking about Windows Vista 64bits and its system structures which are proteged against rootkit. I also explain how these structures can be authentified without Pathguard. Windows Vista 64bits and unexported kernel symbols.pdf Happy New Year !!!]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>I&#8217;m gonna published my (the?) first paper of the year 2007 !! :)</p>
<p>This article is talking about Windows Vista 64bits and its system structures which are proteged against rootkit. I also explain how these structures can be authentified without Pathguard.</p>
<p><a href="http://www.msuiche.net/papers/Windows_Vista_64bits_and_unexported_kernel_symbols.pdf">Windows Vista 64bits and unexported kernel symbols.pdf</a></p>
<p>Happy New Year !!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.msuiche.net/2007/01/01/windows-vista-64-bits-and-unexported-kernel-symbols/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Vista&#8217;s WoW Path Redirection</title>
		<link>http://www.msuiche.net/2006/11/29/vistas-wow-path-redirection/</link>
		<comments>http://www.msuiche.net/2006/11/29/vistas-wow-path-redirection/#comments</comments>
		<pubDate>Wed, 29 Nov 2006 13:50:05 +0000</pubDate>
		<dc:creator>Matthieu Suiche</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Reverse Engineering]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.msuiche.net/?p=8</guid>
		<description><![CDATA[Windows Vista x64, is my first 64bits Operating System before it I never had been interested about 32-64bits compabilities. It started when I used the Daniel Pistelli&#8217;s tool called &#8220;Explorer Suite&#8221;,which is available at the following link : http://ntcore.com/download.php, I noticed that Windows Live Messenger, which is a x86 binary, is just linked by four<a href="http://www.msuiche.net/2006/11/29/vistas-wow-path-redirection/">&#160;&#160;[ Read More ]</a>]]></description>
			<content:encoded><![CDATA[<p>Windows Vista x64, is my first 64bits Operating System before it I never had been interested about 32-64bits compabilities. It started when I used the Daniel Pistelli&#8217;s tool called &#8220;Explorer Suite&#8221;,which is available at the following link : <a href="http://ntcore.com/download.php">http://ntcore.com/download.php</a>, I noticed that Windows Live Messenger, which is a x86 binary, is just linked by four dlls : </p>
<blockquote><p>C:\Windows\System32\ntdll.dll<br />
C:\Windows\System32\wow64.dll<br />
C:\Windows\System32\wow64win.dll<br />
C:\Windows\System32\wow64cpu.dll</p></blockquote>
<p>You know, I&#8217;m a very curious person that&#8217;s why I decided to disassemble these dlls. But when I opened the C:\Windows\System32\ I didn&#8217;t see any wow*.dll files except a wow32.dll which is a PE32 file format. I didn&#8217;t get what was going on, then I asked a friend about this problem. He kindly redirected me toward a Mark Russinovich&#8217;s post about a Windows 64bits article where is saying :<br />
However, I raninto a mechanism called folder redirection: when a 32-bit image accesses the \Windows\System32 directory theWow64 subsystem redirects it to \Windows\Syswow64 (think about that for a second: 64-bit binaries are in System32while 32-bit binaries are in Syswow64).<br />
Ohh ! Merci Mark ! My issue was solved but I wanted to know from where the hell this redirection is from. So I disassembled all wow*.dll then I found out the following functions in the wow64.dll : </p>
<blockquote><p>
Wow64LdrpInitialize (where are referenced &#8220;%s\\syswow64\\ntdll.dll&#8221;)<br />
Wow64pInitializeFilePathRedirection<br />
RedirectObjectName</p></blockquote>
<p>For people who are unfamiliar with x64 assembly please check that link : <a href="http://sandpile.org/aa64/reg.htm">http://sandpile.org/aa64/reg.htm</a>.<br />
Plus, we can see a debugging dll called wow64log.dll and very interesting references for system path and registry path : </p>
<blockquote><p>.text:0000000078C320D8                 dq offset aSystem32_0   ; &#8220;\\system32&#8243;<br />
[...]<br />
.text:0000000078C320E8                 dq offset aSyswow64     ; &#8220;\\SysWOW64&#8243;<br />
[...]<br />
.text:0000000078C320F8                 dq offset aLastgoodSystem ; &#8220;\\lastgood\\system32&#8243;<br />
[...]<br />
.text:0000000078C32108                 dq offset aLastgoodSyswow ; &#8220;\\lastgood\\SysWOW64&#8243;<br />
[...]<br />
.text:0000000078C32118                 dq offset aRegedit_exe  ; &#8220;\\regedit.exe&#8221;<br />
[...]<br />
.text:0000000078C32128                 dq offset aSyswow64Regedi ; &#8220;\\SysWOW64\\regedit.exe&#8221;<br />
[...]<br />
.text:0000000078C32138                 dq offset aKnowndlls    ; &#8220;\\KnownDlls&#8221;<br />
[...]<br />
.text:0000000078C32148                 dq offset aKnowndlls32  ; &#8220;\\KnownDlls32&#8243;<br />
[...]<br />
.text:0000000078C32158                 dq offset aSysnative    ; &#8220;\\sysnative&#8221;
</p></blockquote>
<p>We also have a kind of user-land SSDT, where the NtQueryDirectoryFile function is present. </p>
<blockquote><p>.data:0000000078C66340 sdwhnt32JumpTable dq offset whNtMapUserPhysicalPagesScatter<br />
.data:0000000078C66340                                         ; DATA XREF: .data:sdwhnt32<br />
.data:0000000078C66348                 dq offset whNtWaitForSingleObject<br />
.data:0000000078C66350                 dq offset whNtCallbackReturn<br />
.data:0000000078C66358                 dq offset whNtReadFile<br />
[...]<br />
.data:0000000078C664D0                 dq offset whNtQueryDirectoryFile
</p></blockquote>
<p>I don&#8217;t really did a full analysing of the DLL. As you see it was more an on the fly analyse, just to get a possible idea about the way uses by WoW to identify the redirection scheme.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.msuiche.net/2006/11/29/vistas-wow-path-redirection/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

