Skip to content
Tutorials Center
My learning

Topics

Lesson 2 of 37 ยท Getting Started

Malware Types and Families

Understand the main malware types (virus, worm, trojan, ransomware, spyware, loader, rootkit) and how families and naming schemes help analysts classify samples.

Malware comes in many shapes, and the names you hear in news stories (virus, worm, trojan, ransomware) describe behaviour, not brand. Learning the vocabulary matters because it tells you what to look for: a worm spreads on its own, so you search for network scanning; ransomware encrypts files, so you search for bulk file changes. This lesson maps the common categories, explains what a family is, and ends with a small classifier that practices the idea.

Types by behaviour

Type Core behaviour What to look for
Virus Attaches itself to other files and spreads when they are run or shared Modified executables, copied code
Worm Spreads by itself across networks without a host file Scanning, many outbound connections
Trojan Pretends to be useful software to be installed voluntarily A legitimate-looking program with hidden extra actions
Ransomware Encrypts data and demands payment Many files rewritten, new extensions, a ransom note
Spyware / infostealer Collects passwords, cookies, keystrokes, screenshots Access to browser data, clipboard, keyboard hooks
Backdoor / RAT Gives an attacker remote control Listening or beaconing network connections
Downloader / dropper / loader Installs the real payload; small and simple on purpose Network download or an embedded second file
Botnet client Joins a network of controlled machines Regular check-ins to a controller
Rootkit Hides processes, files or connections Hooked system calls, mismatches between views
Cryptominer Uses CPU or GPU to mine cryptocurrency Sustained high CPU, connections to mining pools
Adware / PUP Shows ads or bundles unwanted software Browser changes, installers with extras
Wiper Destroys data Overwriting disks or files
Fileless / script-based Runs in memory or through scripts and built-in tools PowerShell, macros, living-off-the-land use

Categories overlap. A modern sample may be a loader that installs an infostealer and later a ransomware module. Analysts often say "a loader that delivers X" instead of forcing a single label.

Stages: dropper, loader, payload

Many attacks are layered because each layer is small, replaceable and harder to spot.

  1. A dropper carries the next stage inside itself (embedded or encrypted) and writes it to disk.
  2. A downloader fetches the next stage from a server.
  3. A loader decodes and starts the payload, the component that does the real damage, often directly in memory.

When you analyze only the first stage you learn about delivery, not about the goal. Part of your job is to say which stage you are looking at.

flowchart LR
    A["Phishing document"] --> B["Dropper or downloader"]
    B --> C["Loader (decrypts)"]
    C --> D["Payload: stealer, RAT, ransomware"]
    D --> E["Command and control"]

Each hop is a detection opportunity and a reason the first file often looks harmless.

What is a malware family?

A family is a group of samples that share code or design lineage: they were built from the same codebase or by the same developers, so they behave and look alike even when file hashes differ. Attackers recompile and repack constantly, so hashes change daily, while the family stays recognizable through unusual code, configuration formats, mutex names or network protocols. Families split into variants (version 2.1 versus 3.0).

Why families matter:

  • A known family has public reports: you inherit what others learned.
  • Detection by family catches new builds that no hash list knows.
  • It supports threat intelligence: which groups use it, what comes next.

Naming schemes

There is no global standard. Antivirus vendors name detections their own way, usually in the form platform.type.family.variant, for example Win32/Trojan.Agent.AB. Public researchers use shorter family names such as "Emotet" or "WannaCry". The same family can therefore have three names across three vendors, and a vendor label like Trojan.Generic means "we matched a heuristic, not a known family". Treat vendor names as hints, and record the source of every label in your notes.

Do not confuse a malware family with a threat actor. A group may use several families, and a commodity family may be used by many groups.

Practice: classify by behaviour

The script below applies the table to simple behaviour tags. It is a teaching toy, but it mirrors the reasoning you will do on real reports, and it never runs anything dangerous.

Python Behaviour tags to a likely type

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Notice that sample-2 matches two rules: it downloads and starts a program and acts as a bot. Real samples are often multi-purpose, and sample-3 shows why one clue is not enough.

Grouping by similarity

Analysts also group samples by shared strings. The example measures overlap between sets of strings from three invented samples. Higher overlap suggests the same family.

Python Similarity between samples

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The Jaccard score is the shared items divided by all items. Real tooling (fuzzy hashes, YARA rules, code-similarity engines) is more refined, but the idea is the same. You will meet it again in Behavioural Indicators and YARA.

Common mistakes

  • Calling everything a virus. Most modern threats are trojans or loaders.
  • Trusting one vendor name as truth.
  • Assuming the first file you found is the whole threat.
  • Treating a family name as proof of who attacked you.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which malware type spreads across a network by itself, without needing a user to run an infected file?

    A worm is self-propagating. A trojan relies on a user installing it, and a dropper only delivers another component.
  2. 2. What does a loader usually do?

    Loaders sit between delivery and the payload, often decrypting the payload and running it in memory.
  3. 3. Why do file hashes change so often while a malware family stays recognizable?

    Any byte change gives a new hash. Families are recognised through code, configuration and behaviour that persist across builds.
  4. 4. A vendor labels a file Trojan.Generic. What does this suggest?

    Generic labels come from heuristics. Treat them as a hint and verify with your own analysis.

Summary

  • Malware types describe behaviour: worms spread, trojans deceive, ransomware encrypts, stealers collect, backdoors give control.
  • Attacks are layered: dropper or downloader, loader, then payload. Know which layer you hold.
  • A family is a group of samples with shared code or design; hashes change, families persist.
  • Vendor names vary and generic labels are only hints.
  • One clue rarely decides the type; combine behaviours.

Next: The Malware Analysis Workflow