Malware Analysis | What It Is, How It Works, Techniques, Tools & a Step-by-Step Process (Complete Guide)

Malware analysis

Malware analysis is the process of studying a malicious file or program to understand what it does, how it works, and how to detect and stop it. Analysts do this by examining the code without running it (static analysis), observing it in a controlled environment (dynamic analysis), or combining both, then turning the findings into indicators and detections.

If you are new to the topic, our guide to what malware is covers the basics before you dive into analysis.

Why malware analysis matters

Malware analysis matters because it turns an unknown threat into something defenders can act on. Without analysis, a security team knows only that a suspicious file exists. With it, the team knows whether the file steals credentials, encrypts data, or opens a backdoor, which systems are affected, and what to block.

Goals of malware analysis (behavior, indicators, attribution, response)

Malware analysis usually pursues four goals. The first is understanding behavior: what the malware does to a system and how it persists. The second is extracting indicators of compromise, such as domains, file hashes, and registry keys, that can be searched for across a network. The third is attribution, which means linking the sample to a known malware family or threat group. The fourth is supporting response, so the team can contain the incident and prevent a repeat.

Malware analysis vs malware detection vs incident response

Malware detection decides whether something is malicious, malware analysis explains what it is and how it behaves, and incident response handles containment and recovery. They overlap but answer different questions. A scanner detects a file, an analyst analyzes it, and the response team uses the results to clean up. Our guide on scanning for malware covers detection.

Types of Malware Analysis

Static analysis

Static analysis examines a sample without executing it. Analysts look at file properties, embedded strings, code structure, and imported functions to form a first impression of the sample’s purpose. It is fast and safe because the malware never runs.

Dynamic analysis

Dynamic analysis runs the sample in an isolated environment. It records what it does, such as the processes it creates, the files and registry keys it changes, and the network connections it makes. It reveals real behavior that static analysis may miss, especially when the code is packed or encrypted.

Hybrid analysis

Hybrid analysis combines static and dynamic work, using each to answer the questions the other cannot. For example, a dynamic run may reveal a decrypted payload in memory, which the analyst then examines statically. Most professional investigations are hybrid.

Which approach to use when

Start with static analysis for a quick, low-risk overview, move to dynamic analysis to see behavior, and add reverse engineering only when the first two leave important questions open. Quick triage may stop after static checks, while a major incident or a new malware family usually justifies the full hybrid approach.

Static Malware Analysis

Analysis

File properties, hashes and strings

The first static steps are identifying the file type, calculating its hashes (such as SHA-256), and extracting readable strings. Hashes let you check whether the sample is already known, and strings can reveal URLs, file paths, commands, and error messages that hint at the malware’s purpose.

PE headers, imports and packers

For Windows executables, analysts examine the Portable Executable (PE) header to see its sections, compile timestamp, and imported functions. Imports such as those for networking, process injection, or cryptography suggest capabilities. High entropy or unusual section names often point to a packer, which compresses or encrypts the real code to hide it.

Strengths and limits of static analysis

Static analysis is safe, fast, and good for triage, but it can be defeated. Packing, obfuscation, and encrypted payloads hide the real code, and a clean static result does not prove a file is harmless. It tells you what the file appears to be, not always what it does.

Static malware analysis tools (by category)

Static tools fall into three groups: file and string inspectors (for hashes, file types, and strings), PE analyzers (for headers, imports, and sections), and pattern matchers such as YARA. The table later in this guide lists examples of each.

Dynamic Malware Analysis

Analysis

How to run malware safely for analysis

Dynamic analysis must run only in an isolated virtual machine with no route to production systems or personal data. Take a clean snapshot first, turn off shared folders and clipboard sharing, and keep the network contained so the malware cannot reach real targets. The lab section below covers the setup.

Monitoring processes, files, registry and network activity

During a run, analysts record the processes the sample launches, the files it creates or modifies, the registry keys it writes for persistence, and the network traffic it generates. Comparing the system state before and after execution shows what changed, and the network capture often reveals command-and-control servers.

