The Python pickle Module

In a Deep Dive course Part III by Fred Baptiste I learned about the pickle module in Python. However, I wanted to get a deeper understanding of the subject. Therefore, I took additional tutorials on this subject. o The first tutorial “The Python pickle Module: How to Persist Objects in Python” by Davide Mastromatteo at Real Python. In this tutorial, I learned: • Serialization in Python • Inside the Python pickle Module • How to use pickled object to restore the changed object • Protocol Formats of the Python pickle Module • Also how to use `__getstate__()`, and `__setstate__()` with pickle module for unserialized objects • How to serialize interpreter sessions • What can be pickled and unpickled? • Compression of Pickled Objects • Security Concerns With the Python pickle Module. You can find this tutorial at https://realpython.com/python-pickle-module/ o The second intermediary-level tutorial “Python Pickle: Serialize Your Objects” by Claudio Sabato at Codefather.tech. In this tutorial, I learned: • Save a Python Dictionary Using Pickle • Write Pickled Python Dictionary to a File • Pickle a Nested Dictionary Object • Using Pickle With a Custom Class • Save Multiple Objects with Pickle • Pickle and Python With Statement • Using Python Pickle with Lambdas • Error When Pickling a Class with a Lambda Attribute • Exclude Python Class Attribute from Pickling • Restore the Original Structure of a Python Object Using Pickle • Default Protocol for Python Pickle • Compression for Data Generated with Python Pickle • Python Pickle and Pandas DataFrames • Pickling is not secure! By implementation of the `__setstate__` method you can call any arbitrary command that can harm the system that unpickles the data. Pickling can be used for reverse shells for remote administration or malicious activities. You could use the os.system call to create a reverse shell and gain access to the target system • Protecting Pickled Data with HMAC module You can find this tutorial at https://codefather.tech/blog/python-pickle/

Our Sidebar

You can put any information here you'd like.

  • Latest Posts
  • Announcements
  • Calendars
  • etc