Identifying Malware Types
Viruses, worms, trojans, ransomware, spyware, keyloggers, logic bombs, rootkits, and fileless malware: how each works and how to tell them apart.
1What malware is
Malware (malicious software) is software that can damage or destroy a device or network, or give an adversary access to a device and its data. Malware is usually a tool for one step of a larger plan: getting in, staying in, stealing, or causing damage. Identifying the type tells defenders what the attacker is trying to do and what to check next.
2How malware spreads
- Virus: must be activated by a user running or opening a file, such as a document with harmful macros or an infected program.
- Worm: spreads from one computer to another without human interaction, often by exploiting a network weakness, so it can infect thousands of machines quickly.
- Trojan: malware embedded in software that seems harmless (a free game, a “codec,” a fake update). A remote access trojan (RAT) gives the adversary remote control of the target system.
3What malware does
- Ransomware encrypts a device's files so the user cannot open them, then usually shows a screen demanding payment within a fixed time and promising a decryption key in return.
- Spyware tracks a user's actions on a computer and sends that information back to an adversary.
- Keylogger: software or hardware that records the user's keystrokes and sends them back to the adversary, who can often pull usernames and passwords out of them.
4Hiding and waiting
- Logic bomb: malware set to trigger only when specific conditions are met: a date and time, a particular operating system version, the computer's language setting, an employee's name disappearing from the payroll.
- Rootkit: sophisticated malware that gets into the operating system itself and can control nearly every part of the system, including hiding itself (and other malware) from detection.
5Fileless malware
Most malware is a file or collection of files that anti-malware tools can scan. Fileless malware is malicious code that lives only in RAM (the computer's working memory) and uses legitimate programs already installed on the device, such as built-in administration tools, to do its work. With no malicious file on the disk, file-scanning tools have nothing to find, and restarting the computer may erase the evidence.
6All the types at a glance
| Type | Key feature | A clue in an incident |
|---|---|---|
| Virus | Activated when a user opens or runs a file | Infection started right after someone opened an attachment |
| Worm | Spreads without human interaction | Many computers infected within minutes, no one clicked anything |
| Trojan | Hidden in harmless-looking software | Infection traced to a free program the user installed |
| Remote access trojan (RAT) | Gives the adversary remote control | A computer receiving commands from an outside server |
| Ransomware | Encrypts files and demands payment | Files won't open; a ransom note appears |
| Spyware | Tracks user activity and reports it | Browsing and activity data sent to an unknown server |
| Keylogger | Records keystrokes (software or hardware) | Passwords stolen even though no one shared them |
| Logic bomb | Triggers on specific conditions | Damage starts on a certain date or after a certain event |
| Rootkit | Controls the operating system and hides itself | Security tools show nothing, yet the system behaves strangely |
| Fileless malware | Lives in RAM; uses legitimate tools | No malicious file found; built-in tools running odd commands |
Identify malware by how it starts (user action, self-spreading, disguised), what it does (encrypts, spies, logs keys, gives control), and how it hides (waits for a trigger, hides in the system, lives only in memory).
7Worked examples
Overnight, every computer
Overnight, hundreds of computers across a company are infected, one after another, through an unpatched network service. No employee opened anything; most were asleep. What type of malware is this?
- 1It spread from computer to computer on its own.
- 2No human action was needed.
The payroll trigger
A programmer adds code to a company system that deletes the customer database if their own name is ever removed from the payroll. Months after they are fired, the database is wiped. What type of malware is this?
- 1The malicious code sat inactive until a specific condition was met: the name disappearing from payroll.
- 2Malware set to trigger only under certain conditions is a logic bomb.
The free video converter
A student downloads a free video converter from an unofficial site. It works fine, but a week later the student's computer is receiving commands from a server overseas, and someone is browsing the student's files. What type?
- 1The malware arrived hidden in software that seemed harmless: a trojan.
- 2It gives an outside adversary control of the computer: a remote access trojan (RAT).
Nothing on the disk
Investigators see a computer's built-in administration tool running strange commands that download data, but anti-malware scans find no malicious file anywhere, and after a restart the activity stops. What type?
- 1No malicious file on disk, so file scanning finds nothing.
- 2It uses a legitimate, already-installed program.
- 3It disappears after a restart, which fits code living only in RAM.
Passwords no one shared
An accountant never shared their password, yet attackers logged in with it. A scan finds a hidden program that recorded everything typed and uploaded it each night. What type?
- 1It recorded keystrokes and sent them to the adversary.
- 2Passwords were extracted from the recorded typing.
8Common mistakes
A virus specifically needs a user to open or run a file. Self-spreading malware is a worm; disguised malware is a trojan.
Spyware tracks a user's actions broadly; a keylogger records keystrokes. A keylogger is a focused kind of spying.
Rootkits hide from detection and fileless malware has no file to scan.
It waits for its condition. That is why it can sit unnoticed for months.
“This is a worm, because it spread from computer to computer across the network without anyone opening a file or clicking a link. A virus would have needed a user to run the infected file.”
Name the type, point to the defining behavior in the evidence, and rule out the closest alternative.