Malware can be categorized by how it spreads and its function.
(A) Trojan (or Trojan Horse): This is malware disguised as legitimate software. It requires the user to execute it, thinking it's something harmless. It does not self-replicate.
(B) Worm: A worm is a standalone malware computer program that replicates itself in order to spread to other computers. It often uses a computer network to spread itself, relying on security vulnerabilities on the target computer to gain access. A key characteristic of a worm is that it can spread automatically without any user intervention.
(C) Spyware: Malware that secretly observes the user's activities on the computer and sends that information to others. It needs to be installed first, often through a Trojan.
(D) Ransomware: Malware that encrypts the user's files and demands a ransom payment to decrypt them. It also requires an initial infection vector.
The type of malware that spreads by itself without user action is a worm.