Digital Forensic Tools

Malware analysis: static and dynamic

Short answer

Static analysis studies a suspicious file without running it. Dynamic analysis runs it in a safe, isolated lab and watches what it does. Most investigations use both.

Why examiners analyse malware

Malware is software built to harm a system or steal data. In a case, the examiner often needs to know what a sample does, what it connects to and what it leaves behind. The answers help to explain how a system was affected and which other systems may be involved.

Malware analysis is a large field of its own. This page only covers the first ideas a student needs.

Static analysis

Static analysis means studying the file without running it. It is safer, but it can miss behaviour that is hidden or packed. Packing means the real code is compressed or scrambled and only unpacks when the program runs.

  • Calculate hashes and check them against known samples.
  • Read readable strings such as web addresses, file paths and commands.
  • Look at the file header and imported functions to see what the program can ask Windows to do.
  • Disassemble or decompile the code to read the logic.

Dynamic analysis

Dynamic analysis means running the sample in a controlled lab and recording what happens. You watch files created, registry changes, processes started and network connections made. The lab must be isolated, usually a virtual machine with snapshots and no route to real networks, because the sample may spread or contact its operator.

Some malware checks whether it is running in a virtual machine or a sandbox and then behaves differently. A single run may not show everything.

Putting it together

A common workflow starts with safe static checks, then dynamic runs, then deeper code reading where needed. Results are written up with indicators of compromise (IOCs), such as file hashes, domain names and registry keys, so other teams can search for the same traces. Follow your lab's own rules for handling live samples.

Static and dynamic analysis

StaticDynamic
Is the sample run?NoYes, in an isolated lab
RiskLowHigher, needs strict isolation
ShowsCode, strings, structureReal behaviour and traces
Weak pointPacked or encrypted codeSamples that detect the lab

Example

An examiner finds an unknown program in a user's download folder. She hashes it, reads its strings and sees a web address. She then runs it in an isolated virtual machine and sees it start a new process and try to contact that address. She records the hash and address as IOCs for the incident report.

Common mistakes

  • Running a sample on a normal work computer or a network connected machine.
  • Trusting only one hash lookup and skipping all other analysis.
  • Forgetting to take a clean snapshot before running the sample.
  • Assuming a quiet run means the file is harmless, when it may detect the lab.
  • Not writing down the exact steps, so the work cannot be repeated.

Key terms

Sample
The suspicious file being studied.
Sandbox
An isolated environment that runs a sample and records its behaviour.
Packing
Compressing or scrambling code so it is harder to read until it runs.
IOC
Indicator of compromise. A trace such as a hash or domain that shows an infection.
Disassembler
A tool that turns machine code into readable assembly instructions.

Questions you may be asked

What is the difference between static and dynamic analysis?

Static analysis examines the file without running it. Dynamic analysis runs it in an isolated lab and observes its behaviour.

Why must dynamic analysis be isolated?

The sample may damage the system, spread to other machines or contact its operator.

Free tools to practise with

Learn more

Written in our own words from public forensic training material and standards. Last reviewed 24 Nov 2026. Procedures and laws differ by country and agency. Follow your own lab's procedure.