Lesson 3 of 9 · 24m
Behavior Over Signatures: Detection Logic That Ages Well
Why brittle IOC rules are easy to write and easy to evade, and how to build behavior detections that survive attacker variation.
A junior detection engineer asks "what string do I look for?" A senior one asks "what must be true for this attack to work?" That distinction is the difference between blocking one sample and forcing an adversary to change tradecraft.
IOCs are smoke, behaviors are heat
File hashes, domains, and mutex names are cheap to rotate. Behavioral requirements are expensive to avoid. An attacker can rename mimikatz.exe; they cannot steal LSASS material without touching LSASS or duplicating its logic elsewhere.
Bad detection:
selection:
Image|endswith: '\mimikatz.exe'Better detection:
selection:
TargetImage|endswith: '\lsass.exe'
GrantedAccess|contains:
- '0x1010'
- '0x1FFFFF'
filter_known_tools:
SourceImage|endswith:
- '\procdump64.exe'
- '\comsvcs.dll'
condition: selection and not filter_known_toolsThe second rule still has filters and edge cases, but it encodes the attacker's objective — process access to LSASS — rather than a disposable filename.
Composition beats singleton events
Real intrusions are chains. A single unsigned binary spawning PowerShell might be noise; Outlook spawning PowerShell with an encoded command that creates a run key is a story.
detection:
selection_parent:
ParentImage|endswith: '\outlook.exe'
selection_child:
Image|endswith:
- '\powershell.exe'
- '\pwsh.exe'
selection_flags:
CommandLine|contains:
- ' -enc '
- ' -w hidden'
- 'downloadstring'
condition: all of selection_*Do not obsess over one perfect rule. Use layered analytics: one noisy rule for initial execution, another for persistence, another for credential access. Correlation can tolerate weak signals when the sequence is strong.
Understand the bypass cost
Ask what the attacker must give up to evade your detection. If the answer is "rename a file," the rule is fragile. If the answer is "stop using valid accounts, stop touching disk, and avoid all suspicious parent-child relationships," you have imposed cost.
This is also how you avoid magical thinking. A PowerShell logging rule does not detect attackers who never use PowerShell. A DNS tunnel detector does not see tunneling over an approved HTTPS proxy. Write the assumptions down in the rule description.
Precision is part of the detection
Behavioral does not mean broad. The best detections use environment-aware constraints: server roles, expected admin tool paths, maintenance windows, and asset criticality. A rule that fires 2,000 times a day is technically behavioral and operationally useless.
Field notes
- Prefer detection on sequences and relationships over isolated events.
- Write rule descriptions that include assumptions, data dependencies, and bypasses.
- Keep high-fidelity narrow rules even if they look simple; not everything needs to be clever.
- Review old rules for rules that detect your red team's last trick rather than the underlying behavior.
Was this lesson helpful?