<?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; Challenge</title>
	<atom:link href="http://blog.reversinglabs.com/tag/challenge/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>ReversingLabs Summer Challenge</title>
		<link>http://blog.reversinglabs.com/2010/07/reversinglabs-summer-challenge/</link>
		<comments>http://blog.reversinglabs.com/2010/07/reversinglabs-summer-challenge/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 17:28:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[Reversing]]></category>
		<category><![CDATA[ReversingLabs]]></category>
		<category><![CDATA[Challenge]]></category>
		<category><![CDATA[NyxEngine]]></category>

		<guid isPermaLink="false">http://blog.reversinglabs.com/?p=770</guid>
		<description><![CDATA[Looks cool? Want one? All you have to do is solve this challenge and tell us what is the password we seek. Sounds easy? Its not... Mail us with your solution at: blog(at)reversinglabs(dot)com; Challenge is now closed! Thanks to everyone who participated. Click read more for the solution... We didn't even dream about getting so [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://blog.reversinglabs.com/wp-content/uploads/2010/07/124829145.jpg" rel="lightbox[770]"><img class="size-full wp-image-597 alignnone" title="TShirt" src="http://blog.reversinglabs.com/wp-content/uploads/2010/07/124829145.jpg" alt="" width="630" height="261" /></a></p>
<p style="text-align: justify;">Looks cool? Want one? All you have to do is solve this <a href="http://blog.reversinglabs.com/wp-content/uploads/2010/07/r.zip">challenge</a> and tell us what is the password we seek. Sounds easy? Its not... Mail us with your solution at: blog(at)reversinglabs(dot)com; <strong>Challenge is now closed! Thanks to everyone who participated. Click read more for the solution...<br />
</strong></p>
<p><span id="more-770"></span></p>
<p style="text-align: justify;">We didn't even dream about getting so many people to participate in our little challenge. The sheer number of emails simply flooded our mailbox with possible solutions and compliments about  our challenge! One of those compliments expresses just what we want to do in the not-so-distant future, we quote: "<em>Fun challenge, do more of  these!</em>" We definitely will!</p>
<p style="text-align: justify;">Now to the solution, and discussion of the parts that proved troublesome for many...</p>
<p style="text-align: justify;">We start by downloading the file and doing our initial analysis. Since the file is a <a href="http://en.wikipedia.org/wiki/ZIP_%28file_format%29" target="_blank">ZIP</a> archive we open it with any program that works with this archive format to find a folder named "r" with the file named "r.zip" in it. This part of the challenge is just a decoy to keep you busy and distracted from the real content which is appended to the archive as an archive comment. That real content is another archive in <a href="http://en.wikipedia.org/wiki/7-Zip" target="_blank">7Zip</a> file format, which once extracted produces a single <a href="http://en.wikipedia.org/wiki/Cabinet_%28file_format%29" target="_blank">CAB</a> file, and that is where the things get interesting. The CAB file has a single <a href="http://en.wikipedia.org/wiki/PNG" target="_blank">PNG</a> file in it, but to solve this challenge we must observe the image and the archive as two separate objects.</p>
<p style="text-align: justify;">First the image part of the puzzle. The image, once opened, shows a normal picture with the logo of our company. However the picture itself has embedded <a href="http://en.wikipedia.org/wiki/Steganography" target="_blank">steganography</a> data. Since we didn't want to do any hard stego which can be solved by inspecting image pixels we embedded our hidden information between valid records inside the PNG file header. Something very similar to what we demonstrated on <a href="http://www.blackhat.com/html/bh-eu-10/bh-eu-10-briefings.html#Vuksan" target="_blank">BlackHat Barcelona</a> earlier this year. With the obvious difference that the file format is an image not an archive. Nonetheless the principle is the same. So, what's hidden? If you open the image file with any hex editor you will see a string "pSWD" near the start of the file. That string is followed by a 16 number sequence: 538B327278BBAB654747288999FBCDA1 which isn't the password we need. Nope, its not - even though many of you thought that that was the end solution. Why isn't it?</p>
<p style="text-align: justify;">Because of the fact that the CAB file that compressed that PNG image holds the last piece of the puzzle. If we scan that CAB file with our <a href="http://www.reversinglabs.com/products/NyxEngine.php" target="_blank">NyxEngine</a> we get the following output:</p>
<blockquote><p>Steganography ID: 0x00000b<br />
Possible steganography due to suspicious CAB extra data present between entries!<br />
Data start: 0x5a; Data size: 0x0000f6</p></blockquote>
<p style="text-align: justify;">And in that data there is the following text block:</p>
<blockquote>
<p style="text-align: justify;">UmFyIRoHAM6Zc4AADQAAAAAAAAA8MSAOyRZcWCVhcEFcUfp<br />
P4JdbtU2derwgjSYp+BpxVYkWJPDtQ/TITifo4qO7qyYz+yLpd9+6<br />
nkwwxmomWHbHK0Bt6UPHOwL/pEKm6IGXo/5dioeP66Fq5brTldgi<br />
Z7do5bbFjykQIsx6PMCBre4iUJ7jcwrwD2MDs69XwuuHL+fMKy9hD<br />
UJQPDEgDskWXFjp6jPWFXoWVSNb4H1zjQpW</p>
</blockquote>
<p style="text-align: justify;">Which is, in fact, a <a href="http://en.wikipedia.org/wiki/Base64" target="_blank">base64</a> encoded password protected <a href="http://en.wikipedia.org/wiki/RAR" target="_blank">RAR</a> file. But, what's the password? The password is the PNG image number sequence converted to lower case text. So, its: <a href="http://www.google.com/search?q=538b327278bbab654747288999fbcda1" target="_blank">538b327278bbab654747288999fbcda1</a> which isn't an MD5 and needs not to be bruteforced. Once its entered and the RAR file is decrypted we can see the file named "file" containing the following text: "Password is: <a href="http://www.google.com/search?q=9ec4c12949a4f31474f299058ce2b22a" target="_blank">9ec4c12949a4f31474f299058ce2b22a</a>". And that's it, the challenge is successfully completed at that point. No more stego or hidden files.</p>
<p style="text-align: justify;">There are six accepted solutions to this challenge, but the one that simply astonished us is the following python script which solves our challenge:</p>
<blockquote><p>#! /usr/bin/env python<br />
URL="<a href="http://blog.reversinglabs.com/wp-content/uploads/2010/07/r.zip" target="_blank">http://blog.reversinglabs.com/wp-content/uploads/2010/07/r.zip</a>"</p>
<p>import os<br />
import urllib2<br />
import struct</p>
<p>os.chdir("/tmp")<br />
rzip=urllib2.urlopen("<a href="http://blog.reversinglabs.com/wp-content/uploads/2010/07/r.zip" target="_blank">http://blog.reversinglabs.com/wp-content/uploads/2010/07/r.zip</a>").read()<br />
r7z = rzip[rzip.find("7z"):]<br />
open("r.7z","w").write(r7z)<br />
os.system("7z e r.7z")<br />
cab = open("puzzle.cab").read()<br />
os.system("cabextract puzzle.cab")<br />
open("r.rar","w").write(cab[0x5a:0x5a+250].decode("base64"))<br />
png = open("ReversingLabs.png").read()<br />
ppos = png.find("pSWD")<br />
sz, = struct.unpack("&gt;I", png[ppos-4:ppos])<br />
pwd = png[ppos+4:ppos+4+sz]<br />
os.system("unrar e -P%s r.rar" % pwd.encode("hex"))<br />
print open("file").read()</p></blockquote>
<p style="text-align: justify;">Thanks to everyone who participated in our little competition. Winners, your T-shirts are in the mail. Until our next challenge...</p>
<p><!-- Facebook Badge START --></p>
<table border="0" cellspacing="0" cellpadding="0" width="600" align="center">
<tbody>
<tr>
<td width="150" align="center" valign="middle"><a style="font-family: &amp;amp;amp; font-size: 11px; font-variant: normal; font-style: normal; font-weight: normal; color: #3b5998; text-decoration: none;" title="NyxEngine" href="http://www.facebook.com/pages/NyxEngine/101460583240402" target="_TOP">NyxEngine</a><br />
<a title="NyxEngine" href="http://www.facebook.com/pages/NyxEngine/101460583240402" target="_TOP"><img style="border: 0px;" src="http://badge.facebook.com/badge/101460583240402.92.1401198119.png" alt="" width="120" height="146" /></a><br />
<a style="font-family: &amp;amp;amp; font-size: 11px; font-variant: normal; font-style: normal; font-weight: normal; color: #3b5998; text-decoration: none;" href="http://www.reversinglabs.com" target="_TOP">ReversingLabs Corporation</a></td>
<td width="450" align="center" valign="middle">Our challenge got beaten by our own NyxEngine! Oh, Nyx...</td>
</tr>
</tbody>
</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%2F07%2Freversinglabs-summer-challenge%2F&amp;title=ReversingLabs%20Summer%20Challenge" 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/07/reversinglabs-summer-challenge/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

