![173149a2341c161c25843f1292617c48.png](a4d7315b97a3400aa7026daa864d0edf.png)
Stuck in a python restricted environment with things like 'exec' and 'import' being filtered
![1ab36ac241b304fc1eefa57c863fbb15.png](e2682cf8396246bf92c3ebe0ecde0af3.png)
What about eval?
![60d686cb94077d7385d3a9daee755722.png](6c00b66ce2a24210aae522a20c40f029.png)
By breaking up the import so that the filter isn't picking it up and setting the eval to a variable that's not filtered, we can call system.
![1e45b5d8a9652705fe25b755bc31cbd6.png](a8a987cade2441f88090ef76652399bf.png)
Well, not technically escaped. To actually escape you would need to call bash
![e8693bb878c72583a248f820e5028724.png](e83d61eeaf6e422cb8677f655c68ea02.png)
---
Back to [[_WebSite Publish/CTF/CTF Index|CTF Index]]
Tags: #ctf #python #python_shell_escape
Related: