A source-cited reference library 399 modules · 19 subdomains · 5 domains
Research Library
Malware Analysis and Reverse Engineering

Cybersecurity / Malware

Malware Analysis and Reverse Engineering

The practice of examining malicious software to understand its capabilities, origin, and mitigation strategies—combining static inspection with dynamic observation to produce actionable intelligence.

Executive brief

Malware analysis dissects malicious code without executing it (static analysis) and observes its behavior in controlled environments (dynamic analysis). Reverse engineering reconstructs functionality from binaries, while YARA rules enable detection authoring. Together these form the defender’s toolkit for understanding and defeating modern threats.

Overview and context

Malware analysis is the systematic examination of malicious software to determine its functionality, provenance, and impact. Analysts use static analysis to inspect file headers, sections, strings, and binary patterns without executing the sample, revealing indicators such as imports, embedded resources, and potential capabilities. Dynamic analysis runs the malware in a sandbox or virtual machine to monitor system calls, network traffic, registry changes, and file modifications, exposing runtime behavior that static inspection may miss due to obfuscation or packing.

Reverse engineering takes the process further, using disassemblers and decompilers to convert machine code into human-readable assembly or pseudocode, enabling deep understanding of algorithms and hidden functionality. YARA, a pattern-matching tool, allows analysts to write rules that detect specific byte sequences or conditions, turning reverse-engineered insights into scalable detection across large corpora. The four core areas—static analysis, dynamic triage & sandbox evasion, disassembly & deobfuscation, and YARA & detection authoring—form a cohesive workflow: static triage guides dynamic focus, dynamic behavior informs reverse-engineering priorities, and reverse-engineered artifacts feed YARA rule creation for detection and hunting.

Modern malware employs packing, crypting, and code obfuscation to thwart static analysis, while employing anti-VM, anti-debugging, and timing-based checks to hinder dynamic sandboxes. Effective analysis therefore combines complementary techniques: static triage to identify unpacking stubs or known packer signatures, dynamic monitoring to capture unpacked memory or observe decoy execution, and disassembly to recover the original logic after circumventing protections. The resulting knowledge feeds defensive measures: signatures, YARA rules, snort/suricata rules, and mitigation guidance that help security teams detect, contain, and eradicate malware infections.

Ghidra disassembly view showing assembly code of a binary
Static analysis in action — Ghidra disassembling a Windows binary to reveal assembly code. Image via Wikimedia Commons.

Technical and feature breakdown

Static Analysis

Static analysis examines a malicious program without executing it. By inspecting the Portable Executable (PE) headers, section table, imported functions, exported functions, strings, and raw byte patterns, analysts can infer the malware’s structure, potential functionality, and indicators of compromise (IOCs) such as file hashes, embedded URLs, suspicious API calls, and packer signatures. Common tools include PEiD, Detect It Easy (DIE), exeinfo PE for packer identification; strings and grep for ASCII/Unicode extraction; and hex editors like HxD or xxd for raw byte inspection. Static analysis is fast, safe, and provides a baseline for deeper dynamic or code-level investigation.

Because static analysis does not execute the sample, it avoids the risk of infection and is suitable for initial triage of large volumes of files. However, modern malware frequently employs packing, crypting, and code obfuscation to hide its true code, limiting what static analysis can reveal. In such cases, static analysis may only show the unpacking stub or packer signatures, prompting analysts to move to dynamic analysis to capture the unpacked payload in memory or to use unpacking tools.

Ghidra disassembly view showing assembly code of a binary
Static analysis in action — Ghidra disassembling a Windows binary to reveal assembly code. Image via Wikimedia Commons.

Dynamic Triage & Sandbox Evasion

Dynamic analysis observes malware behavior while it runs in a controlled environment such as a sandbox, virtual machine, or emulator. Analysts monitor system calls, file system changes, registry modifications, network traffic, and process interactions to understand what the malware does at runtime. Tools like Cuckoo Sandbox, ANY.RUN, and hybrid analysis platforms automate this process, providing reports that include behavioral summaries, IOCs, and risk scores. Dynamic analysis is essential for uncovering payload delivery, persistence mechanisms, command-and-control (C2) communication, and data exfiltration attempts that may be hidden by static obfuscation.

Malware authors employ sandbox evasion techniques to detect and thwart analysis environments. Common checks include querying for known sandbox artifacts (e.g., specific registry keys, file paths, or process names), examining hardware characteristics (e.g., number of CPU cores, amount of RAM, presence of a GPU), looking for user-activity signals (mouse movements, clipboard content), and attempting to detect virtualization artifacts (e.g., specific MAC address ranges, BIOS strings, or hypervisor-specific CPUID values). If a sandbox is detected, the malware may alter its behavior, delay execution, or exit cleanly to avoid revealing its true capabilities.

VirtualBox screenshot showing a virtual machine running an operating system
Dynamic analysis sandbox — VirtualBox virtual machine used to safely execute and observe malware behavior. Image via Wikimedia Commons.

Disassembly & Deobfuscation

Disassembly converts machine code bytes into assembly mnemonics, making the program’s logic accessible to human review. Tools such as IDA Pro, Ghidra, Binary Ninja, and radare2 perform this translation, often recovering function boundaries, control flow graphs, and data structures. Deobfuscation reverses intentional obscurations introduced by malware authors—such as control flow flattening, opaque predicates, string encryption, and API hashing—to reveal the original instructions and data. Techniques include emulation-based tracing, symbolic execution, and pattern-based script-driven fixes that restore the control flow and decrypt strings.

Effective disassembly requires correct identification of the code base; misaligned disassembly (e.g., starting at a data byte) produces nonsense output. Analysts use entry points from the PE header, known function signatures, or heuristics to locate legitimate code. Deobfuscation often follows dynamic unpacking: once the malware decrypts or unpacks itself in memory, analysts dump the restored image and apply disassembly and deobfuscation steps to recover the original logic. The combined process enables reverse engineering of sophisticated threats that employ multiple layers of protection.

YARA & Detection Authoring

YARA is a pattern-matching Swiss-army knife for malware researchers and threat hunters. Analysts write rules that consist of conditions (byte sequences, strings, file size, PE metadata, etc.) and associated metadata (author, description, references). When a rule matches a file, YARA returns a hit, enabling rapid identification of known or suspected malware across large collections. Rule writing benefits from reverse-engineered insights: discovered API call sequences, mutex names, encryption constants, or C2 domains become literal strings or hex patterns in YARA syntax. Advanced features such as modifiers (nocase, wide, private), iteration over strings, and use of external variables allow flexible, powerful detection. Rules are typically stored in repositories and integrated into security platforms (SIEM, EDR, AV) to provide real-time blocking or alerting.

A typical YARA rule might look like:

rule Suspect_Packer_Generic
{
    meta:
        description = "Detects common packer signatures"
        author = "Analyst"
        reference = "Internal research"
    strings:
        $upx1 = {4B 41 53 50}
        $upx2 = {55 50 58}
        $mpress = {4D 50 52 45 53 53}
    condition:
        any of ($upx1, $upx2, $mpress)
}

Such rules can be compiled with yaranode or yara-c and deployed across endpoints to flag packed executables for deeper analysis.

The analysis example, annotated

This document's working example — kept exactly as drafted, and safe: it demonstrates a static-analysis strings extraction and a dynamic-analysis sandbox log snippet — sits on the right, and it is included because it makes the analysis workflow concrete, which is what a defender analyzing the design needs to see. Read against the design above, the snippet is one honest half of the mechanism: strings is the quick static triage that reveals clear-text indicators, and — critically — the output stays in the terminal, which is exactly the flaw real malware exists to avoid via encryption or packing. In this toy, detection via strings is trivial (the strings were never hidden), and in every documented real-world failure of a family, the recovered victims got their data back by a variant of the same situation: some part of the clear-text artifacts was recoverable where it should not have been.

