Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. # This is my injection point in datastring
  2. def deserialize(datastring):
  3.     return pickle.loads(base64.decodestring(datastring))
  4.  
  5. # Datastring gets passed to deserialize here:
  6. def load(session_id, connection):
  7.     '''Load the session from storage.'''
  8.     try:
  9.         value = connection.get(session_id)
  10.         if value:
  11.             data = value.split(':', 1)[0]
  12.             kwargs = MemcachedSession.deserialize(data)
  13.             return MemcachedSession(connection, **kwargs)
  14.     except:
  15.         return None
  16.     return None
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement