The Pyramid of Pain and IOC Decay
Block an attacker's IP address and they switch to another one before lunch. Block their file hash and they recompile. Detect the way they dump credentials or move between machines, and they have to change how they work, which takes weeks and costs money. David Bianco's pyramid of pain (2013) orders indicator types by how much pain denying them causes the adversary. This lesson walks the pyramid with detections for each level, then deals with the other side of cheap indicators: they decay, and an indicator kept past its useful life produces false positives against whoever uses that address next.
The pyramid
| Level | Example (synthetic) | Detect with | Adversary's cost to change |
|---|---|---|---|
| Hash values | SHA-256 of lib.dll |
EDR / file hash match, YARA for families | Recompile, repack: seconds |
| IP addresses | 203.0.113.66 |
Firewall, proxy, conn logs | New server or proxy: minutes |
| Domain names | upd.cdn-lab.example |
DNS logs, proxy | Register a domain: hours, a little money |
| Network / host artifacts | URI pattern /u?id=, an unusual User-Agent, a mutex name, a registry key |
IDS signatures, Zeek, EDR, Sysmon | Change code and redeploy: days |
| Tools | the specific loader or credential-dumping tool | EDR behaviour, YARA, specific telemetry | Find or build another tool: weeks |
| TTPs | "Office macro → PowerShell → rundll32 from a public folder"; "reads LSASS memory" | Behaviour rules on process trees, access to LSASS, sequence rules | Change how they operate: hardest |
The lessons of this course mostly sit high on the pyramid: Office spawning shells, LSASS access, beaconing regularity and rare parent-child pairs are TTP- and artifact-level detections. Indicators at the bottom are still worth using, because they are cheap and exact; they just need an expiry date. Malware Analysis, Digital Forensics & Incident Response covers how analysts extract indicators from samples.
Why indicators decay
- IP addresses are reassigned: cloud and hosting addresses move to new customers within days; residential addresses change with DHCP leases.
- Domains expire, get taken down or sinkholed (redirected by researchers), and some were compromised legitimate sites that have since been cleaned.
- Hashes don't become wrong, but stop being seen once the adversary rebuilds; they cost matching time and nothing else.
- TTPs remain valid for years.
So each indicator type needs a lifetime, and an indicator's score should fall with age unless new sightings refresh it.
A decay model
MISP's default decay model scores an indicator as base score × (1 − (t / τ)^(1/δ)), where t is the time since the last sighting or update, τ the lifetime for that type, and δ the decay speed (δ = 1 is a straight line; δ < 1 keeps the score high for most of the lifetime and drops it near the end; δ > 1 drops it early and then slowly). Below a threshold the indicator is considered expired. The program applies it to a few synthetic indicators.
LIFETIME = {"ip": 30, "domain": 90, "url": 60, "sha256": 365} # tau in days, per type (policy choices)
DELTA = {"ip": 1.0, "domain": 0.5, "url": 2.0, "sha256": 0.3}
THRESHOLD = 30
def score(base, kind, age_days):
tau, delta = LIFETIME[kind], DELTA[kind]
if age_days >= tau:
return 0.0
return base * (1 - (age_days / tau) ** (1 / delta))
iocs = [ # value, type, base score from source confidence, days since last sighting
("203.0.113.66", "ip", 80, 3),
("198.51.100.90", "ip", 80, 24),
("upd.cdn-lab.example", "domain", 85, 20),
("old-c2.example", "domain", 70, 75),
("http://203.0.113.66/a.hta", "url", 60, 50),
("9f86d081884c7d65...b0f00a08", "sha256", 90, 200),
]
print(f"{'indicator':28} {'type':6} {'age':>4} {'score':>6} action")
for value, kind, base, age in iocs:
s = score(base, kind, age)
action = "block + alert" if s >= 60 else "alert only" if s >= THRESHOLD else "expire (keep for search)"
print(f"{value:28} {kind:6} {age:4} {s:6.1f} {action}")
print("\nIP scored at 80 over its 30-day life:", [round(score(80, "ip", d)) for d in (0, 7, 15, 22, 29)])
print("domain (delta 0.5) at 80 over 90 days:", [round(score(80, "domain", d)) for d in (0, 22, 45, 67, 89)])indicator type age score action
203.0.113.66 ip 3 72.0 block + alert
198.51.100.90 ip 24 16.0 expire (keep for search)
upd.cdn-lab.example domain 20 80.8 block + alert
old-c2.example domain 75 21.4 expire (keep for search)
http://203.0.113.66/a.hta url 50 5.2 expire (keep for search)
9f86d081884c7d65...b0f00a08 sha256 200 77.9 block + alert
IP scored at 80 over its 30-day life: [80, 61, 40, 21, 3]
domain (delta 0.5) at 80 over 90 days: [80, 75, 60, 36, 2]
Six indicators, three outcomes. The fresh C2 address (3 days, score 72) and the C2 domain (20 days into a 90-day life, still 80.8 because δ = 0.5 keeps domains near full strength for most of their life) are blocked and alerted on. The hash, 200 days old, still scores 77.9: with δ = 0.3 a hash keeps its value almost to the end of its year, because a hash never matches anything innocent. The 24-day-old IP has decayed to 16, the URL to 5.2 and the old domain to 21.4: they leave live matching but stay searchable. The two last lines show the shapes: an IP loses value in a straight line, a domain holds on and then falls. The lifetimes and speeds are policy choices; set them per type and per source, and let sightings reset the clock.
How stale indicators are detected
- Hit review: every indicator hit is triaged; hits closed as false positive are fed back to the intel platform as negative sightings, and the indicator's source loses reputation.
- Age reports: count active indicators by age and type; anything past its lifetime still in a block-list is a finding.
- Shared-infrastructure checks before deployment: drop indicators that resolve to large CDNs or cloud front ends, your own ranges, and public resolvers (Threat Intelligence).
How the programme is fixed
- Expire by default. Every indicator gets a
valid_untilor a decay model; only sightings refresh it. - Match with history, block with current. Keep expired indicators searchable for investigations (was this IP seen last year?) but out of live blocking.
- Climb the pyramid. For every incident, ask what the adversary did that would be expensive to change, and write that detection too. Indicator hits are a reason to look, behaviour detections are what lasts.
Pitfalls
- One lifetime for everything. An IP address and a malware family hash age at completely different rates.
- Blocking on low-confidence indicators. A block on a reassigned address cuts off a legitimate service; use alerting for anything below high confidence.
- Counting the hash level as useless. Exact hashes are perfect for scoping (which hosts have this file?) during an incident, even if they are poor for prevention.
Practice
1. With τ = 30 days and δ = 1, at what age does an IP with base score 80 fall below the threshold of 30?
80 × (1 − t / 30) < 30 ⇔ t / 30 > 0.625 ⇔ t > 18.75 days. From day 19 the IP expires from live matching unless a new sighting refreshes it.
2. Place these on the pyramid: a mutex name, a C2 domain, "dumps credentials by reading LSASS memory", a packer.
Mutex name: host artifact. C2 domain: domain names. Reading LSASS memory: TTP. A packer (as a tool used by the adversary): tools.
3. Why keep expired indicators searchable rather than deleting them?
Investigations look back: if a host contacted an address while it was malicious, that is evidence, even if the address is clean today. Searching history with the indicator's validity period (first and last seen) answers "was this host talking to the C2 at the time?" without alerting on today's innocent owner.
Test yourself
Which level of the pyramid of pain is hardest for an adversary to change?
- Hash values
- IP addresses
- Domain names
- TTPs
Why does an IP indicator need a short lifetime?
- IPs are long
- Addresses are reassigned to other users, so an old indicator turns into false positives
- Firewalls forget them
- STIX requires it
In the program, what happens to old-c2.example?
- It is blocked
- Its decayed score falls below 30, so it expires from live matching
- Its score rises
- It is converted to an IP
What refreshes an indicator's score in a decay model?
- Nothing
- A new sighting or update of the indicator
- Deleting it
- Changing its type