File size: 500 Bytes
e34f991 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
import pickle
import pickletools
import another_torch
import torch
class Vuln():
def __reduce__(self):
return (another_torch.run_bash, ())
class Vuln2():
def __reduce__(self):
return (torch.run_bash, ())
def run():
with open("vuln.pkl", 'wb') as f:
pickle.dump(Vuln(), f)
with open("vuln2.pkl", 'wb') as f:
pickle.dump(Vuln2(), f)
if __name__ == '__main__':
run()
with open("vuln.pkl", "rb") as f:
pickle.load(f)
|