<?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>Phocean.net / Computer Security &#187; Assembler / Reversing</title>
	<atom:link href="http://www.phocean.net/category/security/assembler-reversing/feed" rel="self" type="application/rss+xml" />
	<link>http://www.phocean.net</link>
	<description>&#34;A defense that hedgehogs possess is the ability to roll into a tight ball, causing all of the spines to point outwards.&#34; -- Wikipedia</description>
	<lastBuildDate>Wed, 30 Nov 2011 22:02:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Debugging the CrashMe program</title>
		<link>http://www.phocean.net/2011/11/30/debugging-the-crashme-program.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=debugging-the-crashme-program</link>
		<comments>http://www.phocean.net/2011/11/30/debugging-the-crashme-program.html#comments</comments>
		<pubDate>Wed, 30 Nov 2011 22:02:47 +0000</pubDate>
		<dc:creator>phocean</dc:creator>
				<category><![CDATA[Assembler / 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>
		<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>
			<wfw:commentRss>http://www.phocean.net/2011/11/30/debugging-the-crashme-program.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debugging the MBR with IDA Pro and Bochs</title>
		<link>http://www.phocean.net/2011/01/20/debugging-the-mbr-with-ida-pro-and-bochs.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=debugging-the-mbr-with-ida-pro-and-bochs</link>
		<comments>http://www.phocean.net/2011/01/20/debugging-the-mbr-with-ida-pro-and-bochs.html#comments</comments>
		<pubDate>Thu, 20 Jan 2011 19:57:46 +0000</pubDate>
		<dc:creator>phocean</dc:creator>
				<category><![CDATA[Assembler / Reversing]]></category>
		<category><![CDATA[Malware forensics]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Assem]]></category>
		<category><![CDATA[Bochs]]></category>
		<category><![CDATA[Bootkit]]></category>
		<category><![CDATA[Debugger]]></category>
		<category><![CDATA[Forensics]]></category>
		<category><![CDATA[IDA Pro]]></category>
		<category><![CDATA[malware]]></category>
		<category><![CDATA[MBR]]></category>

		<guid isPermaLink="false">http://www.phocean.net/?p=980</guid>
		<description><![CDATA[Analyzing the MBR is sometimes required during a forensic process, if you suspect a malicious activity that is not detected on-line. With static analysis, you may see if an obvious corruption happened, but you will need to debug to learn more. Prerequisite : IDA Pro (6.0) with the IDA Python plug-in (1.4.3) Steps : Prepare [...]]]></description>
			<content:encoded><![CDATA[<p>Analyzing the MBR is sometimes required during a forensic process, if you suspect a malicious activity that is not detected on-line. With static analysis, you may see if an obvious corruption happened, but you will need to debug to learn more.</p>
<h2>Prerequisite :</h2>
<ul>
<li>IDA Pro (6.0) with the IDA Python plug-in (1.4.3)</li>
</ul>
<h2>Steps :</h2>
<ol>
<li>Prepare your forensic disk image.<br />
In general, it is that simple :</p>
<pre>$ dd if=&lt;source&gt; of=disk.img bs=65536 conv=noerror</pre>
<p>Or :</p>
<pre>$ ddrescue -n &lt;source&gt; &lt;dest&gt; file.log</pre>
<p>Check the disk geometry using :</p>
<pre>$ fdisk -luc disk.img</pre>
<p>These values will be useful for step 5.<br />
However, if you have an exotic disk, it may be much trickier. For example, I got some geometry errors with a flash disk when using Bochs at step 11. Special thanks to Gene Cumm from the bochs-developpers mailing list who gave me the tip to specify the geometry to dd :</p>
<pre>$ dd if=input of=output bs=2064384 count=507</pre>
</li>
<p>Refer to <a title="CHS" href="http://en.wikipedia.org/wiki/Cylinder-head-sector" target="_blank">CHS</a> if you wonder how to get these values.</p>
<li>Extract the MBR from the disk or from the image you just took.
<pre>$ dd if=&lt;source&gt; of=mbr.dump bs=512 count=5</pre>
</li>
<li>Download and install the <a title="Bochs emulator" href="http://bochs.sourceforge.net/" target="_blank">Bochs x86-64 emulator</a>, which comes with a debugger that will work nicely with IDA.</li>
<li>Download <a title="MBR Bochs scripts" href="http://hexblog.com/ida_pro/files/mbr_bochs.zip" target="_self">this archive</a> from Hexblog (IDA Pro&#8217;s blog). We will use two files from there : <em>bochrc</em>, wich is the configuration file for Bochs, and <em>mbr.py</em> which a python file helpful from preparing the debugging environment.</li>
<li> Copy <em>bochrc</em> in your working directory and edit the following line to match your disk image geometry :
<pre>ata0-master: type=disk, path="sdb.img", mode=flat, cylinders=507, heads=64, spt=63</pre>
<p>Before going on, you may test that Bochs can use the image with these settings :</p>
<pre>C:\&gt;"c:\Program Files\Bochs-2.4.5\bochsdbg.exe" -f bochsrc -q</pre>
</li>
<li>In the same directory, copy <em>mbr.py</em> and edit the following settings :
<pre># Some constants
SECTOR_SIZE = 512
BOOT_START  = 0x7C00
BOOT_SIZE   = 0x7C00 + SECTOR_SIZE * 4
BOOT_END    = BOOT_START + BOOT_SIZE
SECTOR2     = BOOT_START + SECTOR_SIZE
MBRNAME    = "mbr.img"
IMGNAME     = "sdb.img"</pre>
</li>
<li>Now open a console and type :
<pre>C:\&gt; mbr update</pre>
</li>
<li>With IDA Pro, open the <em>boshrc</em> file. IDA should recognize the format and set the proper settings.</li>
<li>From the menu, open <em>File/Script File</em> and select <em>mbr.py</em>. It will close IDA after execution.</li>
<li>Open again your <em>*.idb</em> file, set a breakpoint at <em>0x7C00</em>.</li>
<li>Start the debugger.</li>
</ol>
<p>You should now be able to go ahead and debug the MBR step by step.</p>
<p><img class="aligncenter size-full wp-image-996" title="ida-mbr" src="http://www.phocean.net/wp-content/uploads/2011/01/ida-mbr.png" alt="" width="600" height="546" /></p>
<h2>References :</h2>
<ul>
<li>Hexblog : <a title="Develop your master boot record and debug it with IDA Pro and the Bochs debugger " href="http://www.hexblog.com/?p=103" target="_blank">Develop your master boot record and debug it with IDA Pro and the Bochs debugger plugin</a></li>
<li>MISC Magazine #53 : Votre MBR pris en otage ! &#8211; Nicolas Brulez (Kaspersky labs)</li>
<li>Bochs User Manual : <a title="Bochs tips and techniques" href="http://bochs.sourceforge.net/doc/docbook/user/howto.html#AEN2776" target="_blank">Chapter 8, Tips and Techniques</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.phocean.net/2011/01/20/debugging-the-mbr-with-ida-pro-and-bochs.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>EMET: configure memory protection on Windows</title>
		<link>http://www.phocean.net/2010/09/25/emet-configure-memory-protection-on-windows.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=emet-configure-memory-protection-on-windows</link>
		<comments>http://www.phocean.net/2010/09/25/emet-configure-memory-protection-on-windows.html#comments</comments>
		<pubDate>Sat, 25 Sep 2010 15:56:00 +0000</pubDate>
		<dc:creator>phocean</dc:creator>
				<category><![CDATA[Assembler / Reversing]]></category>
		<category><![CDATA[Defense]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[ALSR]]></category>
		<category><![CDATA[buffer overflow]]></category>
		<category><![CDATA[DEP]]></category>
		<category><![CDATA[EMET]]></category>
		<category><![CDATA[SEHOP]]></category>

		<guid isPermaLink="false">http://www.phocean.net/?p=911</guid>
		<description><![CDATA[Microsoft published a nice tool named EMET (Enhanced Mitigation Experience Toolkit) whose purpose is to check and enforce the memory security policies such as ALSR and DEP. It shows and allows to configure the global settings, but also, and this is the most interesting part, indicated for each process running if it supports those security [...]]]></description>
			<content:encoded><![CDATA[<p>Microsoft published a nice tool named <a title="EMET" href="http://www.microsoft.com/downloads/en/confirmation.aspx?FamilyID=c6f0a6ee-05ac-4eb6-acd0-362559fd2f04" target="_blank">EMET</a> (Enhanced Mitigation Experience Toolkit) whose purpose is to check and enforce the memory security policies such as ALSR and DEP.</p>
<p>It shows and allows to configure the global settings, but also, and this is the most interesting part, indicated for each process running if it supports those security measures. It is even able to enforce the protections for each application which would not support it natively (i.e. not set at compilation time).</p>
<p style="text-align: center;"><img class="aligncenter" title="EMET" src="http://www.phocean.net/wp-content/uploads/2010/09/EMET.png" alt="" width="640" height="360" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phocean.net/2010/09/25/emet-configure-memory-protection-on-windows.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Removing executable password protection</title>
		<link>http://www.phocean.net/2009/12/18/removing-executable-password-protection.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=removing-executable-password-protection</link>
		<comments>http://www.phocean.net/2009/12/18/removing-executable-password-protection.html#comments</comments>
		<pubDate>Fri, 18 Dec 2009 08:41:25 +0000</pubDate>
		<dc:creator>phocean</dc:creator>
				<category><![CDATA[Assembler / Reversing]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Assembler]]></category>
		<category><![CDATA[Reverse Engeniering]]></category>

		<guid isPermaLink="false">http://www.phocean.net/?p=573</guid>
		<description><![CDATA[Nice demo there.]]></description>
			<content:encoded><![CDATA[<p>Nice demo <a title="Removing executable password protection" href="http://blog.reversinglabs.com/2009/12/exe-password-protection/">there</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phocean.net/2009/12/18/removing-executable-password-protection.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

