Sub topic 7
Malware types and how they differ
This chapter assumes you know basic Windows usage (Settings, Control Panel, Safe Mode), common networking terms such as IP address and DNS, and what antivirus software does. It covers the malware categories that appear in the CompTIA A+ Core 2 (220-1102) security objectives. It also covers how to tell them apart from a short scenario.
What malware is and how to classify it
Malware is any software built to harm a system, steal data, or give an attacker unauthorized control. The exam rarely asks for a definition. It gives you a scenario and asks which type of malware fits. To answer, ask three questions:
- How did it get in and spread? Does it attach to files, copy itself across the network, or pose as something useful?
- What does it do? Does it encrypt files, watch the user, hide itself, or use the CPU?
- Does it need a person to act? Some malware needs the user to run a file. Other malware spreads on its own.
The table below summarizes the types you must know.
| Type | Key trait | Typical exam clue |
|---|---|---|
| Virus | Attaches to a host file and needs a user to run it | Infection appears after opening an infected file or program |
| Worm | Self-replicates across networks with no user action | Rapid spread, network slowdown, many machines infected |
| Trojan | Disguised as legitimate software | User installed a "free" tool and strange behavior followed |
| Ransomware | Encrypts files or locks the system and demands payment | Files inaccessible, ransom note on screen |
| Spyware | Secretly gathers user activity and data | Unwanted ads, changed browser settings, privacy loss |
| Keylogger | Records keystrokes | Stolen passwords after typing credentials |
| Rootkit | Hides itself deep in the OS, often at the kernel or boot level | Antivirus cannot find it or is disabled |
| Cryptominer | Uses system resources to mine cryptocurrency | High CPU or GPU use, heat, fans running loud |
Viruses, worms and trojans
These three are the classic delivery categories. They are defined by how they spread.
Virus
A virus attaches itself to a legitimate file, such as an executable or a document with macros. It stays dormant until a user runs the infected file. Then it executes and tries to attach to other files. The defining point is that it needs user action. If a scenario says an employee opened an infected spreadsheet and files began to corrupt, think virus.
Worm
A worm is standalone malware that copies itself from system to system, usually by exploiting a network vulnerability. It needs no user action. Worms can overwhelm a network just by replicating, so the symptoms are often network congestion and many machines getting infected within minutes. If a scenario says an unpatched machine joined the network and soon every machine showed the same problem, think worm.
Trojan
A trojan pretends to be something useful, such as a cracked game, a free PDF converter, or a fake system utility. The user installs it willingly. The payload then runs in the background. Trojans do not replicate by themselves. Many trojans install other malware, such as a keylogger or a remote access tool. The key trait is deception about what the software is.
A common exam trap: a trojan is not defined by what it does afterward. It is defined by how it got in, by posing as legitimate software.
Payload-focused types
The next group is defined by what the malware does once it is running. A virus, worm or trojan can deliver any of these payloads.
Ransomware
Ransomware encrypts the user's files, or locks the whole system, and demands payment for the key. Typical symptoms are files with changed extensions, documents that will not open, and a ransom note or lock screen. Paying does not guarantee recovery. The best defense is offline or off-site backups that the infected machine cannot reach, plus patching and user training. Isolate the machine from the network immediately to stop the encryption from spreading to shares.
Spyware
Spyware monitors user behavior and sends information to a third party. It may track browsing, capture screenshots, or collect personal data. Symptoms include a changed home page, new toolbars, pop-ups, and a slow browser. It often arrives bundled with free software.
Keylogger
A keylogger records what the user types. It can be software or a small hardware device placed between the keyboard and the computer. It is a specific kind of spyware. If a scenario says a user's accounts were compromised after entering passwords on one workstation, a keylogger is a strong candidate. Hardware keyloggers are one reason physical inspection of ports matters.
Rootkit
A rootkit hides its presence, and often the presence of other malware, by modifying the operating system. Some run at the kernel level or in the boot process. Because the rootkit controls what the OS reports, normal scans may miss it. Clues include antivirus that will not start, security tools that are disabled, and system behavior that scans cannot explain. Removal is hard. Technicians often use a boot-time scan or an offline scan from external media. In severe cases they reinstall the OS.
Cryptominer
A cryptominer (cryptojacker) uses the victim's CPU or GPU to mine cryptocurrency for the attacker. It does not usually steal data. The symptoms are performance problems: sustained high CPU use, overheating, loud fans, shorter battery life, and slow response. In a scenario, look for high resource use with no obvious user activity.
Telling similar types apart
Several pairs are easy to confuse. The exam uses these on purpose.
| Confusable pair | How to separate them |
|---|---|
| Virus vs. worm | A virus needs a user to run an infected file. A worm spreads by itself over the network. |
| Virus vs. trojan | A virus attaches to files and replicates. A trojan poses as useful software and does not replicate. |
| Spyware vs. keylogger | Spyware is broad monitoring. A keylogger records keystrokes specifically. |
| Rootkit vs. other malware | A rootkit is defined by concealment. It is usually a hiding layer for something else. |
| Ransomware vs. cryptominer | Ransomware is visible and demands payment. A cryptominer is quiet and uses resources. |
Remember that categories overlap. A trojan can deliver ransomware. A worm can carry a rootkit. When a scenario describes both a delivery method and a payload, pick the answer that matches what the question asks about. If it asks "what type of malware is this?" and the user installed a fake tool that encrypted files, either answer can be defensible, so read the wording closely for the question's focus.
Checking a suspected infection on Windows
You will often confirm a suspicion with the built-in tools. Microsoft Defender is the anti-malware tool included with Windows. This PowerShell command shows whether it is running, whether real-time protection is on, and how recent its signatures are.
Get-MpComputerStatus | Select-Object AMServiceEnabled, AntivirusEnabled, RealTimeProtectionEnabled, AntivirusSignatureLastUpdatedIf RealTimeProtectionEnabled is False or the signature date is old, that is a finding in its own right. Malware, especially a rootkit or a trojan, often disables protection. To review what Defender has already detected, use:
Get-MpThreatThe output lists threat names. Those names often include the category, such as a Trojan: or Ransom: prefix, which helps you match the detection to the types in this chapter. The later chapter on removal steps covers updating signatures and scanning in the correct order.
Common mistakes
- Calling every infection a virus. Many people use "virus" loosely. On the exam, use the specific type.
- Assuming a worm needs a click. If no user action is described and the spread is fast, it is a worm.
- Treating a trojan as self-replicating. It relies on the user installing it.
- Missing the rootkit clue. When the antivirus itself is disabled or finds nothing despite clear symptoms, suspect a rootkit.
- Forgetting that ransomware needs a backup answer. Offline backups are the recovery control.
Exercise
A user downloads a free "PDF converter" and runs it. The tool works, but a week later the user's email password is changed and a technician finds a small program recording what the user types. Which two malware types best describe the situation?
Show answer
The converter is a trojan, because it posed as legitimate software and the user installed it willingly. The program recording keystrokes is a keylogger, which the trojan delivered as its payload.
Exercise
A workstation becomes extremely slow and its fans run loudly even when idle. Task Manager shows near-constant high CPU use from an unfamiliar process, and no files are encrypted. Which malware type is most likely, and which type would show a ransom note instead?
Show answer
A cryptominer is most likely, because it quietly consumes CPU or GPU resources. Ransomware would show a ransom note or lock screen and make files inaccessible.