What is the difference between a virus, worm, and trojan?
Answer
Virus: a malicious program that attaches itself to a legitimate executable file and spreads only when the infected file is executed or shared. Viruses require human action to propagate (sharing an infected file). They typically damage files, corrupt data, or use system resources. Worm: self-replicating malware that spreads automatically across networks without user intervention by exploiting vulnerabilities. WannaCry used the EternalBlue exploit to spread laterally across networks. Worms can cause massive network disruption. Trojan horse (Trojan): disguises itself as legitimate software (games, utilities, email attachments) — the user willingly installs it. Once executed, it installs a backdoor, steals data, or downloads additional malware. Doesn't self-replicate. Common vector for RATs (Remote Access Trojans). Key difference: virus needs a host file, worm is self-contained and self-propagating, trojan relies on deception. Modern malware often combines characteristics.