Understanding how ransomware spreads is the key to avoiding falling victim to an attack.