init commit
This commit is contained in:
11
lab2/load_model.py
Normal file
11
lab2/load_model.py
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env python3
|
||||
import torch
|
||||
|
||||
print("Attempting to load standard checkpoint (unrestricted)...")
|
||||
try:
|
||||
# In older versions of PyTorch, weights_only defaulted to False.
|
||||
# This will trigger the __reduce__ exploit instantly upon reading.
|
||||
loaded_data = torch.load("compromised_model.pt", weights_only=False)
|
||||
print("Model loaded successfully (but the exploit already ran!).")
|
||||
except Exception as e:
|
||||
print(f"Error occurred: {e}")
|
||||
Reference in New Issue
Block a user