What is the difference between a virus, a worm and a trojan?

All three are malware, but they spread differently. A virus attaches itself to a file or program and spreads when someone opens or shares that file. A worm spreads by itself across the network, usually through a vulnerability, with no user action, which is why worms can infect hundreds of machines within an hour. A trojan pretends to be something useful, such as an invoice or a free tool, so the user installs it willingly; it does not copy itself, but it often opens a back door. For defenders, the worm is the loudest on the network, because it scans and connects to many machines quickly.

Read next

← All 69 questions on What is…? Network and security termsAll topics