<?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>ReversingLabs &#124; Blog &#187; GZIP</title>
	<atom:link href="http://blog.reversinglabs.com/tag/gzip/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.reversinglabs.com</link>
	<description>Everything in reverse...</description>
	<lastBuildDate>Sat, 02 Jul 2011 10:53:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>Sophos decodeme at AusCERT</title>
		<link>http://blog.reversinglabs.com/2010/05/decodeme/</link>
		<comments>http://blog.reversinglabs.com/2010/05/decodeme/#comments</comments>
		<pubDate>Sun, 23 May 2010 15:05:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Reversing]]></category>
		<category><![CDATA[Base64]]></category>
		<category><![CDATA[GIF]]></category>
		<category><![CDATA[GZIP]]></category>

		<guid isPermaLink="false">http://blog.reversinglabs.com/?p=633</guid>
		<description><![CDATA[Being the huge file analysis geeks (you must be shocked by this, we know) that we are, we couldn't help solving the more than interesting #decodeme challenge from Sophos at this years AusCert. The challenge itself was printed on a T-Shirt and the puzzle looked exactly like this: %~~~~~~~~~~~~~~~~~~~~~~~~% &#124;H4sIAAAAAAACA3P3dLOwTOxh&#124; &#124;YGF4zsBg7tHJMApGwYgE////&#124; &#124;V/zJwsjF8I9BB8QH5QkGjhYG&#124; &#124;xj/MD' gULH&#124; &#124;JrY' [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Being the huge file analysis geeks (<em>you must be shocked by this, we know</em>) that we are, we couldn't help solving the more than interesting #<a href="http://www.sophos.com/blogs/duck/g/2010/05/16/decodeme-t-shirt-tex/" target="_blank">decodeme</a> challenge from <a href="http://www.sophos.com" target="_blank">Sophos</a> at this years <a href="http://conference.auscert.org.au/conf2010/" target="_blank">AusCert</a>. The challenge itself was printed on a <a href="http://www.sophos.com/blogs/duck/g/2010/05/15/sophos-auscert-decodeme/" target="_blank">T-Shirt</a> and the puzzle looked exactly like this:</p>
<blockquote>
<pre>%~~~~~~~~~~~~~~~~~~~~~~~~%
|H4sIAAAAAAACA3P3dLOwTOxh|
|YGF4zsBg7tHJMApGwYgE////|
|V/zJwsjF8I9BB8QH5QkGjhYG|
|xj/MD'              gULH|
|JrY'                BbVi|
|Tlx|   Y4NgmoOxWoxH4yL5d|
|VDR|   oTseHh8f6WK359lQU|
|qJy\              \YJOGt|
|xhN5I\              \dlr|
|qoJvnIznRDXvHjPWZ   |SY7|
|Lz31nKtYPklkV0F6w   |AKr|
|1E17                ,Vk5|
|afng              ,hp63R|
|VsvNzy8u9qpU670lon11hvnS|
|KNWuSS+vrvNf3HV05beU0NXB|
|p71kJQQYrAFt8kQCpwMAAA==|
%~~~~~~~~~~~~~~~~~~~~~~~~%
  D  E  C  O  D  E  M  E
</pre>
</blockquote>
<p style="text-align: justify;">We are pretty sure that "S" stands for Sophos not Superman. Now, the first thing that comes to mind when you look at the "picture" is that the data around the "S" is important. And if we look at the last two letters we see the <a href="http://en.wikipedia.org/wiki/Base64" target="_blank">base64</a> trademark signature. Which means that all that data is an encoded message or a file. To decode it, we must strip that "S" to form a proper base64 data chain. Once done, the data looks like this:</p>
<blockquote><p>H4sIAAAAAAACA3P3dLOwTOxhYGF4zsBg7tHJMApGwYgE////V/zJwsj<br />
F8I9BB8QH5QkGjhYGxj/MDgULHJrYBbViTlxY4NgmoOxWoxH4yL5dVD<br />
RoTseHh8f6WK359lQUqJyYJOGtxhN5IdlrqoJvnIznRDXvHjPWZSY7L<br />
z31nKtYPklkV0F6wAKr1E17Vk5afnghp63RVsvNzy8u9qpU670lon11<br />
hvnSKNWuSS+vrvNf3HV05beU0NXBp71kJQQYrAFt8kQCpwMAAA==</p></blockquote>
<p style="text-align: justify;">That data must be reverted to either text or binary to continue. First, we tried  an online <a href="http://www.motobit.com/util/base64-decoder-encoder.asp" target="_blank">base64 decoder</a> but it returns a very strange string. So then, we decoded the data to a binary file and opened that with a hex editor, where we see the well known 0x1F 0x8B signature, which indicates that the decoded data is in fact a <a href="http://en.wikipedia.org/wiki/Gzip" target="_blank">GZIP</a> file. Now, we know GZip files may or may not store a file name, so when we decompress the packed data we do another hex data inspection to discover that the decompressed file is a <a href="http://en.wikipedia.org/wiki/Gif" target="_blank">GIF</a> file. It's an image showing us this:<a href="http://blog.reversinglabs.com/wp-content/uploads/2010/05/base64.gif" rel="lightbox[633]"><img title="Base64" src="http://blog.reversinglabs.com/wp-content/uploads/2010/05/base64.gif" alt="" width="140" height="4" /></a> Not quite readable, but once you zoom in on it, and lower-case it, it points to: <a href="http://www.sophos.com/anz/sofarsogood.html" target="_blank">http://www.sophos.com/anz/sofarsogood.html</a> which holds the last piece of the puzzle.</p>
<p style="text-align: justify;">Sadly last piece of the puzzle has nothing to do with file analysis whatsoever. Its a crypto challenge requiring you to play with letter substitution crypto algorithms. And this isn't something we are really interested in. You are however more than welcome to fiddle with it if you like. For some help on solving it check <a href="http://community.websense.com/blogs/securitylabs/archive/2010/05/20/a-simple-n-gram-calculator-pyngram.aspx" target="_blank">this</a> out. Until next week...</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.reversinglabs.com%2F2010%2F05%2Fdecodeme%2F&amp;title=Sophos%20decodeme%20at%20AusCERT" id="wpa2a_2"><img src="http://blog.reversinglabs.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.reversinglabs.com/2010/05/decodeme/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Its just bits and bytes&#8230;</title>
		<link>http://blog.reversinglabs.com/2010/04/archive-conversion/</link>
		<comments>http://blog.reversinglabs.com/2010/04/archive-conversion/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 15:19:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[NyxEngine]]></category>
		<category><![CDATA[GZIP]]></category>
		<category><![CDATA[ZIP]]></category>

		<guid isPermaLink="false">http://blog.reversinglabs.com/?p=545</guid>
		<description><![CDATA[Two weeks ago we introduced our NyxEngine to the World and we got nothing but positive comments and responses about it. That is why for today's blog we have decided make it do something its not primarily designed to do. With that in mind we decided to create a simple program based on the NyxEngine [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://blog.reversinglabs.com/wp-content/uploads/2010/04/NyxEngine-vector.png" rel="lightbox[545]"><img class="aligncenter size-full wp-image-515" title="NyxEngine-vector" src="http://blog.reversinglabs.com/wp-content/uploads/2010/04/NyxEngine-vector.png" alt="" width="250" height="203" /></a></p>
<p style="text-align: justify;">Two weeks ago we introduced our <em><a href="http://blog.reversinglabs.com/2010/04/introducing-nyxengine/">NyxEngine</a></em> to the World and we got nothing but positive comments and responses about it. That is why for today's blog we have decided make it do something its not primarily designed to do. With that in mind we decided to create a simple program based on the <em>NyxEngine </em>which does <a href="http://archivconvert.sourceforge.net/" target="_blank">archive conversion</a> from one file type to another. For the purpose of this blog we designed the program called gzip2zip which as its name implies converts <a href="http://en.wikipedia.org/wiki/Gzip" target="_blank">GZIP</a> archives to <a href="http://en.wikipedia.org/wiki/ZIP_%28file_format%29" target="_blank">ZIP</a> ones without any sort of decompression/compression procedure involved. And this is possible only do to the fact that both ZIP and GZIP use <a href="http://en.wikipedia.org/wiki/DEFLATE" target="_blank">DEFLATE</a> compression algorithm which is why no data manipulation other than moving is necessary. In order to do a quick conversion we need to perform the following steps:</p>
<ul>
<li>Read GZIP data (file name, packed content &amp; size and unpacked content size &amp; CRC)</li>
<li>Recreate ZIP header data in memory (recreate local and central directories)</li>
<li>Write data to disk</li>
</ul>
<p style="text-align: justify;">This is quite a short and simple checklist which is why creation of such program is a relatively simple task. Reverse process is also possible and just as easy to create but since the ZIP file format is more popular we decided to stop at one way conversion. Until next week....</p>
<p><!-- Facebook Badge START --></p>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="150" align="center" valign="middle"><a href="http://www.facebook.com/pages/NyxEngine/101460583240402" target="_TOP" style="font-family: &quot;lucida grande&quot;,tahoma,verdana,arial,sans-serif; font-size: 11px; font-variant: normal; font-style: normal; font-weight: normal; color: #3B5998; text-decoration: none;" title="NyxEngine">NyxEngine</a><br/><a href="http://www.facebook.com/pages/NyxEngine/101460583240402" target="_TOP" title="NyxEngine"><img src="http://badge.facebook.com/badge/101460583240402.92.1401198119.png" width="120" height="146" style="border: 0px;" /></a><br />
<a style="font-family: &amp;amp;quot; font-size: 11px; font-variant: normal; font-style: normal; font-weight: normal; color: #3b5998; text-decoration: none;" title="" href="http://www.reversinglabs.com" target="_TOP">ReversingLabs Corporation</a></td>
<td width="450" align="center" valign="middle"><a href="http://blog.reversinglabs.com/wp-content/uploads/2010/04/gzip2zip.zip">GZip2Zip</a><br />
(package contains the tool with source and the samples  used</td>
</tr>
</table>
<p><!-- Facebook Badge END --></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.reversinglabs.com%2F2010%2F04%2Farchive-conversion%2F&amp;title=Its%20just%20bits%20and%20bytes%26%238230%3B" id="wpa2a_4"><img src="http://blog.reversinglabs.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.reversinglabs.com/2010/04/archive-conversion/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

