A type of cryptocurrency mining malware has spread due to an exploit developed by the US National Security Agency.