Hospitals, major companies and government offices have been hit by a huge wave of cyberattacks across the globe.