Python Challenge level 20: “go away!”

Level 20 meant Chaos.

Hint 1: ‘unreal.jpg’, an image of a fence with the message “private property beyond this fence”
Hint 2: but inspecting it carefully is allowed.

As I said, this riddle was chaotic. Completely. Very interesting indeed, but it took some serious trial and error. From deeper inspection of the headers I got the following facts:

Fact 1: One of the headers is ‘Content-Range: bytes 0-30202/2123456789‘. I had to look for some info on this subject because I wasn’t familiar with it. Found some enlightenment in the appropriate RFC2616.

Fact 2: beyond the fence would be in the range 30203 – 2123456789. Such huge size is suspicous, so after trying a retrieval of the whole range at once, and after not getting any meanigful results, I stuck to getting some chunks along the stream. Some at the beginning of the fence boundary, some at the end of the range. There could be more interesting places between the values mentioned, by I do believe the most significant ones are retrieved in the following script.

Obviously I didn’t start with these values. I merely requested fragments from the beginning and the end of the stream, and selected the ones interesting for your convinience. I know, I know! I’m a nice guy, don’t mention it :-D

import urllib
url = 'http://butter:fly@www.pythonchallenge.com/pc/hex/unreal.jpg'

##Private info found
for i in [(30237,30337), (30284,30384), (30295,30395), (30313,30413),
            (2123456744,2123456788), (2123456712,2123456743)]:
    opener = urllib.FancyURLopener({})
    opener.addheader("range", "bytes=%d-%d" % i)
    f = opener.open(url)
    print f.read()

##Something hidden in this particular range.
opener = urllib.FancyURLopener({})
opener.addheader("range", "bytes=%d-%d" % (1152983631,1152983671))
f = opener.open(url)
print f.info()
open("20.zip", "w").write(f.read())

The relevant pieces of information I could come up with were:

Content-Range: bytes 30237-30283/2123456789
we can go on in this way for really long time.
Content-Range: bytes 30284-30294/2123456789
stop this!
Content-Range: bytes 30295-30312/2123456789
invader! invader!
Content-Range: bytes 30313-30346/2123456789
ok, invader. you are inside now.
Content-Range: bytes 2123456712-2123456743/2123456789
and it is hiding at 1152983631
Content-Range: bytes 2123456744-2123456788/2123456789
esrever ni emankcin wen ruoy si drowssap eht

To ‘be in’ must mean that this level has been solved. The catch is we don’t have an URL to refer to for level 21. Fortunately we do have a ZIP file. Discovering it’s misteries will be the next riddle, Level 21.

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>