This repository demonstrates how the Python pickle module can be exploited.
TL;DR:
"Never unpickle data received from an untrusted or unauthenticated source."
~ Python's pickle module documentation
-
Write exploited pickle
# create an exploited pickle that will run the 'ls' command when the pickle is read python3 evil_pickle_writer.py
-
Read exploited pickle
# read the exploited pickle... notice that it will run the 'ls' command when reading the pickle python3 evil_pickle_reader.py
- https://blog.nelhage.com/2011/03/exploiting-pickle/ - This blog was very helpful in explaining how a pickle can be exploited in Python. The code in this repository was inspired by this article.
- https://media.blackhat.com/bh-us-11/Slaviero/BH_US_11_Slaviero_Sour_Pickles_WP.pdf - This is a good discussion related to the expoloitation of the pickle framework.