If this is being executed and I have full control over the string's value, am I able to leverage a reverse shell or am I able to read files.
exec("string", {'__builtins__': None})
I'm having issues with finding relevant documentation about what is not included __builtins__
. I've manually found that print('something')
works.
I, myself, lack the knowledge to determine whether this is exploitable or not. I feel like something like this shouldn't be safe since, correct me if I'm wrong, all builtins are python functions (Not confident on this).
I thought it might also be relevant referencing that a global variable was given as the 3rd argument. i.e: exec("string", {'__builtins__': None}, global_var)
Note: This is for python2. Note: This is for a challenge. No grey/black hat stuff!