Families of Malware Behaviour
"Is it a virus?" is the first question a manager asks, and usually the wrong one. What matters for the response is what the program does: does it spread by itself (then isolate the network segment now), does it steal credentials (then reset passwords), does it encrypt or destroy (then protect the backups), does it give someone remote control (then assume a human is acting)? Malware categories are best understood as families of behaviour, and one sample often belongs to several.
Security Foundations introduced the basic terms. This lesson sharpens them into an analyst's checklist: for each family, the behaviour that defines it, the evidence that shows it, and what it means for the response.
The families
| Family | Defining behaviour | Typical evidence | Response priority |
|---|---|---|---|
| Virus | Infects other files (inserts code into programs or documents) so that it runs when they run | Many executables modified, changed hashes of system files | Restore files from known-good sources; scan file shares |
| Worm | Spreads by itself over the network, without user action | Connections to many internal hosts on one service port (SMB, RDP, SSH) | Segment and block the port now; patch the vulnerability it uses |
| Trojan | Disguised as something wanted; the user runs it | Installed software from an untrusted source, a double extension | Find the delivery path (mail, download site) and block it |
| Ransomware | Encrypts data (and today usually steals it first) and demands payment | Mass rename and rewrite, high-entropy files, ransom notes, deleted shadow copies | Isolate, protect backups, preserve evidence (playbook) |
| RAT (remote access trojan) | Gives an operator interactive control: shell, files, screen | Periodic connections to one external host, commands executed by an unusual parent | Assume a human attacker; scope what they touched |
| Bot / botnet | Joins a network of infected machines controlled together (spam, DDoS, proxying) | Beaconing, bursts of outbound traffic, many SMTP connections | Block the control infrastructure, clean the hosts |
| Infostealer | Collects saved passwords, cookies, tokens, wallets, then uploads them | Reads of browser profile databases, one upload, often then exits | Revoke sessions and tokens, reset credentials, check for their reuse |
| Rootkit | Hides itself or other malware from the operating system and tools | Differences between views (file listing vs raw disk, process list vs memory) | Trust nothing on the host; analyse from outside (memory image, offline disk) |
| Wiper | Destroys data or makes the system unbootable, sometimes disguised as ransomware | Overwritten files or boot records, no working payment channel | Restore from offline backups; it is sabotage, not extortion |
| Loader / dropper | First stage whose job is to bring in the real payload: a downloader fetches it, a dropper carries it inside and writes it out, a loader decodes and starts it (often in memory); the terms overlap in vendor reports | Small file, a download or decode step, then a new process | Find and analyse the second stage; the loader's family says little about it |
| Adware / PUP | Unwanted but not clearly malicious (ads, bundled toolbars) | Browser changes, installer bundles | Remove; policy, not incident, unless it does more |
Two cross-cutting terms describe how, not what: fileless malware lives in memory, scripts and the registry rather than as a file on disk (so disk scans miss it; memory forensics finds it), and living off the land means using the system's own tools (PowerShell, certutil, wmic, scheduled tasks) instead of bringing new ones.
Classifying from behaviour
An analyst writes behaviour down as observations, then reasons from them. The example scores three synthetic behaviour reports (the kind of summary a sandbox or an analyst produces; no real samples) against the families' defining behaviours, and shows that real samples rarely fit one box.
FAMILY_SIGNS = {
"worm": {"scans_internal_hosts", "exploits_network_service", "copies_self_to_shares"},
"ransomware": {"mass_file_rewrite", "high_entropy_output", "ransom_note", "deletes_shadow_copies"},
"rat": {"periodic_beacon", "interactive_commands", "remote_shell"},
"infostealer": {"reads_browser_credentials", "reads_cookies", "single_upload"},
"loader": {"downloads_payload", "starts_new_process", "small_first_stage"},
"wiper": {"overwrites_files", "overwrites_boot_record", "no_payment_channel"},
}
reports = { # synthetic behaviour summaries of three lab cases
"case-A": {"small_first_stage", "downloads_payload", "starts_new_process", "periodic_beacon"},
"case-B": {"reads_browser_credentials", "reads_cookies", "single_upload"},
"case-C": {"mass_file_rewrite", "high_entropy_output", "ransom_note", "scans_internal_hosts",
"copies_self_to_shares", "deletes_shadow_copies"},
}
for case, seen in reports.items():
scores = {fam: len(seen & signs) / len(signs) for fam, signs in FAMILY_SIGNS.items()}
fits = [(f, s) for f, s in sorted(scores.items(), key=lambda kv: -kv[1]) if s >= 0.5]
print(case, "->", ", ".join(f"{f} {s:.0%}" for f, s in fits) or "no clear family")
unexplained = seen - set().union(*(FAMILY_SIGNS[f] for f, _ in fits))
if unexplained:
print(" not explained by those families:", sorted(unexplained))case-A -> loader 100%
not explained by those families: ['periodic_beacon']
case-B -> infostealer 100%
case-C -> ransomware 100%, worm 67%
Case A is a loader that also beacons, so the next question is "what did it download?". Case B is a classic infostealer: one upload and done, which means the damage is in the stolen credentials, not on the host. Case C is ransomware with worm-like spreading, and that combination changes the first response step: isolate the network before anything else.
How each family is detected
- Spreading (worms, ransomware with propagation): network detections for one host talking to many internal hosts on one port, and authentication logs with one account logging on to many hosts (network defence).
- Remote control and botnets: beaconing patterns in proxy and DNS logs (network behaviour).
- Theft: reads of browser credential stores by processes that are not the browser; large uploads to new destinations.
- Impact (ransomware, wipers): file-system activity rates, entropy of written data, deletion of shadow copies and backups, ransom note names.
- Hiding (rootkits, fileless): cross-view comparisons and memory analysis.
How the damage is limited
The family tells you which control matters most: segmentation and patching against worms, MFA and short-lived tokens against infostealers, application allow-listing against trojans and loaders, offline and immutable backups against ransomware and wipers, and egress filtering against RATs and bots (egress filtering).
Pitfalls
- Naming the family from the first stage. The loader is not the payload; a "small downloader" incident can end in ransomware.
- Taking the ransom note at face value. Some wipers pretend to be ransomware; whether recovery by payment is even possible is a finding, not an assumption.
- One label per sample. Modern malware is modular; record every behaviour observed, and map them to ATT&CK (next lesson).
Practice
1. A sample reads the browser's saved-password database, uploads one archive and deletes itself. Which family, and which response step comes first?
Infostealer. Revoke sessions and tokens and reset the credentials that were stored on that machine, then check for their use elsewhere; cleaning the host alone fixes nothing, because the data is already gone.
2. Why does "worm-like spreading" change the first step of a ransomware response?
Because every minute of network connectivity lets it reach more hosts. Isolating segments (or the infected hosts) comes before analysis.
3. Add a "rootkit" entry to FAMILY_SIGNS with three observable signs.
For example {"hidden_process", "hidden_file", "kernel_driver_loaded"}: a process seen in memory but not in the process list, a file seen on the raw disk but not in the directory listing, and an unexpected driver.
Test yourself
What distinguishes a worm from a virus?
- A worm encrypts files
- A worm spreads over the network by itself; a virus infects files and spreads when they run
- A virus only targets Linux
- There is no difference
An incident starts with a small downloader. What is the most important next question?
- What compiler built it?
- What payload did it fetch and run?
- How large is the file?
- Which font does it use?
Which family is best investigated from a memory image or an offline disk rather than from tools on the live host?
- Adware
- Rootkit
- Trojan
- Infostealer
Which control matters most against wipers and ransomware?
- Longer passwords
- Offline or immutable, tested backups
- A larger firewall
- Disabling DNS