--- tags: 資安筆記 --- # Python Sandbox Escape 筆記 講師github(投影片也在上面):https://github.com/splitline/py-sandbox-escape * `execfile('/usr/lib/python2.7/os.py')`可以達到`import os`的效果 * `dir(__builtins__)` * 在跑`ssti.py`時,網址列可打成`/?name={{***}}`,裡面的`***`用python裡面的變數來取代(Jinja2的語法),直接丟`[].__class__.__base__.__subclasses__()`之類的東西 * 在解`final.py`時,`.__code__`可以用`.func_code`來取代 https://ctftime.org/writeup/10822 * 結論:python本來就不是拿來做sandbox的,如果真的要的話,就是在一個sandbox裡面跑python。