pythonchallenge 20 code (python2.7)

absolutely lost...
reference:http://past.makto.me/post/2011-11-26/18573723

>>> import urllib
>>> web=urllib.urlopen('http://butter:fly@www.pythonchallenge.com/pc/hex/unreal.jpg')
>>> print web.info()
X-Powered-By: PHP/5.3.3-7+squeeze8
Content-Type: image/jpeg
Content-Range: bytes 0-30202/2123456789
Connection: close
Date: Fri, 07 Jun 2013 13:11:35 GMT
Server: lighttpd/1.4.28

>>> opener1=urllib.FancyURLopener()
>>> opener1.addheader('Range','bytes=30203-60404')
>>> temp1=opener1.open('http://butter:fly@www.pythonchallenge.com/pc/hex/unreal.jpg')
>>> print temp1
>
>>> print temp1.info()
X-Powered-By: PHP/5.3.3-7+squeeze8
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
Content-Range: bytes 30203-30236/2123456789
Content-Length: 34
Connection: close
Date: Fri, 07 Jun 2013 13:12:42 GMT
Server: lighttpd/1.4.28

>>> print temp1.read()
Why don't you respect my privacy?

>>> opener2.addheader('Range','bytes=30237-40000')
>>> temp2=opener2.open('http://butter:fly@www.pythonchallenge.com/pc/hex/unreal.jpg')
>>> print temp2.info()
X-Powered-By: PHP/5.3.3-7+squeeze8
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
Content-Range: bytes 30237-30283/2123456789
Content-Length: 47
Connection: close
Date: Fri, 07 Jun 2013 13:17:18 GMT
Server: lighttpd/1.4.28

>>> print temp2.read()
we can go on in this way for really long time.
>>> opener3=urllib.FancyURLopener()
>>> opener3.addheader('Range','bytes=30284-40000')
>>> temp3=opener3.open('http://butter:fly@www.pythonchallenge.com/pc/hex/unreal.jpg')
>>> print temp3.info()
X-Powered-By: PHP/5.3.3-7+squeeze8
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
Content-Range: bytes 30284-30294/2123456789
Content-Length: 11
Connection: close
Date: Fri, 07 Jun 2013 13:21:11 GMT
Server: lighttpd/1.4.28

>>> print temp3.read()
stop this!
>>> opener4=urllib.FancyURLopener()
>>> opener4.addheader('Range','bytes=30295-40000')
>>> temp4=opener4.open('http://butter:fly@www.pythonchallenge.com/pc/hex/unreal.jpg')
>>> print temp4.info()
X-Powered-By: PHP/5.3.3-7+squeeze8
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
Content-Range: bytes 30295-30312/2123456789
Content-Length: 18
Connection: close
Date: Fri, 07 Jun 2013 13:22:59 GMT
Server: lighttpd/1.4.28

>>> print temp4.read()
invader! invader!
>>> opener5=urllib.FancyURLopener()
>>> opener5.addheader('Range','bytes=30313-40000')
>>> temp5=opener5.open('http://butter:fly@www.pythonchallenge.com/pc/hex/unreal.jpg')
>>> print temp5.info()
X-Powered-By: PHP/5.3.3-7+squeeze8
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
Content-Range: bytes 30313-30346/2123456789
Content-Length: 34
Connection: close
Date: Fri, 07 Jun 2013 13:24:01 GMT
Server: lighttpd/1.4.28

>>> print temp5.read()
ok, invader. you are inside now.
>>> opener=urllib.FancyURLopener()
>>> opener.addheader('Range','bytes=2123456720-2123456789')
>>> temp=opener.open('http://butter:fly@www.pythonchallenge.com/pc/hex/unreal.jpg')
>>> print temp.info()
X-Powered-By: PHP/5.3.3-7+squeeze8
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
Content-Range: bytes 2123456712-2123456743/2123456789
Content-Length: 32
Connection: close
Date: Fri, 07 Jun 2013 13:27:07 GMT
Server: lighttpd/1.4.28

>>> print temp.read()
and it is hiding at 1152983631.
>>> opener=urllib.FancyURLopener()
>>> opener.addheader('Range','bytes=2123456744-2123456789')
>>> temp=opener.open('http://butter:fly@www.pythonchallenge.com/pc/hex/unreal.jpg')
>>> print temp.info()
X-Powered-By: PHP/5.3.3-7+squeeze8
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
Content-Range: bytes 2123456744-2123456788/2123456789
Content-Length: 45
Connection: close
Date: Fri, 07 Jun 2013 13:39:22 GMT
Server: lighttpd/1.4.28

>>> print temp.read()
esrever ni emankcin wen ruoy si drowssap eht
>>> opener=urllib.FancyURLopener()
>>> opener.addheader('Range','bytes=1152983631-1152983660')
>>> temp=opener.open('http://butter:fly@www.pythonchallenge.com/pc/hex/unreal.jpg')
>>> print temp.read()
PK
>>> temp=opener.open('http://butter:fly@www.pythonchallenge.com/pc/hex/unreal.jpg')
>>> msg=temp.read()
>>> open('msg.zip','w').write(msg)

the password is 'redavni'
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值