Anti-analysis and sandbox evasion

Many malware families try to detect analysis. They check for virtual-machine artifacts, look for debuggers, wait before acting, or require user activity such as mouse movement before running. If the sample appears to do nothing, the analyst should consider that it has recognized the environment and adjust the setup or the timing.

Dynamic malware analysis tools (by category)

Dynamic tools include behavior monitors (for processes, files, and registry), network capture tools, fake-service simulators that respond to the malware’s network requests, and automated sandboxes that run the entire sample and generate a report.

Malware Reverse Engineering

Analysis

Disassembly, decompilation and debugging

Malware reverse engineering is the process of studying a program’s compiled code to understand its logic. A disassembler converts machine code into assembly, a decompiler turns it into readable pseudo-code, and a debugger lets the analyst step through the program while it runs. Together they expose how the malware works internally.

What reverse engineering reveals

Reverse engineering shows what behavior alone cannot: encryption routines, hidden configuration data, command-and-control protocols, anti-analysis tricks, and the exact conditions under which the malware acts. It also lets analysts extract configuration values, such as server addresses, directly from the code.

Skills and background you need

Reverse engineering malware requires comfort with x86 and x64 assembly, the Windows API, basic C programming, and how operating systems manage memory and processes. It is the slowest part of analysis, which is why most teams use it selectively.

Reverse engineering malware vs malware analysis

Reverse engineering is one technique inside malware analysis, not a separate discipline. Malware analysis is the overall investigation, and reverse engineering is its deepest layer, used when static and dynamic results leave key questions unanswered.

Malware Sandbox: How It Works

Analysis

What is a malware sandbox?

A malware sandbox is an isolated environment that runs a suspicious file safely and records its behavior. The malware believes it is on a real computer, while the sandbox logs the processes, file and registry changes, network traffic, and screenshots, and often produces a report with a verdict.

Automated sandboxes vs manual virtual machines

Automated sandboxes run samples without human effort and return a structured report in minutes, making them ideal for high volume. Manual virtual machines give the analyst full control to interact with the malware, test ideas, and pause at specific moments, but they take far more time. Many teams use a sandbox for triage and a manual VM for the samples that matter most.

What sandboxes miss (evasion and delayed execution)

Sandboxes can miss malware that detects the virtual environment, waits out the analysis window, requires a specific user action, or activates only for certain targets. A benign sandbox report therefore does not clear a sample on its own, especially if the behavior looks suspiciously quiet.

How to choose a sandbox (criteria, not a ranking)

Choose a sandbox based on criteria that fit your work, not a leaderboard. Useful questions are which operating systems and file types it supports, how well it resists evasion, how detailed the reports are (process trees, network activity, indicator extraction, MITRE ATT&CK mapping), whether it has an API for automation, how it handles speed and scale, and whether samples you submit stay private. That last point is important, because others can see files uploaded to a public service.

How to Analyze Malware: A Step-by-Step Process

To analyze malware, work through six steps in order: triage, static analysis, dynamic analysis, reverse engineering when needed, indicator extraction, and reporting. Each step builds on the last and can be repeated as new questions appear.

Analysis

Step 1: Triage and safe handling

Start by handling the sample safely. Store it in a password-protected archive, work inside an isolated VM, and never open it on your main machine. Record its hashes, then check whether it is already known and how it has been classified. This tells you whether a full analysis is worth the effort.

Step 2: Static analysis

Identify the file type, extract strings, inspect the headers and imports, and look for signs of packing. The goal is a first hypothesis about what the sample is and what it might do.

Step 3: Dynamic analysis

Run the sample in a snapshot-backed VM with monitoring tools and a contained or simulated network. Record the processes, file and registry changes, persistence methods, and any attempts to contact external servers, then revert to the clean snapshot.

Step 4: Reverse engineering (when needed)

If behavior alone leaves gaps, such as an encrypted configuration or an unknown protocol, load the sample into a disassembler or decompiler and trace the relevant functions. Focus on the questions you still need answered instead of reading the whole program.

Step 5: Extract indicators of compromise

Collect the observable artifacts: file hashes, domains, IP addresses, URLs, mutex names, registry keys, and file paths. Note which are durable and which are easy for attackers to change; a hash changes with every rebuild, but a communication pattern is much harder to alter.

Step 6: Write the report

Summarize the findings so another team can act on them. A good report states what the sample is, how it behaves, how it was analyzed, what indicators were found, and what defenders should do. The report is the lasting output of the work.

Malware Triage and Automated Malware Analysis

Analysis

What is malware triage?

Malware triage is a fast, initial assessment of a sample to determine its severity and how much analysis it needs. It usually combines hash lookups, reputation checks, a quick static look, and an automated sandbox run, so analysts can focus their time on the samples that matter.

Automated analysis pipelines

Automated analysis pipelines take in samples from sources such as email gateways, endpoint tools, and honeypots, run them through static checks and a sandbox, enrich the results with threat intelligence, and output indicators and a verdict. Volume is the reason they exist: the AV-TEST Institute registers more than 450,000 new malicious programs and potentially unwanted applications every day, far more than people can analyze by hand.

Automation with SOAR

Security orchestration, automation, and response (SOAR) platforms can connect these steps into playbooks. A suspicious attachment can be automatically submitted to a sandbox, the results checked, and indicators pushed to blocking tools, with a human reviewing only the uncertain cases.

When automation is enough, and when it is not

Automation is enough for known families, high-volume, routine triage. It is not enough for new or targeted malware, samples that evade sandboxes, or cases where you need the configuration or the exact business impact. In those cases, a human analyst takes over.

Malware Analysis Tools by Category

Comparison table

Malware analysis tools are best understood by the job they do. The examples below illustrate each category and are not endorsements or rankings.

CategoryWhat it doesExamples
File and string inspectionIdentifies file type, hashes, strings, entropyDetect It Easy, strings utilities, PEStudio
PE and header analysisInspects headers, imports, sectionsPE-bear, CFF Explorer, pefile (Python)
Disassemblers and decompilersConvert binaries into assembly or pseudo-codeGhidra, IDA, Binary Ninja, Cutter
DebuggersStep through code while it runsx64dbg, WinDbg
Behavior monitoringRecords processes, files, and registry activityProcess Monitor, Process Explorer, Regshot
Network analysisCaptures traffic and simulates servicesWireshark, INetSim, FakeNet-NG
Memory forensicsExamines RAM images for hidden codeVolatility
SandboxesRuns samples automatically and reports behaviorCAPE, Joe Sandbox, VMRay, Any.Run
Pattern matchingIdentifies families with rulesYARA
Analysis toolkitsPreconfigured analysis environmentsREMnux, FLARE VM

Open-source malware analysis tools

Many of the most widely used malware analysis tools are open source and free. Ghidra, x64dbg, Wireshark, Volatility, and YARA cover reverse engineering, debugging, network analysis, memory forensics, and rule-based detection, and REMnux packages many of them into one Linux toolkit. The original Cuckoo Sandbox has seen little development in recent years, and community projects such as CAPE continue its approach.

Malware analysis software for teams

Teams usually add commercial or hosted analysis software when they need scale, support, and integration. Look for an API for automation, private handling of submitted samples, integration with your SIEM and SOAR tools, detailed and exportable reports, and coverage of the operating systems you defend. As with sandboxes, match the tool to your workflow instead of following a ranking.

How to Build a Safe Malware Analysis Lab

Isolated virtual machines and snapshots

A malware analysis lab is built from virtual machines that you can reset at will. Create a Windows analysis VM with your monitoring and analysis tools installed, take a clean snapshot, and revert to it after every run. If you use a dedicated host, it should contain no personal data or credentials.

Network isolation and fake services

Keep the lab network isolated, using an internal or host-only network, so malware cannot reach the internet or your real devices. A second VM running simulated services, such as fake DNS and web servers, lets you watch what the malware tries to contact without letting it reach real infrastructure.

Safe handling rules

Safe handling rules prevent accidents. Keep samples in password-protected archives, never run them outside the lab, defang URLs and addresses when you write them down, and never reuse real-life accounts or passwords in the lab.

Malware analysis VM setup checklist

  1. Use a dedicated machine or a fully isolated hypervisor with no personal data.
  2. Build a Windows analysis VM and, if needed, a Linux VM for simulated network services.
  3. Disable shared folders, clipboard sharing, and drag-and-drop between host and guest.
  4. Place both VMs on an isolated internal network with no route to the internet or your home network.
  5. Install and configure your monitoring, analysis, and capture tools, then take a clean snapshot.
  6. Revert to the clean snapshot after every sample, and keep a log of what you did.

Network, Memory and Forensic Analysis

Network malware analysis and packet analysis

Network malware analysis looks at the traffic a sample generates to uncover command-and-control servers, data exfiltration, and download behavior. Packet capture tools show DNS lookups, connection patterns, and protocols, though encrypted traffic limits how much can be read without extra work.

Memory forensics and malware forensics

Memory forensics examines a snapshot of a system’s RAM to find what disk-based analysis misses. It can show hidden or injected processes, network connections, and unpacked payloads that only exist in memory, and it is a core part of malware forensics after an incident.

Analyzing fileless and botnet malware

Fileless malware runs in memory and abuses built-in tools such as PowerShell, so analysts rely on memory images, script logs, and persistence mechanisms such as scheduled tasks and WMI subscriptions. Botnet malware analysis focuses on how bots receive instructions, so analysts study the communication protocol, configuration, and command-and-control infrastructure.

Indicators, YARA Rules and Malware Analysis Reports

What are indicators of compromise?

Indicators of compromise (IOCs) are observable artifacts that suggest a system has been infected, such as file hashes, domains, IP addresses, URLs, mutex names, and registry keys. They let defenders search their own environment. Some are fragile because attackers can easily change a hash or domain, while behavioral patterns are harder to evade.

YARA malware rules

YARA is a pattern-matching tool that identifies malware using rules that describe strings, byte patterns, and conditions. Analysts write YARA rules to detect a malware family across files and memory. The following simple, illustrative rule shows the structure:

rule Example_Family_Config
{
    meta:
        description = "Illustrative rule: structure only"

    strings:
        $a = "example-c2-path" ascii
        $b = "example-config-key" ascii

    condition:
        uint16(0) == 0x5A4D and 2 of them
}

The condition checks that the file starts with the Windows executable header and that both strings are present.

Structure of a malware analysis report

A clear malware analysis report includes an executive summary, sample details such as hashes and file type, static findings, dynamic findings, network behavior, the indicators of compromise, a mapping of behaviors to the MITRE ATT&CK framework, detection rules, and recommended actions. For a real example of a published technical analysis, see DeXpose’s in-depth technical analysis of Lumma Stealer.

AI and Machine Learning in Malware Analysis

Machine learning malware detection

Machine learning malware detection trains models on large collections of malicious and benign files so they can flag new samples by their features and behavior. It is widely used in security products because it can catch threats that have no signature yet.

What AI can and cannot do

AI can speed up triage, group similar samples, and help explain decompiled code, but it cannot replace an analyst. Models can produce false positives and confident mistakes, and attackers adapt their code to evade them, so always verify AI output.

Python for malware analysis

Python is the most common scripting language in malware analysis. Analysts use it to parse file formats, extract configuration data, automate repetitive tasks, and write tooling around libraries such as pefile and yara-python.

What Does a Malware Analyst Do?

Daily tasks and responsibilities

A malware analyst examines suspicious samples, determines what they do, extracts indicators, writes detection rules, and documents the results. Analysts also support incident response, track malware families over time, and share findings with other teams.

Skills and mindset

Malware analysts need a solid understanding of operating systems, networking, and scripting, plus enough assembly knowledge to read code when required. Just as important are curiosity, patience, and the habit of documenting every step so the work can be repeated.

How to start: malware analysis for beginners

Beginners should start with fundamentals: how Windows works, basic networking, and a scripting language such as Python. Then build a safe lab, practice static analysis on simple samples, and read published analysis reports to see how experienced analysts reason. A classic hands-on book such as Practical Malware Analysis is a popular companion for this stage.

How to practice malware analysis safely

Practice only inside your isolated lab, use samples from reputable educational sources and training platforms, and keep a log of each exercise. Start with simple, well-documented samples before moving to real-world threats, and never test samples on a machine connected to your personal accounts.

Common Malware Analysis Mistakes and Safety Risks

Running samples on your main machine

Running a live sample on your everyday computer is the most dangerous mistake. Always use an isolated VM, because malware can encrypt files, steal credentials, or spread across your network.

Forgetting snapshots and network isolation

Without snapshots, you cannot return to a clean state, and without network isolation the malware can reach real targets or alert its operators. Revert after every run and keep the lab network contained.

Relying on one tool or one technique

No single tool or method catches everything. Combine static and dynamic work, compare tools, and treat a quiet result with suspicion, since evasive malware may simply be hiding.

Sharing indicators or samples unsafely

Uploading a sample to a public service can expose it to others, and sharing live URLs or addresses can lead people to click them. Defang indicators when you share them, and use private submission options for sensitive samples.

Why Analysis Findings Matter for Exposure

How indicators and stealer analysis link to leaked credentials

Analysis explains how malware works, but not what it has already stolen. Infostealer analysis can reveal where the malware sends data and what it collects, while stolen credentials often end up in logs traded on underground markets. Our guides to infostealer malware and the combolist dark web ecosystem explain how that data travels and is reused.

Check Whether Malware Has Already Exposed Your Data

Understanding a threat is only half the work, because the next question is what it already took. DeXpose’s Free Dark Web Report checks whether your email or credentials appear in leaked datasets and infostealer logs, so you can secure accounts before they are abused. Security teams can go further with breached credentials monitoring, which watches continuously for exposed employee and customer credentials.

Frequently Asked Questions (FAQ)

What is malware analysis?

Malware analysis is the process of studying a malicious file or program to understand what it does, how it works, and how to detect and stop it.

What are the types of malware analysis?

The main types are static analysis, which examines a sample without running it, dynamic analysis, which observes it in a controlled environment, and hybrid analysis, which combines both. Reverse engineering is a deeper technique used within them.

What is the difference between static and dynamic malware analysis?

Static analysis inspects the file without executing it, so it is fast and safe but can be defeated by packing and obfuscation. Dynamic analysis runs the sample in isolation to see its real behavior, but it is riskier and can be evaded by anti-analysis tricks.

What is a malware sandbox?

A malware sandbox is an isolated environment that runs a suspicious file and records its behavior, including the processes it starts, the files and registry keys it changes, and the network traffic it generates.

How do you analyze malware step by step?

Triage and handle the sample safely, run static analysis, run dynamic analysis in an isolated lab, reverse engineer unclear parts, extract indicators of compromise, and write a report.

What tools are used for malware analysis?

Common categories include string and file inspectors, PE analyzers, disassemblers and decompilers, debuggers, behavior and network monitors, memory forensics tools, sandboxes, and YARA. Examples include Ghidra, x64dbg, Wireshark, Volatility, and CAPE.

Is reverse engineering part of malware analysis?

Yes. Reverse engineering is the deepest technique within malware analysis and is used when static and dynamic results leave important questions unanswered.

What does a malware analyst do?

A malware analyst examines suspicious samples, determines their behavior, extracts indicators, writes detection rules, documents findings, and supports incident response.

Can AI analyze malware?

AI can help with triage, classification, and code explanation, but it can make mistakes and be evaded, so analysts should verify its output rather than rely on it alone.

More from the knowledge hub

All guides