Skip to content
Pwnversity
MAL-FUNDbasic · 8 min · upd. 2026-10

Malware Fundamentals

ATT&CKCTI

Malware (malicious software) is any program designed to damage, spy on, extort, or take control of a system without consent. It matters on both sides: to the red team (emulating a real adversary’s TTPs in an authorized exercise to measure detection and response) and to the blue team (classifying, analyzing, detecting, and responding). This area focuses on understanding the techniques and analyzing samples safely: malware analysis is, above all, a defensive discipline. You won’t find recipes for building a weapon here, but rather for recognizing one, understanding it, and stopping it.

Thinking about malware by “type” (virus, trojan, worm) helps you start, but it ages badly: a modern sample is almost always modular and chains capabilities (a loader that brings an infostealer that in turn deploys ransomware). That’s why serious analysis classifies by behavior —what it does— and maps each action to MITRE ATT&CK, the common language among analysts, CTI, and detection.

The other guiding idea is the Pyramid of Pain (David Bianco): not all indicators cost the adversary the same. A hash or an IP is changed in seconds; forcing them to change their TTPs (how they operate) is what really hurts. Mature detection chases behavior, not hashes.

Instead of rigid buckets, read a sample by the functions it combines:

  • Propagation and transport — virus (needs a host the victim runs), worm (spreads by itself over the network, abusing a service or credentials), loader/dropper (first stage: downloads and runs the real payload).
  • Access and control — trojan (disguised as legitimate software), backdoor (persistent attacker access), RAT (Remote Access Trojan: interactive control of the machine).
  • Theft and espionage — infostealer (credentials, session cookies, crypto wallets), keylogger, spyware/stalkerware, banker (banking trojan).
  • Impact and fraud — ransomware (encrypts and extorts, see Ransomware), wiper (destroys data; sabotage, not ransom), cryptojacker (unauthorized mining), adware/click fraud.
  • Stealth and low-level — rootkit and bootkit (hide their presence deep in the system, see Rootkits and bootkits), packer/crypter (wrap the sample to break signatures, see Obfuscation and packing).

A single campaign usually uses several of these pieces at once; the network of infected machines controlled from a C2 is a botnet (see Botnets).

Brief evolution (why old material isn’t enough)

Section titled “Brief evolution (why old material isn’t enough)”
  • 1982–1995 — boot-sector and file viruses spread by floppy disk. Goal: notoriety and damage.
  • 1995–2003 — Office macro viruses and mass-mailing email worms (Melissa, ILOVEYOU); the network becomes the propagation medium.
  • 2004–2015 — professionalization and organized crime: botnets, banking trojans, exploit kits, first documented APTs.
  • 2016–2026 — service economy: Malware-as-a-Service, Ransomware-as-a-Service (RaaS), access brokers, double/triple extortion, and heavy abuse of legitimate tools (LOLBins) and the cloud.

The practical takeaway: today’s real threat is modular, commercial, and lives off the land. Studying only “how a virus was coded” in the 90s doesn’t prepare you for what reaches a SOC in 2026.

flowchart LR
  A[Delivery<br/>phishing · exploit · USB] --> B[Execution<br/>loader / dropper]
  B --> C[Evasion<br/>AV · AMSI · EDR]
  C --> D[Persistence]
  D --> E[C2]
  E --> F[Actions on objectives<br/>theft · encryption · lateral]

Each phase has its own page: delivery and social engineering; execution and obfuscation; defense evasion; persistence; Command & Control; and impact, e.g. ransomware. For the defender, each phase is a detection opportunity: the earlier in the chain, the less damage.

In an authorized exercise, the value isn’t “infecting” but emulating a specific adversary to check whether defenses see it. The typical flow:

  1. Start from CTI: pick a group relevant to the client’s sector and its documented TTPs.
  2. Select and map techniques to ATT&CK (initial access, execution, persistence, C2…).
  3. Emulate them within the rules of engagement (ROE) and signed scope, using emulation frameworks (Caldera, Atomic Red Team) instead of real malware where possible.
  4. Measure detection and response time, not the “success” of the intrusion.

The useful deliverable is the map of which techniques were detected, which weren’t, and what telemetry was missing. It’s the precursor to purple teaming (see Threat hunting).

  • Behavior over signature: a family repacks its binary daily, but its behavior (injection, Run-key persistence, beaconing) is stable. Prioritize behavioral rules (Sigma, EDR analytics) and reserve signatures (YARA) for pinning known families.
  • High-fidelity IOCs: mutexes, persistence keys, C2 infrastructure, certificates; the higher on the Pyramid of Pain, the better.
  • Modern EDR/AV with behavioral detection; application allowlisting (AppLocker/WDAC) to cut unapproved binaries and loaders.
  • Least privilege and segmentation to limit lateral movement; patching to close entry vectors.
  • Offline/immutable backups (3-2-1 rule, see Backups & recovery).
  • Anti-phishing training (entry vector #1) and phishing-resistant MFA.

On a confirmed infection: isolate the host, preserve evidence by order of volatility (see DFIR), identify persistence and C2, extract IOCs, hunt the same footprint across the fleet, and rebuild rather than “clean” when there’s a rootkit or any doubt about integrity.

Analyzing malware means handling —and sometimes running— dangerous code. Never on your real machine or a network you care about:

  • Dedicated VM with snapshots, on an isolated or simulated network; ideally a hypervisor separate from your work host.
  • REMnux (Linux distro with analysis tooling preinstalled) and FLARE-VM (Windows analysis environment, Mandiant).
  • Simulated network: INetSim or FakeNet-NG fake the Internet to capture what the sample tries to contact without actually letting it out (see Dynamic analysis).
  • Beware anti-VM/anti-sandbox: some families detect the lab and won’t detonate (see Obfuscation and packing).
  • Samples: get them from controlled repositories (MalwareBazaar, VirusTotal with an account) and handle them encrypted/password-protected.
flowchart TD
  T[Triage<br/>hash · type · strings] --> S[Static<br/>imports · entropy · CAPA]
  S --> D[Dynamic<br/>behavior in lab]
  D --> U[Deobfuscate / unpack]
  U --> I[Extract IOCs and TTPs]
  I --> Y[Detection<br/>YARA / Sigma]
  Y --> R[Report + ATT&CK]

Each step has its page: triage, static, dynamic, memory, YARA, and intelligence and classification.

  • WannaCry (2017) — worm+ransomware that spread with the EternalBlue exploit (CVE-2017-0144, SMBv1). A textbook case for why patching and segmentation matter.
  • NotPetya (2017) — a wiper disguised as ransomware; same SMB vector plus credential theft with Mimikatz. Billions in global damage.
  • Emotet — modular loader/botnet that distributed other families; its infrastructure was taken down in an international operation (2021) and later resurged: an example of the service model and of a takedown.
  • Log4Shell (CVE-2021-44228) — not malware itself, but a massive initial-access vector used to deploy miners, botnets, and ransomware.

Cross-cutting ATT&CK tactics: execution (TA0002), persistence (TA0003), stealth (TA0005), defense impairment (TA0112), C2 (TA0011), impact (TA0040).

  • Isolated lab ready (REMnux/FLARE-VM, simulated network, snapshots)
  • Triage done: hash, file type, strings, reputation
  • Sample classified by behavior (not just “type”)
  • Static and dynamic analysis completed
  • Deobfuscated/unpacked if applicable
  • IOCs extracted and TTPs mapped to MITRE ATT&CK
  • Detection written (YARA/Sigma) and tested against the sample
  • Report with remediation and fleet-wide hunting