4 ms·
Ah, interesting. File system access isn't blocked completely: __import__("os").listdir("/evaluate") open("/evaluate/test.py").readlines()
by phleet 14y ago
Ah, interesting.
File system access isn't blocked completely:
__import__("os").listdir("/evaluate")
open("/evaluate/test.py").readlines()
- emillon 14y agoExecv'ing processes is OK as long as you don't fork: __import__("os").execv("/usr/bin/uname", ["uname", "-a"]) Linux ip-10-196-3-111 2.6.32-amazon-xen-r3 #1 SMP Mon Jan 16 21:03:16 PST 2012 i686 GNU/Linux As for the actual files, there are a few clues that a chroot is created for every request : /proc is not mounted, /etc is minimal (root + 1 user in passwd) and "ls -id /" returns a new inode number every time.
- tdinkar 14y agoYeah, we are using chroot (along with other things) to sandbox things on a per request basis. - Tejas from Team PythonMonk (I built the sandboxing stuff)
- SEJeff 14y ago__import__("os").execv("/usr/bin/env", ["env"]) Gives you a few clues as well
- stringfellow 14y agoadam.py... :) If only I knew more about bytecode... import inspect import pprint pp = pprint.PrettyPrinter(depth=6) f = inspect.currentframe() c = 0 while f is not None: c += 1 if c == 20: print f.f_code pp.pprint(dict(inspect.getmembers(f.f_code))) f = f.f_back