Skip to content

Chapter 18 Quiz: Malware Analysis

Test your knowledge of malware analysis techniques, tooling, reverse engineering concepts, and indicator extraction.


Questions

1. An analyst receives a suspicious PE file. Before executing it, they run strings, PEiD, and pestudio on the binary. This approach is best described as which type of analysis?

  • A) Dynamic analysis
  • B) Behavioral analysis
  • C) Static analysis
  • D) Memory forensics
Answer

C — Static analysis

Static analysis examines a file's content without executing it — using tools like strings to extract readable text, PEiD or Detect-It-Easy to identify packers/compilers, and pestudio to inspect PE headers, imports, and embedded resources. This is the first-pass triage step before committing to dynamic execution in a sandbox.


2. A malware sample's PE import table contains only two entries: LoadLibraryA and GetProcAddress. What does this strongly suggest?

  • A) The malware is a simple keylogger with minimal functionality
  • B) The binary is packed or uses dynamic API resolution to hide its true capabilities from static analysis
  • C) The sample is a legitimate Windows system DLL
  • D) The malware uses only kernel-mode APIs
Answer

B — The binary is packed or uses dynamic API resolution to hide its true capabilities from static analysis

LoadLibraryA and GetProcAddress are the two APIs needed to dynamically load any DLL and resolve any function at runtime. A minimal import table with just these two is a strong indicator that the malware resolves its actual imports at runtime (possibly from an encrypted API hash table), deliberately hiding its functionality from import-based static analysis and AV signatures.


3. During dynamic analysis in a sandbox, an analyst observes a sample creating a registry key at HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Userinit with an appended path. What malware behavior does this represent?

  • A) Data exfiltration via registry
  • B) Persistence via Winlogon key hijacking
  • C) Privilege escalation via token impersonation
  • D) Anti-sandbox detection
Answer

B — Persistence via Winlogon key hijacking

The Userinit registry value specifies executables run by Winlogon during user logon. Appending a malicious binary path to this value (e.g., userinit.exe,C:\malware.exe) is a well-documented persistence technique (MITRE ATT&CK T1547.004). It executes on every user logon and is often used by banking trojans and RATs.


4. A YARA rule contains the condition uint16(0) == 0x5A4D and filesize < 500KB and #s1 > 5. What does uint16(0) == 0x5A4D check?

  • A) That the file's MD5 hash matches a known bad sample
  • B) That the first two bytes of the file are 'MZ', identifying it as a Windows PE executable
  • C) That the file contains more than 5 strings matching pattern s1
  • D) That the file was compiled with Visual Studio
Answer

B — That the first two bytes of the file are 'MZ', identifying it as a Windows PE executable

0x5A4D is the little-endian representation of the ASCII bytes 'M' (0x4D) and 'Z' (0x5A) — the "MZ" magic bytes that begin every Windows PE file header. YARA's uint16(0) reads a 16-bit unsigned integer at offset 0. This is a fundamental YARA building block for targeting PE-format files.


5. What is the functional difference between a "dropper" and a "loader" in malware terminology?

  • A) Droppers target Linux; loaders target Windows
  • B) A dropper writes a second-stage payload to disk and executes it; a loader injects or maps a payload directly into memory without writing to disk
  • C) Droppers are used for initial access; loaders are used for lateral movement
  • D) There is no functional difference; the terms are interchangeable
Answer

B — A dropper writes a second-stage payload to disk and executes it; a loader injects or maps a payload directly into memory without writing to disk

The distinction has significant detection implications: droppers create artifacts on disk that can be recovered and analyzed, while loaders (sometimes called "fileless" loaders) inject shellcode or PE files directly into memory — leaving no file-based indicators and evading file-scanning AV. Modern malware families increasingly use loaders as the first stage to deliver in-memory payloads.


6. An analyst opens a suspicious binary in Ghidra and identifies a function that calls VirtualAlloc, WriteProcessMemory, and CreateRemoteThread in sequence targeting a remote process handle. What technique does this strongly indicate?

  • A) Registry persistence
  • B) Classic remote process injection (T1055.001)
  • C) DLL side-loading
  • D) Scheduled task creation
