• Foundation
  • About 12 min
  • 5 practice questions

Malware: viruses, worms, trojans and more

Tell apart the main kinds of malicious software and how each spreads or harms.

If something looks wrong, please tell us.

Many threats arrive as harmful programs. Exams ask you to match a description to the right name, so the differences matter.

Malware

Malware (malicious software) is any program designed to harm a computer or steal data.

Kinds of malware
TypeHow it behaves
VirusAttaches itself 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 hides harmful code; does not copy itself
SpywareSecretly watches what you do and sends information away
AdwareShows unwanted adverts
RansomwareLocks or encrypts your files and demands payment to unlock them
KeyloggerRecords what you type, such as passwords
RootkitHides deep in the system so other malware stays unseen

How malware gets in

  • Email attachments and links.
  • Downloads from untrusted sites and pirated software.
  • Infected pen drives.
  • Outdated software with known weaknesses.

Worked examples

Example 1. A free game installs fine but also steals saved passwords. It is a Trojan, since it looked useful but hid a harmful function.

Example 2. A program copies itself to every computer on the office network without any user action. This is a worm.

Example 3. All your documents suddenly become unreadable and a message asks for money. This is ransomware; the best protection is regular backups kept offline.

Virus needs a host, worm spreads alone, Trojan disguises itself, ransomware demands payment.

— Remember

Key takeaways

  • Virus, worm, Trojan, spyware, adware, ransomware and keylogger each have a distinct behaviour.
  • Avoid untrusted downloads and attachments; keep backups.

Check your understanding

  1. 1. Which malware attaches itself to a file or program and spreads when that file is run or shared?

    1. Virus
    2. Worm
    3. Adware
    4. Rootkit
    Show answer

    Answer: A. A virus needs a host file; a worm spreads by itself without one.

  2. 2. Which malware locks or encrypts your files and demands payment to unlock them?

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

    Answer: D. Ransomware holds files to ransom by locking or encrypting them.

  3. 3. Software whose main behaviour is showing unwanted adverts is

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

    Answer: B. Adware shows unwanted advertisements.

  4. 4. Which malware hides deep in the system so that other malware stays unseen?

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

    Answer: B. A rootkit hides deep in the system to keep malware hidden.

  5. 5. Which of these is a common way for malware to get into a computer?

    1. Turning on a firewall
    2. Keeping software updated
    3. Keeping an offline backup
    4. An infected pen drive
    Show answer

    Answer: D. Infected pen drives, untrusted downloads, email attachments and outdated software let malware in; the other three are defences.

Privacy · Terms · Refunds · Delivery