WannaCry spreads via the SMB (Server Message Block) protocol used by Windows systems. To prevent this, disable SMBv1 on all devices and limit unnecessary file-sharing protocols.