The US National Security Agency propagated malware around the world in a bid to infiltrate and compromise more than 50,000 networks.