Malware Analysis Tutorial
Learn Malware Analysis step by step: 37 lessons in 9 chapters with examples, quizzes, diagrams and projects.
Start learning →
of lessons completed
Getting Started
- What Is Malware Analysis? Learn what malware analysis is, why defenders do it, the questions an analyst answers, and how static and dynamic methods fit together, with safe examples.
- 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.
- The Malware Analysis Workflow Follow the standard malware analysis workflow from triage and static checks to dynamic analysis, reverse engineering and reporting, and learn when to stop.
- Ethics, Law and Safety Rules Learn the legal limits, ethical principles and practical safety rules every malware analyst follows: authorization, containment, data handling and responsible sharing.
Concepts and Safe Lab
- Malware Lifecycle and the Attack Chain Walk through the stages of a malware infection, from delivery and execution to persistence, command and control and impact, and map each stage to analysis evidence.
- Building a Safe Analysis Lab Design an isolated malware analysis lab with virtual machines, host-only networking, snapshots and a simulated internet, and learn the mistakes that cause lab escapes.
- Handling Samples Safely Learn how analysts store, name, transfer and track malware samples: password-protected archives, neutral file names, hashes, chain of custody and cleanup.
- The Analyst Toolkit and Note-Taking Tour the categories of tools used in malware analysis (hashing, strings, PE viewers, monitors, debuggers, disassemblers) and learn a note-taking method that supports reports.
Static Analysis
- Hashing and Fingerprinting Samples Learn how cryptographic hashes, import hashes and fuzzy hashes identify and group malware samples, why one changed byte breaks a hash, and how to look samples up safely.
- Identifying File Types and Magic Bytes Learn how magic bytes reveal a file's real type, why extensions lie, how Office, PDF, archive and script files differ, and how to write a simple file-type checker.
- Extracting Strings Learn to extract ASCII and UTF-16 strings from binaries, filter them into URLs, IP addresses, paths and registry keys, and judge what strings do and do not prove.
- The PE File Format Understand the layout of Windows PE files (DOS header, PE signature, COFF and optional headers, sections) and parse a synthetic PE yourself with Python's struct module.
- Imports, Exports and Sections Read a PE file's import table to infer capabilities, understand exports and DLLs, and spot suspicious section names, permissions and size mismatches with Python examples.
- Entropy and File Structure Anomalies Learn how Shannon entropy reveals compressed or encrypted data, compute it for whole files and sections in Python, and combine it with other structural anomalies.
Dynamic Analysis
- Dynamic Analysis Basics Learn the method of dynamic malware analysis: preparing the lab, taking baselines, running a sample, recording behaviour, diffing system state and handling evasion.
- Monitoring Processes and Files Learn to read process trees, command lines and file events from monitors like Process Monitor, spot suspicious parent-child chains and detect ransomware-style file activity.
- Registry and Persistence Mechanisms Learn how the Windows registry works and how malware persists through Run keys, scheduled tasks, services, startup folders and DLL hijacking, with safe parsing examples.
- Network Behaviour Analysis Analyze malware network behaviour safely: parse DNS packets, spot generated domains and beaconing, read HTTP requests and use a simulated internet to collect indicators.
- Sandbox Reports and Automation Learn what automated malware sandboxes do, how to read their JSON and HTML reports, extract indicators and ATT&CK techniques, and why sandbox verdicts need human review.
Assembly and Reverse Engineering Basics
- x86 Registers and Instructions for Analysts Learn the x86 registers, flags and the instructions you meet most in disassembly, with a runnable toy emulator that steps through a short, harmless routine.
- The Stack and Calling Conventions Understand the stack, stack frames, cdecl, stdcall and the x64 Windows convention so you can find function arguments and return values in disassembly.
- Control Flow in Disassembly: Branches, Loops and Graphs Recognise if/else, loops, switches and function calls in assembly, read control flow graphs, and rebuild basic blocks with a runnable Python stand-in.
Packers and Obfuscation
- Packers and Protectors: Why Samples Hide Their Code Learn what packers, crypters and protectors do, the clues they leave in imports, sections and strings, and see a harmless packing model demonstrated in Python.
- Entropy and Section Analysis: Finding Packed Data Measure Shannon entropy per section and per window to find compressed or encrypted regions in a binary, with runnable Python models and guidance on false positives.
- String Obfuscation and Decoding Recognise XOR-encoded strings, stack strings, base64 layers and API hashing, and practice decoding made-up examples with runnable Python stand-ins.
Behavioural Indicators and YARA
- Indicators of Compromise: Hashes, Domains and Artefacts Learn what indicators of compromise are, the pyramid of pain, how to extract and defang hashes, domains and IPs, and practice with a runnable Python extractor.
- YARA Rule Basics: Strings, Conditions and Metadata Learn the structure of a YARA rule: meta, text, hex and regex strings, modifiers and simple conditions, with a runnable Python stand-in that mimics rule matching.
- YARA Conditions and Rule Tuning Pick distinctive strings, test YARA rules against clean and malicious corpora, measure false positives and misses, and use PE modules and performance tips.
- Behavioural Patterns and API Call Sequences Detect malware by what it does: map API call sequences to capabilities such as persistence, injection and exfiltration, and score made-up traces with Python stand-ins.
Reporting and Response
- Writing Up Your Findings: The Analysis Write-Up Structure a malware analysis write-up for technical and executive readers: summary, sample details, findings, indicators, detections and recommendations, with a runnable generator.
- Mapping Behaviour to MITRE ATT&CK Use the MITRE ATT&CK tactics and techniques as a shared vocabulary: map observed malware behaviour to technique IDs and find detection gaps with runnable Python tables.
- Handing Off to Incident Response: Scoping and Containment Turn analysis results into incident response actions: scope the infection with indicators, contain and eradicate safely, preserve evidence, and learn from it. Includes runnable log-hunting models.
- Sharing Threat Intelligence Safely: TLP, STIX and MISP Learn how to share malware findings responsibly: Traffic Light Protocol markings, STIX and MISP formats, sample submission etiquette and privacy, with runnable JSON and defang demos.
Projects and Practice
- Project: Build a Static Triage Tool Build a small static triage tool in Python that fingerprints a synthetic sample, extracts strings and entropy, scores risk signals and writes a short summary, safely.
- Project: Build a YARA-Style Scanner Build a small rule-based file scanner in Python with text and hex patterns, conditions and a goodware test, then measure its false positives like a real detection engineer.
- Project: Detect Beaconing in Network Logs Build a beacon detector in Python: group connections by host, measure the interval and jitter, score regularity and flag likely command-and-control traffic in made-up logs.
- Malware Analysis Practice Questions and Exercises Test your malware analysis skills with scenario exercises on imports, decoding, YARA, behaviour traces and reports, plus runnable Python checkers and a self-check quiz.