01 / 20

Malware
Categories

Learn to identify and distinguish viruses, worms, trojans, and ransomware: the four most common categories of malicious software threatening modern systems.

Cyber Security

What is Malware?

Malware (short for malicious software) is any program or code intentionally designed to harm, exploit, or compromise a computer system, network, or user. It is the umbrella term that covers all hostile or intrusive software.

Why Malware Matters

$8 Trillion
Estimated global cybercrime cost in 2023, largely driven by malware attacks.
560,000+
New malware samples detected every day by security researchers worldwide.
91%
Of cyberattacks begin with a phishing email that delivers some form of malware payload.

The Four Major Categories

Malware Virus Attaches to files Requires user action Worm Self-replicates alone Spreads via networks Trojan Disguised as legit Tricks the user Ransomware Encrypts your data Demands payment Each category has a distinct infection method and behavior

Virus: The Parasite

Clean File Infects Infected File VIRUS CODE User runs File A File B File C Virus attaches to a host file and activates when the user executes it

Worm: The Self-Replicator

Infected Machine A Machine B Machine C Machine D Machine E No user action needed

Trojan: The Impersonator

Looks Legit "Free Game" "PDF Reader" "System Update" Outer shell Install Hidden Payload Backdoor access Keylogger Data theft True purpose ! Breach Named after the Trojan Horse: deception is the delivery method

Ransomware: The Extortionist

Your Data Photos, docs, databases Encrypt Locked! Files encrypted Inaccessible Demand Ransom Pay $$$ in crypto or lose data forever Notable examples: WannaCry (2017), Colonial Pipeline (2021)

Virus vs Worm: Key Distinction

Virus
Needs a host file to attach to. Requires the user to execute, open, or share the infected file. Does not spread on its own.
Worm
Standalone program that needs no host. Self-replicates and spreads automatically through network vulnerabilities. No user action required.

Trojan vs Virus: Another Distinction

Trojan
Does NOT replicate. Relies on social engineering to trick the user into installing it. Disguised as useful software.
Virus
Replicates by attaching to other files. Spreads when the host file is shared or executed. Not necessarily disguised.

How to Identify the Category

1
Does it need a host file? If yes, it is likely a virus. If it is a standalone program, move to step 2.
2
Does it self-replicate across a network? If it spreads automatically without user action, it is a worm.
3
Does it disguise itself as legitimate software? If it tricks the user into installing it and does not replicate, it is a trojan.
4
Does it encrypt files and demand payment? If yes, it is ransomware. (Note: ransomware may arrive via a trojan or worm.)

Example 1: ILOVEYOU

Scenario: In 2000, millions of users received an email with the subject "ILOVEYOU" and an attachment named "LOVE-LETTER-FOR-YOU.txt.vbs". When users opened the attachment, the malware overwrote their files and emailed itself to every contact in their address book.

1
Host file? Yes: it was embedded as an email attachment (a VBScript file).
2
User action needed? Yes: the user had to open the attachment.
3
Did it replicate? Yes: it copied itself by sending emails to all contacts.

Example 2: WannaCry

Scenario: In May 2017, WannaCry infected over 230,000 computers in 150 countries within hours. It exploited a Windows vulnerability (EternalBlue) to spread automatically across networks, then encrypted users' files and displayed a ransom note demanding Bitcoin payment.

1
Host file? No: it was a standalone program.
2
User action needed? No: it exploited a network vulnerability automatically.
3
Encrypted files for ransom? Yes: it locked data and demanded Bitcoin.

Example 3: Emotet

Scenario: A user downloads what appears to be an invoice document from a business email. The "invoice" actually installs a hidden program that steals banking credentials, logs keystrokes, and opens a backdoor for attackers to install additional malware on the system.

1
Disguised as legitimate? Yes: it pretended to be a business invoice.
2
User tricked into installing? Yes: the user willingly opened the "invoice."
3
Hidden malicious payload? Yes: keylogger, credential theft, backdoor access.

Common Mistakes

✕ Calling All Malware "Viruses"
Virus is only one category. Using it as a blanket term misidentifies worms, trojans, and ransomware, leading to wrong defensive strategies.
✕ Confusing Worms and Viruses
Both replicate, but a virus needs a host file and user action. A worm spreads independently through networks. The delivery method is the key difference.
✕ Thinking Trojans Self-Replicate
Trojans do not copy themselves. They rely on social engineering. If malware is spreading on its own, it is a worm or virus, not a trojan.

Comparison Summary

Feature Virus Worm Trojan Ransomware
Needs host file Yes No No No
Self-replicates Yes Yes No Varies
User action needed Yes No Yes Varies
Uses deception Sometimes Rarely Always Sometimes
Primary goal Damage/spread Spread/disrupt Steal/control Extort $$$

Question 1 of 5

A user opens a file attached to an email. The malicious code in the file then copies itself into other documents on the same computer. It does not spread to other machines unless those files are shared. What type of malware is this?

Question 2 of 5

Malware spreads across a corporate network automatically, infecting hundreds of machines within minutes without any employee clicking or opening anything. Which category best describes this behavior?

Question 3 of 5

A student downloads a "free photo editor" from an unofficial website. The software works as expected, but secretly installs a keylogger that records all passwords. This malware does not copy itself to other files or machines. What is it?

Question 4 of 5

After a cyberattack, all files on a hospital's servers are encrypted and a message demands $300,000 in Bitcoin for the decryption key. Which malware category is primarily responsible for this outcome?

Question 5 of 5

Which of the following statements correctly distinguishes a virus from a worm?