GO KALI FREE
IntermediateEthical Hacking

Malware Analysis: Beginner's Guide to Static & Dynamic Analysis in Kali Linux

Learn malware analysis from scratch: build a safe isolated lab, triage samples with static and dynamic analysis, write YARA rules, and report IOCs.

#malware analysis#how to learn malware analysis#malware analysis tutorial#malware analysis for beginners#static malware analysis#dynamic malware analysis#yara#flare-vm#remnux#what is malware analysis

What Is Malware Analysis?

Malware analysis is the controlled examination of suspicious software to determine what it does, how to detect it, and what systems it may have affected. Analysts combine static inspection, safe execution, code review, and evidence collection inside isolated labs. The goal is defensive understanding and reliable indicators, not creating or improving malware.

Malware analysis turns an unknown or suspicious file into documented evidence. It answers three practical questions:

  • What does it do? Identify capabilities such as persistence, credential access, file modification, process injection, or network communication.
  • How do we detect it? Extract hashes, strings, file paths, registry keys, domains, behavioral patterns, and YARA conditions.
  • What damage has it done? Determine which systems, accounts, files, and network destinations may be affected.
  • Malware analysis is not malware development. A defensive analyst studies existing artifacts, validates observations, produces detections, and helps incident responders contain affected systems.

    The Four Types of Malware Analysis

    The four types overlap. A normal investigation begins with low-risk static triage, moves to controlled behavior monitoring, and uses code or memory analysis only when the earlier evidence is insufficient.

    TypeWhat it isSkill levelSpeedRelative riskWhat it reveals
    Static analysisExamining a file without intentionally executing itBeginner to intermediateFastLowFile type, hashes, strings, imports, sections, metadata, and packing clues
    Dynamic analysisRunning a sample in an instrumented, isolated environmentIntermediateMediumHighProcesses, files, registry activity, services, tasks, and network traffic
    Code analysisReading disassembly, decompiled code, or debugger stateIntermediate to advancedSlowMedium to highAlgorithms, configuration parsing, hidden branches, API use, and unpacked logic
    Behavioral analysisCorrelating endpoint, memory, and network effects over timeIntermediateMediumHighThe sample's operational pattern and impact across the system

    "Low risk" never means safe for a normal workstation. File parsers can have vulnerabilities, archives can be mishandled, and a double-click can accidentally execute a sample. Perform every type of analysis inside the lab.

    Is Malware Analysis Legal and Safe?

    Malware analysis is generally performed for legitimate research, education, incident response, and defense. Analyze only files you obtained legally, on systems you own or are explicitly authorized to test. Laws and license terms vary by jurisdiction, so organizational or legal guidance takes priority.

    Ethical analysis means you do not deploy malware against another person, redistribute dangerous samples carelessly, expose victim data, or use findings to improve malicious operations.

    Never analyze malware on a machine you care about. Never download a sample to the host. Never give a lab VM unrestricted Internet access.

    A safe workflow requires:

  • A disposable virtual machine with snapshots
  • An internal, isolated virtual network
  • No bridged or NAT networking during analysis
  • No shared folders, clipboard, drag-and-drop, or USB passthrough
  • No personal accounts, passwords, cloud storage, or production data
  • A snapshot revert after every detonation
  • Host protections left enabled
  • Isolation reduces risk but does not make malware harmless. Stop immediately if containment is uncertain.

    Build a Safe, Isolated Lab First

    This is the most important part of malware analysis. Tools cannot compensate for weak containment.

    Recommended lab architecture

    Use VirtualBox or VMware to create the following environment:

    Windows 10 FLARE-VM guest
               |
        Isolated virtual switch
               |
    REMnux guest running INetSim and packet capture
               |
    Optional Kali guest for triage and analysis
    
    No NAT, bridge, host LAN, or real Internet uplink
    

    An internal virtual network is preferable because it has no host interface. If your hypervisor calls the available option "host-only," firewall the host-side interface, expose no host services, and verify that the guest cannot reach the host LAN. Host-only networking is not automatically the same as complete host isolation.

    Build the Windows analysis VM

    Create a disposable Windows 10 VM with enough storage and memory for FLARE-VM, debuggers, logs, and snapshots. During a clean provisioning phase, before any sample has entered the guest, install tools from official sources. If installation requires temporary Internet access, use it only on this clean VM and remove the uplink afterward.

    Once provisioning is complete:

  • Remove NAT and bridged adapters at the hypervisor level.
  • Turn off Windows updates inside the guest to keep the lab state reproducible.
  • Disable Microsoft Defender and any other antivirus only inside this isolated, disposable guest.
  • Keep the host antivirus, firewall, operating system, and hypervisor protections enabled.
  • Disable shared clipboard, shared folders, drag-and-drop, printer sharing, and USB passthrough.
  • Do not sign in with a personal Microsoft account.
  • Install FLARE-VM and verify its core utilities.
  • Take a snapshot named clearly, such as TOOLS-INSTALLED-CLEAN.
  • An unprotected Windows guest must never be used for browsing, email, normal work, or real Internet access.

    Add REMnux and Kali

    REMnux is a Linux distribution designed for malware analysis. Use it as the second machine on the isolated switch for:

  • INetSim network simulation
  • Packet capture and protocol inspection
  • Static triage
  • Document and script analysis
  • YARA and memory-analysis support
  • Kali is useful for hashing, YARA, packet analysis, scripting, and general Linux utilities. Kali is not containment by itself. Keep it as a VM, and do not run Windows malware through Wine.

    INetSim on REMnux can emulate common services. FakeNet-NG can provide similar network simulation from the Windows guest. Both let a sample believe services exist without exposing it to a real command-and-control server.

    Snapshot and revert discipline

    Maintain at least these snapshots:

  • Clean operating system
  • Tools installed and configured
  • Pre-execution analysis state
  • Before each dynamic run, create or restore a known snapshot. After collecting evidence, shut down or power off the guest and revert it. Do not continue using a contaminated VM because it appears normal. Snapshots support recovery, but network isolation remains the primary control.

    Lab checklist

    ControlRequired state
    HostPatched, protected, and never stores or extracts samples
    HypervisorCurrent version with integration features disabled
    Windows guestDisposable Windows 10 VM with FLARE-VM
    Guest securityDefender, updates, and third-party antivirus off only after isolation
    NetworkInternal or carefully controlled host-only switch with no real uplink
    SimulationREMnux with INetSim or Windows with FakeNet-NG
    Data transferNo shared folders, clipboard, drag-and-drop, or USB
    SnapshotsClean baseline plus pre-run snapshot
    CredentialsNo personal, corporate, or production credentials
    VerificationIsolation checked before every execution session

    Your Malware Analysis Toolkit

    ToolPrimary use
    FLARE-VMWindows malware-analysis tool collection installed in a disposable Windows guest
    REMnuxLinux analysis environment for triage, network simulation, memory work, and document analysis
    Kali LinuxHashing, scripting, YARA, packet analysis, and supporting command-line work
    GhidraDisassembly, decompilation, function analysis, and cross-references
    x64dbgUser-mode debugging of 32-bit and 64-bit Windows programs
    VolatilityProcess, network, memory-region, and artifact analysis from memory images
    YARAPattern-based file and memory classification
    Wireshark and TSharkInteractive and command-line packet analysis
    Process MonitorWindows process, file, registry, and thread event collection
    PE-bearPortable Executable header, section, import, and resource inspection
    Detect It EasyFile identification, compiler clues, and packer detection
    FLOSSExtraction of static, stack, and decoded strings
    capaIdentification of likely program capabilities from code features
    peframe and the pev suitePE metadata, sections, imports, resources, and suspicious characteristics
    strings, xxd, and ExifToolPrintable text, raw bytes, and metadata inspection
    BinwalkEmbedded content and signature discovery
    INetSim and FakeNet-NGSimulated DNS, HTTP, and other network services
    ScyllaDumping a debugged Windows process and rebuilding its import table

    No single tool supplies a verdict. Treat every result as a clue that must be corroborated.

    Basic Static Triage: Your First 10 Minutes

    Work from a copy inside the isolated VM. Preserve an original with restricted permissions and record every transformation.

    mkdir -p ~/cases/case-001/{original,working,output}
    chmod 400 ~/cases/case-001/original/suspicious.bin
    cp ~/cases/case-001/original/suspicious.bin ~/cases/case-001/working/suspicious.bin
    cd ~/cases/case-001/working
    

    1. Hash the file

    sha256sum suspicious.bin
    md5sum suspicious.bin
    

    Use SHA-256 as the primary identifier. MD5 remains useful for correlation with older reports, but it should not be treated as collision-resistant proof.

    2. Perform a hash-only threat-intelligence lookup

    Search an approved VirusTotal-style service using the SHA-256 value. Do not upload the sample. Public services may retain and distribute uploaded files. A missing result means only that the service has no matching record; it does not prove the file is safe.

    3. Identify the real file type

    Extensions are untrusted.

    file suspicious.bin
    xxd -l 64 suspicious.bin
    exiftool suspicious.bin
    

    Magic bytes can reveal a PE file beginning with MZ, an ELF file, a script, an archive, or a document despite a misleading name.

    4. Extract strings

    strings -a -n 6 suspicious.bin | tee ../output/strings.txt
    floss suspicious.bin | tee ../output/floss.txt
    

    Look for URLs, domains, user agents, registry paths, commands, error messages, mutex names, file paths, and configuration labels. Ordinary library strings are not proof of malicious behavior.

    5. Inspect executable structure

    For ELF files:

    readelf -h suspicious.elf
    

    For PE files:

    peframe suspicious.exe
    readpe suspicious.exe
    diec suspicious.exe
    capa suspicious.exe
    

    Review architecture, section names, section permissions, imports, resources, entry point, entropy, and timestamp fields. High entropy can suggest compression or encryption, but legitimate installers can also have high entropy. PE timestamps can be forged or copied.

    6. Check for embedded content and packing

    binwalk suspicious.bin
    diec suspicious.exe
    

    Packing clues include a small import table, an entry point inside an unusual section, high-entropy sections, and known packer signatures. These are heuristics, not conclusions.

    7. Form a hypothesis before execution

    Write down:

  • Probable file type and architecture
  • Whether it appears packed
  • Suspected capabilities from strings and imports
  • Expected child processes or network protocols
  • Evidence you need from dynamic analysis
  • Conditions that require you to stop
  • Running first and investigating later leads to missed evidence and unnecessary risk.

    Worked Example: Triaging a Safe Practice File

    This walkthrough uses only the EICAR antivirus test file. EICAR is a harmless standardized test string, not real malware, although security products intentionally detect it. Create it only inside the isolated lab. Never weaken host security to keep it from being quarantined.

    1. Create the test file

    In the REMnux or Kali lab VM:

    mkdir -p ~/cases/eicar-demo
    cd ~/cases/eicar-demo
    printf '%s' 'X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*' > eicar.com
    wc -c eicar.com
    
    Illustrative output:
    68 eicar.com
    

    The byte count confirms that no newline was appended.

    2. Record hashes

    sha256sum eicar.com
    md5sum eicar.com
    
    Illustrative output format:
    <64 hexadecimal characters>  eicar.com
    44d88612fea8a8f36de82e1278abb02f  eicar.com
    

    The hash uniquely identifies this exact byte sequence for case correlation. If your value changes, first check for an added newline or altered character.

    3. Identify the file

    file eicar.com
    xxd -l 24 eicar.com
    
    Illustrative output:
    eicar.com: EICAR virus test files
    

    Some file signature databases instead describe it as ASCII text.

    Illustrative output:
    00000000: 5835 4f21 5025 4041 505b 345c 505a 5835  X5O!P%@AP[4\PZX5
    00000010: 3428 505e 2937 4343                      4(P^)7CC
    

    The .com extension does not make this a normal Windows executable. The bytes show printable text rather than a PE MZ header.

    4. Extract strings

    strings -a -n 6 eicar.com
    
    Illustrative output:
    X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
    

    A single distinctive string explains why signature-based controls identify the file.

    5. Try format-specific parsers

    readelf -h eicar.com
    
    Illustrative output:
    readelf: Error: Not an ELF file - it has the wrong magic bytes at the start
    

    Now test it as a PE file:

    peframe eicar.com
    
    Illustrative outcome:
    The parser reports that the input does not contain a valid PE/DOS header.
    

    Exact peframe wording varies by version. Both results support the hypothesis that the file is a text-based test artifact, not an ELF or PE program.

    6. Match it with YARA

    Create eicar.yar:

    rule eicar_training_test
    {
        meta:
            description = "Detects the harmless EICAR training string"
            purpose = "lab validation"
    
        strings:
            $eicar = "EICAR-STANDARD-ANTIVIRUS-TEST-FILE" ascii
    
        condition:
            $eicar
    }
    

    Run the rule:

    yara eicar.yar eicar.com
    
    Illustrative output:
    eicar_training_test eicar.com
    

    7. Interpret the evidence

    ObservationMeaning
    Stable hashesThe exact artifact can be tracked and compared
    Printable contentThere is no hidden executable structure in this practice file
    No ELF or PE headerNative executable parsers correctly reject it
    Distinctive EICAR textSignature-based detection is expected
    YARA matchThe rule works against a known, harmless fixture
    No execution requiredStatic evidence fully answers this exercise

    Do not execute the file. There is no behavioral value to gain, and static triage has already explained it.

    Dynamic Analysis: Watching Malware Run

    Dynamic analysis intentionally executes a file, so use only a verified isolated snapshot. If the network, snapshot, or data-transfer controls are uncertain, do not proceed.

    A basic detonation workflow is:

  • Restore the clean analysis snapshot.
  • Start REMnux, INetSim or FakeNet-NG, and packet capture.
  • Record the baseline process list and system time.
  • Start Process Monitor with focused filters.
  • Execute the approved lab artifact once.
  • Observe it for a defined period without interacting unnecessarily.
  • Save logs, screenshots, PCAP data, and notes.
  • Power off and revert the Windows VM.
  • Use Process Monitor to capture:

  • Process creation and parent-child relationships
  • File creation, deletion, and modification
  • Registry reads and writes
  • Service or scheduled-task changes
  • DLL and image loads
  • Access-denied or missing-file events
  • Noriben can summarize Process Monitor activity, while ProcDOT can combine process and network logs into a graph.

    On REMnux, identify capture interfaces and start TShark:

    tshark -D
    sudo tshark -i 1 -w case-001.pcap
    

    Review selected protocols afterward:

    tshark -r case-001.pcap -Y 'dns or http or tls'
    

    INetSim can be started on the isolated REMnux machine:

    sudo inetsim
    

    Configure the victim's DNS and gateway only toward the simulator. Never reconnect the victim to real Internet access to "see whether it works."

    Record process lineage, dropped files, registry keys, persistence, mutexes, DNS names, HTTP paths, TLS server names, destination ports, timing intervals, and failed actions. Distinguish observed behavior from assumptions.

    Static Code Analysis with Ghidra

    Ghidra lets you inspect code without intentionally executing it.

  • Create a project inside the analysis VM.
  • Import the working copy and confirm its hash.
  • Let Ghidra detect the format and processor architecture.
  • Run auto-analysis with default analyzers.
  • Inspect the entry point, imports, strings, functions, and call graph.
  • Open the decompiler and rename functions as their purpose becomes clearer.
  • Follow cross-references from distinctive strings and imported APIs.
  • A stripped PE may not contain an obvious function named main. Start from the entry point, runtime initialization, exported functions, or references to meaningful strings.

    Suspicious API combinations can guide review:

  • VirtualAlloc or VirtualProtect for memory allocation and permission changes
  • CreateRemoteThread with process-access APIs for possible injection
  • WinINet functions such as InternetOpen, InternetConnect, and HttpSendRequest
  • Registry and service APIs for persistence
  • Cryptographic APIs for configuration decoding or protected communications
  • These APIs also appear in legitimate software. The decompiler output is an approximation, so verify important conclusions against the disassembly and cross-references.

    Dynamic Code Analysis with x64dbg

    Use x64dbg only in the isolated FLARE-VM snapshot. A debugger executes the target under analyst control; it does not make the target safe.

    A beginner workflow is:

  • Open the working copy in the correct x32dbg or x64dbg variant.
  • Confirm the image architecture and initial entry point.
  • Set breakpoints at the entry point or selected imported APIs.
  • Step over routine initialization and inspect calls, registers, stack data, and memory regions.
  • Watch for newly allocated executable memory or a jump from a small unpacking stub into a larger code region.
  • Save addresses, screenshots, and observations before reverting.
  • When the original code has been unpacked in memory, Scylla can dump the process and help rebuild imports. Preserve hashes for both the packed original and the dumped artifact.

    A beginner should stop and report when the sample loads a kernel driver, attempts destructive actions, triggers unknown exploit behavior, requires real credentials, defeats containment, or enters complex anti-debugging logic. Do not move it to the host or restore Internet access to bypass a limitation.

    Unpacking Malicious Code

    Packing compresses, encrypts, or transforms a program and adds a small stub that reconstructs the original code at runtime. Packing can reduce the value of strings, imports, and decompilation.

    Useful signs include:

  • High-entropy sections
  • Unusual section names or permissions
  • Very few imports
  • An entry point in an unexpected section
  • Writable and executable memory
  • Detect It Easy or peframe packer clues
  • A Bytehist distribution consistent with compressed or encrypted data
  • None of these proves maliciousness.

    If Detect It Easy confirms ordinary UPX, test and unpack only a working copy:

    cp packed.exe packed.work.exe
    upx -t packed.work.exe
    upx -d packed.work.exe
    

    Modified UPX samples may not unpack successfully. Do not overwrite the original.

    For other packers, a controlled debugger workflow can allow the stub to unpack into memory. Once execution reaches the reconstructed code, dump the process and rebuild imports with Scylla. This is a working artifact for analysis, not a trusted executable.

    If unpacking fails, document the packer clues, memory regions, entry point, and limitations. Try FLOSS, capa, memory forensics, and behavioral evidence. Do not download unknown "unpacker" programs or upload the sample to an unapproved service.

    Writing Your First YARA Rule

    A YARA rule has three main parts:

  • meta: documentation such as purpose, author, source, and confidence
  • strings: text, hexadecimal patterns, or regular expressions
  • condition: the logic required for a match
  • Start with two or more distinctive strings from triage instead of one common word.

    rule lab_unique_string_demo
    {
        meta:
            description = "Matches two strings in a harmless training fixture"
            author = "Analyst"
            scope = "lab"
    
        strings:
            $marker = "LAB-TRAINING-MARKER-2026" ascii wide
            $url = "training.example.invalid/checkin" ascii
    
        condition:
            filesize < 2MB and all of them
    }
    

    Create a harmless fixture and test it:

    printf '%s\n' 'LAB-TRAINING-MARKER-2026 training.example.invalid/checkin' > harmless-fixture.txt
    yara lab_demo.yar harmless-fixture.txt
    
    Illustrative output:
    lab_unique_string_demo harmless-fixture.txt
    

    The following training rule models a Cobalt-Strike-style beacon configuration pattern. Its strings are invented generic lab markers, not real family strings, and it must not be used for attribution.

    rule generic_beacon_style_training
    {
        meta:
            description = "Training-only beacon-style configuration pattern"
            warning = "Generic example, not family attribution"
    
        strings:
            $b1 = "LAB_BEACON_CONFIG" ascii wide
            $b2 = "sleep_interval_ms" ascii wide
            $b3 = /\/api\/v[0-9]+\/checkin/ ascii
    
        condition:
            uint16(0) == 0x5A4D and
            filesize < 5MB and
            2 of ($b*)
    }
    

    Test real rules against confirmed matches and a broad benign corpus. Reduce false positives with file-type checks, size limits, combinations of uncommon strings, byte patterns, and clear scope.

    Store rules in version control with separate experimental, production, and tests directories. Record the source, date, confidence, false-positive notes, and change history. Do not commit live malware samples to the rule repository.

    Memory Forensics with Volatility

    Memory analysis matters when a payload is unpacked only in RAM, injected into another process, deleted from disk, or otherwise fileless. Memory images can contain credentials, private documents, and encryption material, so protect them as sensitive evidence.

    With Volatility 3, begin by validating the image:

    python3 vol.py -f memory.raw windows.info
    python3 vol.py -f memory.raw windows.psscan
    python3 vol.py -f memory.raw windows.netscan
    python3 vol.py -f memory.raw windows.malfind
    

    Each plugin answers a different question:

  • windows.psscan scans for process objects, including candidates not present in a normal active-process list.
  • windows.netscan finds network endpoints and associates them with processes where possible.
  • windows.malfind highlights memory regions with characteristics associated with injected or unusual executable code.
  • A hit is not automatic proof of malware. Correlate process lineage, signatures, mapped files, network activity, and disassembly.

    To dump a selected process address space for further analysis:

    mkdir -p dumps
    python3 vol.py -f memory.raw -o dumps windows.memmap --pid 1234 --dump
    

    Hash every resulting file. Run strings, FLOSS, capa, YARA, and code analysis against the dump, but do not execute it outside the isolated lab.

    Extracting IOCs and Writing the Report

    Indicators of compromise can include:

  • SHA-256 and other file hashes
  • Domains, URLs, IP addresses, ports, and HTTP paths
  • File names and file-system paths
  • Registry keys and values
  • Services and scheduled tasks
  • Mutexes or named pipes
  • Process trees and command lines
  • Certificate details or TLS server names
  • YARA and behavioral detection logic
  • Hashes are precise but easy for an attacker to change. Domains and IP addresses can be shared, reassigned, or sinkholed. Include context and confidence rather than publishing an unexplained list.

    IOC extraction checklist

  • Hash the original, working copy, dropped files, and unpacked artifacts.
  • Record timestamps in UTC.
  • Save exact process parent-child relationships.
  • Export relevant Process Monitor events.
  • Preserve DNS, HTTP, TLS, and connection evidence from PCAP data.
  • Document persistence and configuration storage.
  • Separate observed indicators from inferred ones.
  • Defang external indicators in human-readable reports when appropriate.
  • Preserve raw values in a controlled machine-readable annex.
  • Recommended report structure

  • Executive summary: What the artifact appears to do and why it matters.
  • Sample information: Hashes, size, type, source, acquisition time, and archive details.
  • Static findings: Strings, imports, sections, metadata, packing, and capabilities.
  • Dynamic findings: Process, file, registry, persistence, and network behavior.
  • Code and memory findings: Important functions, decoded configuration, or injected regions.
  • IOC table: Indicator, type, source evidence, confidence, and recommended action.
  • Detection recommendations: YARA, endpoint behavior, DNS, proxy, and SIEM ideas.
  • Limitations: Unexecuted branches, failed unpacking, anti-analysis, or unavailable context.
  • Appendix: Tool versions, commands, screenshots, logs, and rules.
  • SOC analysts need searchable indicators and detection logic. Incident responders need timelines, scoping clues, containment guidance, and confidence levels. Write for both audiences without overstating attribution.

    Where to Get Practice Samples Safely

    Begin with EICAR and self-made harmless programs. Move to live samples only after the lab has been reviewed and you can demonstrate snapshot and network discipline.

    SourceUse
    MalwareBazaarTagged malware samples and hashes for authorized research
    theZooA deliberately dangerous research repository with documented handling warnings
    vx-undergroundResearch archives intended for experienced defensive analysts
    Practical Malware Analysis labsControlled exercises associated with the book and its authorized lab materials

    Handling rules are non-negotiable:

  • Access samples only from inside the isolated VM.
  • Never download, extract, or temporarily store a sample on the host.
  • Use password-protected archives; the common researcher password is "infected" where the source documents it.
  • Treat encryption as transport protection, not containment.
  • Record the original name, hash, source, and archive.
  • Never rename malware to something harmless-looking.
  • Do not email, sync, or casually redistribute samples.
  • Revert the VM after extraction or execution.
  • Avoid random file-sharing sites, unsolicited attachments, and unknown sample links.

    Malware Analysis Cheat Sheet

    Commands below assume you are already inside the isolated analysis VM.

    Static triage commands

    GoalCommand
    SHA-256 hashsha256sum sample.bin
    MD5 correlation hashmd5sum sample.bin
    Identify file typefile sample.bin
    View first 64 bytesxxd -l 64 sample.bin
    Extract stringsstrings -a -n 6 sample.bin
    Find decoded stringsfloss sample.exe
    Read metadataexiftool sample.bin
    Inspect ELF headerreadelf -h sample.elf
    Inspect PE characteristicspeframe sample.exe
    Inspect PE with pevreadpe sample.exe
    Detect compiler or packerdiec sample.exe
    Identify capabilitiescapa sample.exe
    Find embedded databinwalk sample.bin
    Test a YARA ruleyara rules/index.yar sample.bin
    Test UPX integrityupx -t sample.exe
    Unpack confirmed UPX copyupx -d sample.work.exe

    Dynamic analysis tools and commands

    GoalTool or command
    Capture file and registry activityProcess Monitor
    Summarize Process Monitor eventspython Noriben.py
    Visualize process and PCAP relationshipsProcDOT
    List capture interfacestshark -D
    Capture isolated trafficsudo tshark -i 1 -w case.pcap
    Review DNS, HTTP, and TLStshark -r case.pcap -Y 'dns or http or tls'
    Simulate network servicessudo inetsim
    Simulate services on WindowsFakeNet-NG
    Debug a Windows processx64dbg or x32dbg
    Dump and rebuild importsScylla
    Scan memory processespython3 vol.py -f memory.raw windows.psscan
    Scan memory connectionspython3 vol.py -f memory.raw windows.netscan
    Find suspicious memory regionspython3 vol.py -f memory.raw windows.malfind
    Clean the environmentPower off and revert the VM snapshot

    Troubleshooting Malware Analysis Problems

    ProblemSafe response
    Sample will not run in the VMVerify architecture, file type, required arguments, dependencies, and loader errors. Do not restore real Internet access to fetch dependencies.
    Sample detects the VM or debuggerDocument the anti-analysis evidence. Check ordinary resource and clock problems, but do not weaken containment or move the sample to the host. Escalate advanced work.
    No network traffic appearsConfirm the capture interface, simulated DNS, victim gateway, and INetSim or FakeNet-NG logs. The behavior may also be delayed or conditional.
    Sample appears packedPreserve the original, inspect it with Detect It Easy and peframe, try upx -d only for confirmed UPX, or plan a controlled memory dump.
    Strings show nothing usefulTry FLOSS, Unicode strings, resources, embedded files, memory analysis, and unpacking. Empty output does not mean no configuration exists.
    YARA rule matches everythingReplace common strings with distinctive combinations, add file-type and size constraints, and test against a large benign corpus.
    Volatility profile is missingWith Volatility 3, run windows.info and verify symbols and image integrity. Preload required symbols before isolation. Use legacy profiles only when working with Volatility 2.
    FLARE-VM installation failsRebuild from a clean supported VM, verify administrator access, disk space, memory, and installer logs. Use trusted provisioning access only before samples enter the VM.

    Common Mistakes Beginners Make

  • Using a daily computer: A VM on a machine containing irreplaceable data is not an ideal research host.
  • Leaving NAT or bridged networking enabled: This can expose real systems and command-and-control infrastructure.
  • Running the file before forming a hypothesis: Important evidence may be missed.
  • Uploading the sample instead of looking up its hash: Public services may redistribute submissions.
  • Trusting one scanner or tool: Names, capability labels, and packer detections can be wrong.
  • Treating an IOC as permanent truth: Infrastructure changes, hashes are brittle, and context matters.
  • Keeping a contaminated snapshot active: Revert after every execution, even if no obvious behavior occurred.
  • Best Practices

  • Assign a case ID and record hashes before analysis.
  • Preserve an immutable original and analyze only working copies.
  • Use UTC timestamps, tool versions, and reproducible notes.
  • Corroborate static, dynamic, network, code, and memory evidence.
  • Revert the victim after every detonation and regularly test isolation.
  • Review detections against benign data and report limitations honestly.
  • Your Learning Path: From First Sample to Job-Ready

    Four weeks can establish a repeatable foundation, but job-ready judgment requires continued practice, reporting, and feedback.

    WeekFocusDeliverable
    1Build the isolated lab; practice hashes, file, strings, and YARA with EICAR and harmless filesLab diagram, safety checklist, and EICAR triage report
    2Study PE structure, imports, sections, entropy, Detect It Easy, FLOSS, and capaStatic report and tested training YARA rule
    3Monitor a self-made harmless Windows program with Process Monitor, TShark, INetSim, and FakeNet-NGProcess timeline, PCAP notes, and IOC table
    4Analyze a harmless compiled program with Ghidra and x64dbg; review a practice memory imageFull report with static, dynamic, code, and memory findings

    After this foundation:

  • Use TryHackMe and Hack The Box for guided cybersecurity practice without relying on invented room names.
  • Work through the exercises in *Practical Malware Analysis* using only its authorized lab materials.
  • Follow a SANS-style progression: operating systems and networking, incident response, malware triage, reverse engineering, memory forensics, and advanced analysis.
  • Build a sanitized portfolio containing reports, diagrams, harmless fixtures, and YARA tests, never live samples.
  • Practice explaining confidence and limitations, not just tool output.
  • Summary

    Malware analysis combines static triage, controlled execution, code review, memory forensics, and reporting. The safest workflow begins with hashes and file identification, forms a hypothesis before execution, uses simulated services instead of real Internet access, and reverts the victim after every run.

    The essential rules are simple:

  • Never analyze malware on a machine you care about.
  • Never download or extract samples on the host.
  • Use isolated VMs, snapshots, and simulated networking.
  • Preserve evidence and distinguish observations from assumptions.
  • Build detections from multiple reliable features.
  • Report IOCs with context, confidence, and limitations.
  • Knowledge Check

  • Why should a malware-analysis VM use an isolated virtual network instead of NAT?
  • Which hash should be the primary file identifier?
  • What is the main difference between static and dynamic analysis?
  • Why is a PE compile timestamp not conclusive evidence?
  • What do INetSim and FakeNet-NG provide?
  • Why should a YARA rule combine multiple distinctive features?
  • What do windows.psscan, windows.netscan, and windows.malfind examine?
  • What should happen to the victim VM after every dynamic run?
  • Answers: 1. NAT can expose the sample to real systems and the Internet; 2. SHA-256; 3. Static analysis does not intentionally execute the file, while dynamic analysis observes execution; 4. It can be forged, copied, or altered; 5. Simulated network services; 6. To reduce false positives; 7. Processes, network endpoints, and suspicious memory regions; 8. Power it off and revert to a clean snapshot.

    Keep Learning

    Guides

  • Reverse Engineering Guide
  • Reverse Shell Guide
  • Digital Forensics Basics
  • OSINT Guide
  • Steganography Tools Guide
  • Linux Privilege Escalation Guide
  • Tools

  • Ghidra
  • Radare2
  • Binwalk
  • Volatility
  • Frequently Asked Questions

    What is malware analysis?

    Malware analysis is the controlled examination of suspicious software to learn what it does, how it can be detected, and what damage it may have caused. It can include static file inspection, isolated execution, reverse engineering, network monitoring, and memory forensics. Its purpose is defensive understanding, not malware development.

    How do I learn malware analysis from scratch?

    Start with operating-system fundamentals, networking, PE and ELF file structures, and basic Python or scripting. Build an isolated FLARE-VM and REMnux lab, then practice hashes, file identification, strings, YARA, and reporting with EICAR or self-made harmless files. Add dynamic analysis, Ghidra, x64dbg, and Volatility gradually.

    What is the difference between static and dynamic malware analysis?

    Static analysis examines a file without intentionally running it. It reveals hashes, strings, headers, imports, metadata, and packing clues. Dynamic analysis executes the file in an isolated, instrumented environment to observe processes, file changes, registry activity, persistence, and network traffic. Most investigations use both.

    What tools do I need for malware analysis?

    A practical beginner toolkit includes FLARE-VM, REMnux, Ghidra, x64dbg, Process Monitor, Wireshark or TShark, YARA, Detect It Easy, FLOSS, capa, peframe, the pev suite, and Volatility. INetSim or FakeNet-NG should simulate network services. The isolated lab and snapshot process are more important than any individual tool.

    What is FLARE-VM and what is REMnux?

    FLARE-VM is a Windows-based collection of reverse-engineering and malware-analysis tools installed in a disposable Windows VM. REMnux is a Linux distribution designed for malware triage, document analysis, network simulation, and related forensic work. They are commonly connected through an isolated virtual switch with no real Internet uplink.

    Is malware analysis legal?

    Malware analysis is commonly performed for authorized research, education, incident response, and defense. Analyze only samples you obtained legally and only on systems you own or have explicit permission to use. Do not deploy malware, expose victim data, or redistribute samples carelessly. Laws and contractual restrictions vary, so obtain legal guidance when necessary.

    Can I do malware analysis in Kali Linux?

    Yes. Kali can perform hashing, strings extraction, YARA scanning, packet analysis, scripting, ELF inspection, and many static tasks. It is also useful as a supporting VM. Native Windows behavior is better observed in an isolated Windows FLARE-VM guest. Kali itself must still be isolated and should not be treated as automatic containment.

    How long does it take to learn malware analysis?

    There is no universal timeline. A focused four-week plan can establish a safe workflow and basic triage skills, but independent reverse engineering and reliable detection work require sustained practice. Progress depends on prior knowledge of assembly language, Windows internals, networking, programming, incident response, and report writing.

    What is a YARA rule?

    A YARA rule is a pattern-based description used to identify files or memory containing selected strings, byte sequences, structural properties, or logical combinations. A good rule uses distinctive, corroborated features and includes metadata and scope. It must be tested against both known matches and a broad benign corpus to control false positives.

    Where can I get malware samples to practice safely?

    Begin with EICAR or self-made harmless programs. Experienced analysts can use legally obtained samples from MalwareBazaar, theZoo, vx-underground, or authorized Practical Malware Analysis labs. Download and extract them only inside an isolated VM, use password-protected archives where provided, never store them on the host, and revert after analysis.

    Can malware analysis get me a job?

    Malware-analysis skills can support roles in security operations, incident response, digital forensics, detection engineering, threat research, and reverse engineering. Tools alone do not guarantee employment. A strong portfolio should show safe lab design, reproducible analysis, accurate reports, tested YARA rules, and clear handling of uncertainty without containing live malware.

    What is the difference between malware analysis and reverse engineering?

    Malware analysis is the broader investigation of a suspicious artifact, including triage, behavior, network activity, memory, IOCs, impact, and reporting. Reverse engineering focuses more narrowly on understanding code through disassembly, decompilation, and debugging. Reverse engineering is one technique used when broader malware-analysis evidence is insufficient.

    Continue Learning

    Ethical Hacking · Intermediate

    Reverse Engineering for Beginners: Learn to Analyze Binaries with Ghidra & GDB

    Learn reverse engineering from scratch: analyze binaries with Ghidra and GDB, read assembly, crack a practice binary, and build a starter toolkit.

    Ethical Hacking · Intermediate

    Cloud Penetration Testing: Complete Guide to AWS, Azure and GCP Security Testing

    Cloud penetration testing for AWS, Azure, and GCP: the 6-phase methodology, IAM analysis, chained attack paths, and tools — with a worked lab example.

    Ethical Hacking · Beginner

    Ethical Hacking Fundamentals: Principles, Methodology, and Best Practices

    Learn the core principles of ethical hacking, the five-phase penetration testing methodology, types of security testing, and how to build your own hacking lab.

    Ethical Hacking · Beginner

    Steganography Tools: Best Free Tools to Hide & Detect Hidden Data in Kali Linux

    Learn the best free steganography tools for Kali Linux: hide files in images with Steghide and OpenStego, then detect hidden data with zsteg.

    Related Security Tools

    Forensics

    Autopsy

    Learn how to use Autopsy, the free digital forensics software, in a hands-on practice case. Start with a verified disk image, run ingest modules, look for deleted files, and use keyword hits and timeline entries to build a report.

    Forensics

    Binwalk

    Learn how to use Binwalk to scan a firmware image, read the signature table, extract embedded filesystems, and spot encrypted regions — a beginner tutorial for Kali Linux.

    Reverse Engineering

    GDB

    Learn how to use GDB, the GNU Debugger, by building a small C program with debug symbols and following it from the first breakpoint to a crash. Use the same steps to inspect variables, read a backtrace, and tell when a core dump or a look at the assembly would help.

    Forensics

    Volatility

    Volatility is an advanced open-source memory forensics framework used for incident response and malware analysis, allowing extraction of digital artifacts from volatile memory (RAM) samples.

    Written by GO KALI FREE Team