Procedures and Methodology · Topic 11 of 11

Malware Forensics

Why and how to analyze malware: challenges, extraction, indicators, safe lab and testbed setup, tools, rules, and static versus dynamic analysis.

  • 5 min
In a nutshell
  • Goals: understand behavior, extract IOCs, support detection and response.
  • Static analysis does not run the sample, dynamic analysis does.
  • Packing, polymorphism and anti analysis checks make analysis harder.

What it is

Malware forensics is the process of finding malicious software on a system, extracting it safely, and working out what it does and what it changed. The result feeds incident response: how the attacker got in, what was affected, and how to detect and remove it.

The exam asks why analysis is done, how a safe lab is built, which tool category fits a step, and the difference between static and dynamic analysis.

Identifysuspicious file or processExtractpreserve and hashDocumentAnalyzestatic, dynamicIndicatorsIOCs and report

How it works

Why analyze malware

  • find out what the malware does and how it spreads
  • identify what data was taken or damaged
  • extract indicators of compromise (IOCs) to find other infected systems
  • build detection signatures and defenses
  • understand the attacker's methods and, sometimes, attribution
  • support reporting and legal action

Malware analysis challenges

ChallengeEffect
Packing and obfuscationThe real code is hidden until it runs
Anti analysis tricksMalware detects virtual machines or debuggers and behaves differently
PolymorphismThe code changes between copies, so hashes and signatures fail
Fileless techniquesLittle or nothing is written to disk, so memory holds the evidence
Time and skillDeep analysis is slow and needs specialists
RiskUnsafe handling can infect the lab or leak data

Identifying and extracting malware

Suspects are found through antivirus alerts, odd processes in memory, unusual autostart entries, unexpected network connections and logs. Extract carefully:

  1. Record where and when it was found.
  2. Copy it from an image or memory dump rather than the live original, and keep the original in place.
  3. Compute hashes (SHA-256) and record them.
  4. Store the sample in a password protected archive, with the file extension changed, so it cannot be run by accident.
  5. Check the hash against reputation services such as VirusTotal, but do not upload files containing sensitive data.

Malware forensic artifacts and indicators

IndicatorExamples
File systemNew executables in temp or user folders, odd names, recently created files
RegistryRun keys, new services, changed settings
PersistenceScheduled tasks, services, startup folder, WMI subscriptions
NetworkConnections to unusual hosts, beaconing at regular intervals, odd DNS
MemoryInjected code, hidden processes, unusual parent and child processes
LogsEvent 7045 for a new service, 4688 for process creation
HashesFile hashes matching known samples

Why a controlled lab matters

Running malware on a normal network can infect real systems and alert the attacker. A controlled lab keeps the malware contained, makes results repeatable and protects the examiner. It is isolated physically or logically from production and from the internet.

Preparing the testbed

  • Use virtual machines with a clean baseline and take a snapshot, so it can be restored after every run.
  • Use a host only or isolated virtual network, with no route to the corporate network.
  • Disable shared folders, clipboard sharing and drag and drop between host and guest.
  • Install the same software the target ran, to trigger the same behavior.
  • Add monitoring tools before running the sample.
  • Optionally simulate internet services, so the malware shows its network behavior safely.

Supporting tools

PurposeExamples
File properties and stringsstrings, PE viewers such as PEview, Detect It Easy
Disassembly and debuggingIDA, Ghidra, x64dbg
Process and registry monitoringProcess Monitor, Process Explorer, Regshot
Network monitoringWireshark, FakeNet-NG, INetSim
Automated sandboxesCuckoo Sandbox, CAPE, commercial sandboxes
Memory analysisVolatility
Hash and reputationsha256sum, VirusTotal

General rules for malware analysis

  • Never run malware on production or personal computers.
  • Never connect the lab to the real network, or only through a controlled simulation.
  • Work on copies, and keep the original sample safe.
  • Revert to a clean snapshot after each run.
  • Use non persistent, disposable analysis machines where possible.
  • Keep analysis tools and VM software updated, since some malware targets hypervisor flaws.
  • Handle samples as dangerous, even when "inactive".

Documentation before analysis

Record the state before the first run, because later changes need a baseline.

  • sample name, size and hashes, source and time found
  • case number, analyst and lab configuration
  • baseline snapshot of files, registry and processes
  • tool versions and settings
  • the planned steps and the goal of the analysis

Types of malware analysis

TypeDescriptionStrengthLimit
Static analysisExamine the sample without running it: hashes, strings, headers, imports, disassemblySafe, shows structurePacked or obfuscated code hides detail
Dynamic analysisRun it in the lab and watch behavior: files, registry, processes, networkShows real actionsRisky, and may not trigger all behavior
Memory analysisExamine a memory image for injected or hidden codeFinds fileless malwareNeeds a good capture

Most investigations start with basic static analysis, then use dynamic analysis, and bring in code level analysis when needed.

A worked example

A server shows an unfamiliar process beaconing every sixty seconds. The investigator captures memory and a disk image, hashes the suspect binary and records a baseline snapshot of an identical virtual machine.

In an isolated lab the sample is run, while Process Monitor, Regshot and Wireshark record a new service, a Run key and DNS requests. The IOCs go to the incident response team.

How the exam asks about this

  • "Which analysis runs the sample to watch its behavior?" → Dynamic analysis.
  • "Why use a host only network for the testbed?" → To contain the malware and prevent it reaching real systems.
  • "What do you do before running a sample?" → Take a clean snapshot and document the baseline.

What to remember for the exam

  • Goals: understand behavior, extract IOCs, support detection and response.
  • Static analysis does not run the sample, dynamic analysis does.
  • Packing, polymorphism and anti analysis checks make analysis harder.
  • A lab is isolated, snapshot based, with no shared folders.
  • Document and hash the sample before analysis.
Watch out

Malware can detect a virtual machine or lie dormant. A clean run does not prove a sample is harmless.

Common mistakes

Analyzing on a connected workstation. Containment is the first purpose of the lab.

Skipping the baseline. Without it you cannot tell what the malware changed.

Assuming the hash identifies every copy. Polymorphic samples change, so behavior and IOCs matter too.

Check yourself

  • What is an IOC?

    An observable sign of compromise, such as a file hash, domain or registry key, used to find other infections.

  • Why take a snapshot of the lab VM?

    So the machine can be restored to a clean state after each run.

  • Which analysis type is safest first?

    Static analysis, because the sample is not executed.

Topic 11 of 11 in Procedures and Methodology

Test yourself on Procedures and Methodology

The full EC-Council 312-49 question bank has 900 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by EC-Council. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.