• Practice
  • About 12 min
  • 5 practice questions

Malware: viruses, worms, trojans and more

Tell the common types of malware apart by how they spread and what they do.

If something looks wrong, please tell us.

Malware is any software built to harm a computer, steal data or disturb work. Exams give a behaviour and ask the matching malware, so memorise each type by its signature behaviour.

Types of malware

Malware and behaviour
TypeBehaviour
VirusAttaches to a file or program and spreads when that file is run or shared
WormSpreads by itself across networks without needing a host file
Trojan horsePretends to be useful software but carries a harmful hidden function; does not copy itself
SpywareSecretly watches activity and collects information
RansomwareLocks or encrypts files and demands payment to restore them
AdwareShows unwanted advertisements
KeyloggerRecords what is typed

Worked examples

Example 1. A harmful program spreads from computer to computer over a network on its own. Which type? A worm.

Example 2. A free game secretly gives an attacker access to your computer. Which type? A trojan, because it looks useful while hiding a harmful function.

Virus needs a host file. Worm spreads alone. Trojan pretends to be useful. Ransomware demands payment.

— Rule to remember

Key takeaways: link each malware to its behaviour, and remember that a virus needs a host while a worm does not.

Check your understanding

  1. 1. Malware that spreads by itself across networks without needing a host file is a

    1. Virus
    2. Worm
    3. Trojan horse
    4. Adware
    Show answer

    Answer: B. A worm spreads alone; a virus needs a host file.

  2. 2. Malware that records what is typed, such as passwords, is a

    1. Adware
    2. Worm
    3. Ransomware
    4. Keylogger
    Show answer

    Answer: D. A keylogger records keystrokes.

  3. 3. Which malware pretends to be useful software, carries a hidden harmful function and does not copy itself?

    1. Trojan horse
    2. Computer worm
    3. Computer virus
    4. Adware program
    Show answer

    Answer: A. A Trojan disguises itself as useful software and does not replicate.

  4. 4. Which malware secretly watches your activity and collects information?

    1. Adware
    2. Ransomware
    3. Spyware
    4. Worm
    Show answer

    Answer: C. Spyware secretly watches activity and collects information.

  5. 5. What does a virus need in order to spread that a worm does not?

    1. An internet connection
    2. A payment from the user
    3. A host file or program
    4. A second keyboard
    Show answer

    Answer: C. A virus attaches to a file or program and spreads when it is run or shared; a worm needs no host file.

Privacy · Terms · Refunds · Delivery