Wannacry ransomware spreads primarily through phishing emails and by exploiting a vulnerability in the Windows operating system known as EternalBlue, which was originally developed by the National Security Agency (NSA). Once a single computer within a network is infected, the malware can rapidly propagate to other vulnerable systems, mimicking the spread of infectious diseases.