Businesses rushed to contain a ransomware attack that has paralyzed their computer networks.