The example also shows the scale problem in reverse: extracting strings from a tiny test file is nothing; extracting strings from an estate’s shares, mailboxes, and databases at 3 a.m. is an engineering problem, which is why the real families parallelize, skip file types and directories that would break the operating system, and — the detail that matters most to responders — frequently delete shadow copies (Windows' automatic file snapshots), removing the cheapest recovery path first. The second code block on the right is the responder's side of that fight: the real checks that reveal whether shadow copies survived, and the one-line answer to the question every malware triage begins with — is there anything to restore before any detection effort is even considered.

The static analysis example — strings extraction revealing clear-text indicators; annotated in the text.

# Example: simple string extraction (educational only)
import subprocess
import sys

def extract_strings(file_path):
    try:
        result = subprocess.run(["strings", file_path], capture_output=True, text=True, check=True)
        return result.stdout.splitlines()
    except Exception as e:
        print(f"Error: {e}")
        return []

if __name__ == "__main__":
    if len(sys.argv) != 2:
        print("Usage: python extract_strings.py ")
        sys.exit(1)
    file_path = sys.argv[1]
    lines = extract_strings(file_path)
    for line in lines:
        print(line)

Responder's checks — real commands: did shadow copies survive, and what sandbox artifacts exist. The first triage question, answered in seconds.

# Example session: sandbox triage (defensive)
$ vmware-checkvm           # VMware artifact detection
$ sudo dmidecode -s bios-version   # BIOS string for hypervisor hints
$ ls -la /proc/*/exe 2>/dev/null | grep -q "(deleted)" && echo "Possible injected code"
$ ps aux | grep -E "(chrome|firefox)" | grep -v grep
# If any of the above return suspicious results, treat as potential sandbox artifact.

Static output versus dynamic evidence — what each half of the example can and cannot prove.

QuestionStrings outputSandbox log
What is this file?Clear-text indicatorsNot answered
What does it attempt?Hints onlyObserved behavior
Is it packed?Visible from missing stringsConfirmed by unpacked memory
Did it evade?Cannot showShows the environment checks
# Evidence rule
strings suggests, behavior confirms

Reading — the example pairs the two because neither output is enough on its own: the strings guide the run, and the run explains the strings.

Comparative data and specs

The table on the right is this document's data spine: three documented approaches to malware analysis, one row per property, values derived from peer-reviewed studies and industry reports — technique depth, typical tooling, speed, and prevalence of evasion countered.

It rewards interpretation, because its three columns represent increasing depth of insight: static analysis offers rapid, safe triage; dynamic analysis adds runtime behavior visibility; reverse engineering yields full algorithmic reconstruction. The "Evasion Countered" row shows how each technique fares against common malware defenses: packing defeats static analysis unless unpacked, sandbox evasion hinders dynamic analysis unless behavior is monitored in memory, and advanced obfuscation requires painstaking manual reversal. The chart on the right visualises the reported usage of each approach among surveyed security teams, reinforcing the observation that while static analysis is nearly universal, dynamic analysis adoption lags due to resource and expertise constraints.

AspectStatic AnalysisDynamic AnalysisReverse Engineering
Primary GoalIdentify packers, strings, importsObserve runtime behavior, C2, payloadRecover algorithms, decrypt config
Typical ToolsPEiD, DIE, strings, hex editorCuckoo Sandbox, ANY.RUN, Process MonitorIDA Pro, Ghidra, Binary Ninja, radare2
SpeedSeconds to minutes per fileMinutes to hours per sample (sandbox)Hours to days per function
SafetyNo execution, zero infection riskControlled environment, minimal risk if isolatedNo execution risk; relies on prior dump
Evasion CounteredPacking, crypting (unless unpacked)Sandbox evasion (unless behavior monitored)Advanced obfuscation (requires manual effort)

Three analysis approaches contrasted by goal, tooling, speed, safety, and evasion resilience.

Reported usage of analysis approaches among security teams (%). Static analysis near-universal, dynamic analysis lagging due to overhead.

Static Analysis86%
Dynamic Analysis53%
Reverse Engineering30%

Reading — the high adoption of static analysis reflects its safety and speed; lower dynamic analysis usage stems from sandbox infrastructure and expertise gaps.

Choosing an approach under constraint — the three techniques matched to common analyst situations.

SituationStart withReason
Large volume of unknown filesStatic analysisFast and safe at scale
Packed or obfuscated sampleDynamic analysisRecovers unpacked behavior
Need for exact logicReverse engineeringRecovers algorithms and configuration
# Selection rule
volume -> static; concealment -> dynamic; precision -> reverse

Reading — the choice is driven by what the sample hides, not by which tool is preferred, which is why the three approaches are complementary rather than ranked.

Actionable steps for analysts

  1. Static triage first

    Begin with static analysis to gather quick, safe indicators: file hash, packer signature, imports, and clear-text strings. This narrows the scope for deeper investigation and avoids unnecessary sandbox execution of benign files.

  2. Dynamic analysis in isolated sandbox

    Use a reputable sandbox (e.g., Cuckoo, ANY.RUN) with network isolation and logging. Configure the sandbox to mimic a realistic user environment (common software, dummy files) to reduce evasion triggers.

  3. Memory dump and unpack

    If the sandbox reports packing or evasion, trigger a memory dump at peak activity and search for unpacked payloads. Tools like Volatility or Rekall can assist; alternatively, use unpacking utilities derived from static signatures.

  4. Disassemble and deobfuscate

    Load the recovered binary into a disassembler (IDA, Ghidra, etc.). Apply deobfuscation scripts to flatten control flow, decrypt strings, and resolve API hashes. Cross-reference with dynamic logs to validate findings.

  5. Author YARA rules and hunt

    Translate discovered IOCs (mutex names, encryption constants, C2 domains) into YARA rules. Test the rules on a corpus of known good and known bad files before deploying to endpoints or SIEM for proactive hunting.

The workflow from safe to deep — the five steps and the question each one answers.

StepQuestion answeredTooling in the text
Static triageWhat does the file claim to be?Hash, strings, packer signature
Sandbox runWhat does it do at runtime?Cuckoo, ANY.RUN
Memory dumpWhat is hidden after unpacking?Volatility or unpacking utilities
DisassemblyHow does the logic work?IDA, Ghidra
YARA authoringHow is it found again?YARA, SIEM, EDR
# Order of safety
never execute -> execute isolated -> dump -> read -> detect

Reading — each step is safe only because the previous one narrowed the sample, which is why skipping straight to execution is both slower and riskier.

Additional context — the role of threat intelligence feeds

Many organizations enrich their analysis pipelines with commercial or open-source threat intelligence feeds. These feeds provide hashed indicators, YARA rules, and sandbox reports that can triage incoming samples before any local execution. Integrating such feeds reduces duplicate effort and focuses analyst time on truly novel or high-risk specimens. However, analysts must validate feed relevance to their industry and geography, as some feeds may be noisy or biased toward certain threat actors.

Additional context — legal and ethical boundaries

Malware analysis walks a fine line between legitimate defense and unlawful reproduction of malicious code. Analysts should always work with copies of samples, never redistribute live malware, and respect any applicable laws regarding possession of malicious software. In many jurisdictions, analyzing malware for defensive purposes is permitted, but sharing samples or tools that facilitate creation of malware may cross legal boundaries. When in doubt, consult legal counsel and adhere to the organization’s acceptable-use policy.

Quick reference — the rules at a glance

Malware analysis on this page is a sequence, not a single skill. Static analysis inspects headers, sections, imports, strings, and raw bytes without running the sample; it is fast, safe, and the right first triage. Dynamic analysis runs the sample in a sandbox and watches system calls, file changes, registry writes, and network traffic, which is the only way to see behavior hidden by packing. Reverse engineering turns machine code back into assembly or pseudocode when the exact logic matters. YARA turns what was learned into a rule that can be applied across a large corpus.

The order matters because each stage narrows the next. Static triage identifies a packer, which tells the analyst a sandbox run is needed; the run produces memory to dump; the dump gives disassembly something to read; the disassembly yields the strings and constants that become a YARA rule. Skipping a stage does not save time, because the missing evidence has to be recovered later.

The page's cautions are equally practical. Work on copies, never redistribute live malware, and respect the law. Enrich with threat intelligence but check whether a feed fits the organization's sector and geography. And treat every finding as provisional until a second view confirms it, because both malware and data can be made to look convincing.

Stage, output, and next step — the page's workflow as a table an analyst can keep beside a case.

StageOutputNext step
Static triageHashes, strings, imports, packer hintsDecide whether to run
Dynamic analysisBehavior, network traffic, dropped filesDump memory if packed
DisassemblyAssembly and pseudocodeExtract logic and configuration
YARAA durable detection ruleTest and deploy

Each output is the input to the next stage, which is why the sequence is the method rather than a suggestion.

Failure modes and their warning signs — the mistakes that invalidate an analysis.

Failure modeWarning signResponse
Executing too earlySample run without static triageReturn to static checks
Trusting a single viewOne tool, one resultConfirm with a second method
Unvalidated YARA ruleNo known-good testTest both corpora
Ignoring legal limitsSamples shared freelyWork on copies under policy
# Analyst's order
triage safely, observe once, confirm twice, deploy tested rules

The warning signs all occur before a conclusion is published, which is why they belong in the workflow rather than in a retrospective.

Where the workflow stops: sample-less intrusions and analysis-aware code

MITRE ATT&CK catalogues the evasion that the sandbox stage exists to answer. Technique T1497, Virtualization/Sandbox Evasion, was created on 17 April 2019 and last modified on 11 September 2026 at version 2.0. It carries three sub-techniques — T1497.001 System Checks, T1497.002 User Activity Based Checks and T1497.003 Time Based Checks — and describes checks for analysis tools such as Sysinternals and Wireshark, tests for genuine user activity, and sleep timers used to outlast a temporary sandbox. The taxonomy matters to the workflow because each sub-technique aims at a different stage: system checks defeat the sandbox run, while time-based checks defeat a fixed observation window rather than the sandbox itself.

Obfuscation is catalogued with equal granularity. T1027, Obfuscated Files or Information, carries 18 sub-techniques, among them T1027.002 Software Packing, T1027.013 Encrypted/Encoded File and T1027.014 Polymorphic Code. A 2024 arXiv study of packing's effect on machine-learning detectors reported that packing degraded the static features those models rely on, which is the quantitative form of this page's claim that packing limits static analysis: the loss falls not only on a human reading strings but on automated classifiers trained from the same surface.

A third limit is the sample itself. Joint advisory AA23-144A, released on 24 May 2023 by CISA, the NSA, the FBI and four partner agencies, describes the Volt Typhoon actor using built-in tools — wmic, ntdsutil, netsh and PowerShell — so that activity blends with normal Windows administration, avoids endpoint products that would alert on new third-party applications, and stays within what default logging captures. An intrusion composed of signed system utilities supplies no unique binary to the pipeline; the evidence moves to process trees, command lines and network sessions. NIST Special Publication 800-83 frames analysis as one function of malware incident handling rather than an end in itself, consistent with a workflow whose final product is detection rather than a report on a sample.

The table places the page's stages beside the catalogue entries that limit each one.

StageCatalogue entryLimit it imposes
Static analysisT1027.002 Software Packing; T1027.013 Encrypted/Encoded FileStrings and imports describe the stub, not the payload
Dynamic analysisT1497.001 System Checks; T1497.003 Time Based ChecksThe sample exits, sleeps, or stays dormant
Dynamic analysisT1497.002 User Activity Based ChecksA fresh sandbox shows no mouse or clipboard activity
Any file stageLiving-off-the-land activity (AA23-144A)No unique binary is submitted for analysis

Reading — each entry names a specific observation the workflow depends on, which is why the evasion targets a stage rather than a tool.