☼
⌃
☰

Malware

Table of Contents

Software designed to disrupt, damage, exfiltrate data from, or gain unauthorised access to a computer system. Malware is a delivery mechanism and persistence layer — the specific payload and objective vary by threat actor. Understanding malware categories helps with detection, triage, and response.

Related: Malware Analysis Ransomware Botnet Indicators of Compromise Command and Control Server YARA Persistence

Types

Virus

Requires a host file — attaches itself to a legitimate executable or document. Spreads when the infected host is executed or shared. Less common in modern malware; most current threats are standalone.

Worm

Self-replicating and self-propagating — spreads across networks without user interaction by exploiting vulnerabilities.

Examples: WannaCry (EternalBlue/MS17-010), Conficker, Stuxnet

Trojan

Disguised as legitimate software. Does not self-replicate — relies on the user to install it. Once installed, performs malicious actions in the background: backdoor, credential theft, downloader.

Ransomware

Encrypts files or locks the system, then demands payment for the decryption key. Modern ransomware (double extortion) also exfiltrates data and threatens to publish it. See Ransomware.

TEXT
Typical ransomware kill chain:
1. Initial access (phishing, exposed RDP, unpatched service)
2. Credential theft and lateral movement
3. Exfiltration of sensitive data
4. Deployment of encryption payload
5. Ransom demand

Spyware / Stalkerware

Silently collects user data — keystrokes, screenshots, credentials, location — and exfiltrates it. Often installed alongside other software or via phishing.

Adware

Displays unwanted advertising. Lowest severity; rarely a primary objective but may indicate a broader infection or compromised software supply chain.

Rootkit

Conceals its presence and that of other malware by operating at a privileged level — kernel mode (ring 0) or firmware. Extremely difficult to detect and remove; may survive OS reinstall.

Types:

  • Kernel rootkit — modifies OS kernel, hides processes/files
  • Bootkit — modifies the bootloader or MBR, loads before OS
  • Firmware rootkit — embedded in hardware firmware (NIC, BIOS)
  • Hypervisor rootkit — runs the OS as a guest (very rare)

Keylogger

Captures keystrokes — harvests credentials, credit card numbers, and communications. May be software or hardware.

Fileless Malware

Operates entirely in memory — no files written to disk. Uses legitimate system tools (PowerShell, WMI, rundll32) to execute payloads. Evades file-based AV and leaves minimal forensic trace.

TEXT
Common techniques:
— PowerShell download cradles (IEX, DownloadString)
— Reflective DLL injection
— Process hollowing
— Living-off-the-land (LOLBins)

Backdoor / RAT (Remote Access Trojan)

Provides persistent remote access to the attacker. RATs include features: file access, screen capture, keylogging, webcam, credential harvesting. Often deployed after initial access via another malware type.

Dropper / Downloader

First-stage malware whose only purpose is to download and execute the real payload. Kept small and simple to evade detection; the actual malware is fetched post-infection.

Cryptominer

Uses victim CPU/GPU resources to mine cryptocurrency. Low visibility objective but high resource impact. Common in server compromises and botnet deployments.

Infection Vectors

Vector How it works
Phishing email Malicious attachment or link
Drive-by download Exploit kit targets browser/plugin vulnerability on malicious site
Trojanised software Legitimate-looking installer contains malware
USB / removable media AutoRun or social engineering
Exposed remote services RDP brute force, unpatched VPN, unpatched public-facing services
Supply chain Malicious code injected into legitimate software update
Malvertising Malicious ads serving exploit kits

Indicators of Compromise

Common host-level IOCs across malware families:

TEXT
Persistence:
— New registry Run/RunOnce keys
— New scheduled tasks
— New services with unusual binary paths
— Startup folder entries

Process behaviour:
— cmd.exe / powershell.exe spawned by browser or document app
— Unusual parent-child process relationships
— Process injection (svchost.exe with unusual network connections)
— High CPU with no user activity (cryptominer)

Network:
— Beaconing to unknown external IPs at regular intervals
— DNS queries to DGA-like domains (high entropy, NXDOMAIN hits)
— Outbound traffic on unusual ports
— Large outbound data transfers

Files:
— Executables in %TEMP%, %APPDATA%, or user home directories
— Files with double extensions (.pdf.exe)
— Encrypted or obfuscated scripts

See Indicators of Compromise for the full reference.

Detection Approaches

Approach Mechanism Evaded by
Signature-based AV Hash / byte pattern matching Obfuscation, polymorphism
Heuristic AV Behaviour scoring Slow or staged execution
EDR Process, network, file telemetry Living-off-the-land
YARA rules Pattern matching on strings/bytes XOR/base64 encoding
Sandboxing Dynamic analysis in isolated VM VM detection, sleep delays
Network monitoring Beaconing, DGA, large transfers HTTPS C2, domain fronting

Tips

  • Fileless malware is the most common evasion technique in modern targeted attacks — PowerShell logging and Sysmon are the primary detection mechanisms
  • Double extension tricks (invoice.pdf.exe) work because Windows hides extensions by default — enable extension visibility on all endpoints
  • The presence of a cryptominer is often a sign of poor security hygiene — if a cryptominer can run, so can ransomware
  • Process lineage is the highest-signal EDR indicator — word.exe → cmd.exe → powershell.exe is almost always malicious regardless of the specific command
  • For DFIR: Prefetch and Amcache prove execution even after the malware file is deleted — see windows client DFIR