Answer

B — Classic remote process injection (T1055.001)

The VirtualAlloc → WriteProcessMemory → CreateRemoteThread sequence is the textbook implementation of remote process injection: allocate memory in the target process, write shellcode or a DLL path into it, then create a remote thread to execute it. This is one of the most commonly reversed injection patterns and is a foundational technique taught in reverse engineering courses.


7. Which anti-analysis technique involves a malware sample checking whether the time elapsed between two operations is abnormally long, exploiting the fact that analysts often step through code slowly in a debugger?

  • A) API unhooking
  • B) Timing-based anti-debugging (RDTSC/GetTickCount delta checks)
  • C) Sandbox evasion via user interaction detection
  • D) Self-modifying code
Answer

B — Timing-based anti-debugging (RDTSC/GetTickCount delta checks)

Malware uses RDTSC (Read Time-Stamp Counter) or GetTickCount to record timestamps at two points and compare the delta. Under normal execution the delta is microseconds; under debugging where an analyst has set breakpoints or is single-stepping, the delta is seconds or minutes. If the delta exceeds a threshold, the malware exits, alters behavior, or self-destructs.


8. A wiper malware sample is analyzed and found to overwrite the Master Boot Record (MBR) with zeros before rebooting. What is the forensic impact of this action?

  • A) The operating system becomes temporarily unresponsive but recovers after a clean reboot
  • B) The MBR destruction prevents the system from booting, and without a backup the disk's partition table and boot loader are irrecoverable from that location
  • C) All files on the system are encrypted
  • D) The action only affects the C: drive's file system
Answer

B — The MBR destruction prevents the system from booting, and without a backup the disk's partition table and boot loader are irrecoverable from that location

Wipers that overwrite the MBR (as seen in WhisperGate, NotPetya, and Shamoon) cause immediate system unavailability: the BIOS/UEFI cannot locate the boot loader, and the partition table is gone. Recovery requires re-imaging from backup. This technique is used by destructive threat actors to cause maximum disruption rather than financial gain.


9. When extracting network-based IOCs from a malware sample during dynamic analysis, which tool is most appropriate for capturing and inspecting the full packet stream of C2 beacon communications?

  • A) IDA Pro
  • B) x64dbg
  • C) Wireshark
  • D) Volatility
Answer

C — Wireshark

Wireshark captures live network traffic during sandbox execution, allowing analysts to inspect C2 beaconing intervals, protocol details, HTTP request headers, DNS queries, and embedded strings in network payloads. This produces network-based IOCs (IP addresses, domains, URL patterns, User-Agent strings, JA3 TLS fingerprints) that can be operationalized in detection rules.


10. A RAT (Remote Access Trojan) sample is found to use process hollowing for execution. Which sequence of Windows API calls is characteristic of process hollowing?

  • A) OpenProcess → VirtualAllocEx → WriteProcessMemory → CreateRemoteThread
  • B) CreateProcess (suspended) → NtUnmapViewOfSection → VirtualAllocEx → WriteProcessMemory → SetThreadContext → ResumeThread
  • C) LoadLibrary → GetProcAddress → VirtualProtect → CreateThread
  • D) RegOpenKeyEx → RegSetValueEx → CreateProcess
Answer

B — CreateProcess (suspended) → NtUnmapViewOfSection → VirtualAllocEx → WriteProcessMemory → SetThreadContext → ResumeThread

Process hollowing (T1055.012) creates a legitimate process in a suspended state, unmaps its memory contents, writes malicious code into the now-empty process space, updates the thread context to point to the malicious entry point, then resumes the thread. The result is a legitimate process name (e.g., svchost.exe) executing malicious code — a strong AV/EDR evasion technique.


Scoring

Score Performance
9–10 Expert — Malware analysis techniques fully internalized
7–8 Proficient — Ready to perform tier-2 malware triage and indicator extraction
5–6 Developing — Review Chapter 18 static/dynamic analysis and PE structure sections
<5 Foundational — Re-read Chapter 18 before proceeding

Return to Chapter 18 | Next: Chapter 19