The 'Petya' ransomware spread throughout networks in Europe and affected several major U.S. companies on Tuesday.