Lesson 1 of 4 · 25 min read

Pyramid of Pain — Why Behavioral Detections Cost Adversaries More

David Bianco’s Pyramid of Pain (2013) is one of the most useful mental models in detection engineering. It answers a question that every detection team faces: “given limited engineering time, what type of detection creates the most durable value?”


The Six Levels

          ╔═══════════════════════════════╗
          ║    TTPs (Tactics, Techniques) ║  ← Most painful to change
          ╠═══════════════════════════════╣
          ║           Tools               ║
          ╠═══════════════════════════════╣
          ║    Network/Host Artifacts     ║
          ╠═══════════════════════════════╣
          ║       Domain Names            ║
          ╠═══════════════════════════════╣
          ║       IP Addresses            ║
          ╠═══════════════════════════════╣
          ║        Hash Values            ║  ← Least painful to change
          ╚═══════════════════════════════╝

Level 1: Hash Values (Trivial to change)

# Hash-based detection
detection:
  selection:
    Hashes|contains: 'MD5=7353F60B1739074EB17C5F4DDDEFE239'

Evasion time: Minutes. Repack with UPX, change one byte, recompile.

Still useful for: Blocking known-bad tools quickly (EDR quarantine on first execution), retrospective hunting after an incident.

Not useful for: Preventing a motivated attacker — they recompile before the second attempt.

Level 2: IP Addresses (Trivial → Easy to change)

Alert: Outbound connection to 185.220.101.5 (known Tor exit node)

Evasion time: Minutes. New server, new IP. CDN fronting makes IPs meaningless against sophisticated actors.

Still useful for: High-volume commodity threats (ransomware C2, botnet callbacks), enrichment for triage.

Level 3: Domain Names (Easy to change)

Alert: DNS query to evil-c2-domain.com

Evasion time: Hours. Register new domain, update DNS records.

Still useful for: Detecting less sophisticated attackers who reuse infrastructure.

Level 4: Network/Host Artifacts (Annoying to change)

Patterns in network traffic or on the host that are characteristic of a tool or technique:

Evasion time: Days. The attacker must modify the tool’s configuration or source code.

Level 5: Tools (Hard to change)

Detecting that a specific tool was used — even if hashes or IPs change:

Evasion time: Weeks. Find or develop an alternative tool with the same capability.

Level 6: TTPs (Very hard to change)

Behavioral detections that match the technique, not the tool:

# Not: detect Mimikatz by hash
# Not: detect Mimikatz by command line
# But: detect any process accessing LSASS memory with PROCESS_VM_READ rights
detection:
  selection:
    EventID: 10
    TargetImage|endswith: '\lsass.exe'
    GrantedAccess|contains: '0x10'

This rule catches Mimikatz, ProcDump, and any future LSASS-dumping tool — even ones that don’t exist yet. The attacker must change the technique (use a different credential access method, or use kernel-mode access to bypass user-mode logging), which requires significant research and development.

Evasion time: Weeks to months. May require a fundamentally different attack approach.


Applying the Pyramid in Practice

When reviewing a new detection request:

  1. Identify what the rule actually matches on
  2. Map it to a Pyramid level
  3. Ask: “Is there a higher-level version of this detection that’s still practical?”

Example: Request: “Add a hash-based rule for a malicious DLL from last week’s incident.”

Ship all three. The hash block protects you today. The behavioral detection protects you against the next variation.

Pyramid of Pain (David Bianco)— Detect-Respond Blog