Lesson 10 of 12 · 25m
Behavioral Analysis: Watching It Live
Instrument before you detonate, cut Procmon noise, read the process tree as a story, and hunt the persistence locations that matter — then diff against a clean baseline.
Static analysis tells you what a sample could do. Behavior tells you what it did, on a machine like yours, in an order you can put in a timeline. The discipline is the same every time: baseline, instrument, detonate, diff, revert. Skip the baseline and you will eventually report Windows Update as persistence — I have read that report, and the analyst who wrote it hadn't.
Instrument before you detonate
# Analysis VM, freshly reverted to "clean-baseline"
sysmon64.exe -accepteula -i C:\Tools\sysmonconfig.xml # SwiftOnSecurity's config is the sane default
autorunsc64.exe -accepteula -a * -c -h -s -nobanner > C:\Analysis\autoruns_before.csv
Procmon.exe /AcceptEula /Quiet /Minimized /BackingFile C:\Analysis\run1.pml
# REMnux side: sudo inetsim and sudo tcpdump -i ens33 -w run1.pcapDetonate, give it at least five minutes, then Procmon.exe /Terminate, take autoruns_after.csv, and diff. Autoruns with -h -s gives you hashes and signature status, so the new unsigned entry stands out immediately.
Cutting Procmon noise
A five-minute capture is millions of events. Filter for intent, not volume:
Process Nameis the sample and its children — use the Process Tree view to collect the child PIDs, because the sample's own PID often does nothing.OperationisProcess Create,WriteFile,RegSetValue,TCP Connect,Load Image.- Exclude
C:\Windows\Prefetch, the Procmon backing file, and your own tooling.
Read the process tree as a story
WINWORD.EXE (2140) invoice_0412.doc
└─ cmd.exe (4410) /c powershell -w hidden -enc SQBFAFgAIAAoAE4AZQB3AC0ATwBiAGoAZQBjAHQA...
└─ powershell.exe (5512) -> writes C:\Users\Public\kx.dat
└─ rundll32.exe (6020) C:\Users\Public\kx.dat,DllRegisterServer
└─ CreateRemoteThread -> explorer.exe (1984) [Sysmon EID 8]That -enc blob is base64 of UTF-16LE text; SQBFAFgAIAAoA decodes to IEX ( — you know this already from the script lesson. Now read the tree as the attacker wrote it: Office spawning a shell is the initial-access tell; a signed rundll32.exe loading a .dat from a world-writable folder is the execution tell; the remote thread into explorer.exe is why the sample's own process later disappears. Filter Procmon on the original filename only and you see none of this — living-off-the-land malware does its work inside children of binaries Microsoft signed.
Sysmon events that carry the weight
| EID | Event | What you're looking for |
|---|---|---|
| 1 | Process create | Command lines, parent/child chains |
| 3 | Network connection | Which process talked, to what port |
| 8 | CreateRemoteThread | Injection into another process |
| 10 | Process access | lsass.exe opened = credential theft |
| 11 | File create | Dropped payloads, staging folders |
| 13 | Registry value set | Run keys, service config |
| 22 | DNS query | Domains, with the process that asked |
EID 8 and EID 10 are where the story turns — one is the payload moving into a host process, the other is the reason it came.
Persistence: where to look
HKCU\Software\Microsoft\Windows\CurrentVersion\RunandRunOnce(and the HKLM twins when it had admin)- Scheduled tasks:
C:\Windows\System32\Tasks\, orschtasks /query /fo LIST /v - Services:
HKLM\SYSTEM\CurrentControlSet\Services - Startup folders, COM hijacks under
HKCU\Software\Classes\CLSID\{...}\InprocServer32 - WMI subscriptions:
Get-CimInstance -Namespace root\subscription -ClassName __EventFilter
Field notes
- Behavior is conditional. No reachable C2 often means no stage two; standard user vs admin changes HKCU vs HKLM persistence. Note which conditions you actually tested.
- Record the wall-clock time you detonated so pcap, Procmon, and Sysmon line up into one timeline.
- Revert after every run. Persistence from run one reads as "re-infection" in run two.
- The injected
explorer.exeis a host artifact IR can hunt for across the fleet — hand it over, don't let it die in your notes.
Was this lesson helpful?
Keep reading
Related articles from the SudoSecurity blog.
A Fake GTA 6 ISO Didn’t Install a Game. It Installed a Wiper.
A fake GTA 6 ISO used a believable installer error to cover remote-access malware, browser-data theft, and destructive file wiping. The “License not found” message wasn’t the crack failing. It was there so the victim would stop looking.
CVE-2025-62718: Critical Axios SSRF Vulnerability Explained
A critical SSRF flaw in Axios was used in a North Korean supply chain attack. Here's what it does and how to patch it today.
A Minecraft Mod Is a Program. In 2026, Attackers Started Acting Like It.
A Minecraft mod is a Java program that runs with your account's full permissions, and nothing in the game checks what it does.
Hacktivism, 2021 to Today: From Steel Mills to Power Grids
Part 1 ended on a 70-gigabyte breach in 2021. Since then, hacktivists derailed trains, dumped molten steel on camera, and reached grids in three countries.