SecurityPart 5: Detection and response
Chapter 20Threat hunting and intelligence
The May 2023 joint advisory on Volt Typhoon (CISA AA23-144A) was valuable less for its indicators than for its behaviors: built-in commands such as netsh interface portproxy add v4tov4, ntdsutil and wevtutil, used to live quietly inside critical infrastructure. This chapter teaches you to turn reports like that into hypothesis-driven hunts, durable detections and intelligence your organization can act on, without drowning in indicator feeds.
After this chapter you can
- Distinguish threat hunting from detection and explain what a hunt should produce
- Write testable hunt hypotheses and run them with stacking, grouping and time-window queries
- Explain the intelligence cycle and the strategic, operational and tactical levels of intel
- Compare indicators with TTPs, and read STIX objects and the role of TAXII, MISP and OpenCTI
- Analyze an intrusion with the Diamond Model and pivot between its vertices
- Turn a real advisory into ATT&CK-mapped hunts and a tested detection, using LLMs with verification
Hunting versus detection
Detection is automated: a rule watches every event and alerts when a known pattern appears. Threat hunting is human-led: an analyst assumes something got past the rules and goes looking for it. Hunting starts from the assumption of compromise, and its best outputs are often not incidents.
Detection
- Runs continuously, unattended
- Encodes what you already know
- Measured by precision, coverage and latency
Hunting
- Runs as a time-boxed investigation
- Explores what you do not know yet
- Measured by what it changes: new detections, closed gaps, found intrusions
A hunt that finds no attacker but documents what normal looks like, or proves you cannot see a technique, has still paid for itself.
Hypothesis-driven hunts
A good hypothesis is specific and testable: an actor, a behavior, where it would show up, and what data proves or disproves it. "Look for bad stuff" is not a hypothesis. "An actor using password spraying against our SSH bastions would produce failures for many usernames from one source followed by a success, visible in sshd logs" is.
Hypotheses come from threat intelligence, ATT&CK techniques relevant to you, your crown-jewel systems, recent incidents, and anomalies noticed during triage. The PEAK framework (Prepare, Execute, Act with Knowledge), published by Splunk's SURGe team in 2023, names three hunt types: hypothesis-driven, baseline (learning what normal looks like) and model-assisted.
Four techniques do most of the work:
| Technique | Idea | Example |
|---|---|---|
| Searching | Look for a specific pattern | Command lines containing portproxy add |
| Stacking (least frequency) | Count values and inspect the rare ones | Which processes opened LSASS, sorted by count ascending |
| Grouping | Find several things that co-occur | Five discovery tools launched by one parent in ten minutes |
| Time windowing | Look at what surrounds a pivot event | Everything on a host two minutes before and after a new service |
Teams also grade their own maturity. The Hunting Maturity Model, published by Sqrrl in 2015, is still the common yardstick.
| Level | Name | What it looks like |
|---|---|---|
| HMM0 | Initial | Relies on automated alerts only; little data collected |
| HMM1 | Minimal | Searches for indicators from threat feeds |
| HMM2 | Procedural | Follows hunt procedures written by others |
| HMM3 | Innovative | Creates its own hypotheses and data analysis procedures |
| HMM4 | Leading | Automates successful hunts into detections at scale |
The intelligence cycle and its levels
Threat intelligence is analyzed information about adversaries that helps someone make a decision. Without a decision attached it is just data. The intelligence cycle keeps it tied to needs.
Direction is the step most programs skip. Write down priority intelligence requirements (PIRs), such as "which groups target our sector, and through which initial access methods?", and judge every feed by whether it answers one.
| Level | Audience | Question it answers | Example |
|---|---|---|---|
| Strategic | Executives, board | Who might target us and why, and what is the risk trend? | State actors pre-positioning in utilities |
| Operational | Security leaders, IR leads | How do specific campaigns unfold? | A group's playbook from initial access to impact |
| Tactical | Detection engineers, hunters, SOC | What exactly should we look for? | Techniques, command lines, tools, indicators |
Indicators versus TTPs
An indicator of compromise (IOC) is an observable value tied to malicious activity: a hash, IP address, domain or file path. TTPs describe how the adversary operates. Indicators sit low on the Pyramid of Pain from the "Detection engineering" chapter, and they decay fast as infrastructure rotates.
Indicators (IOCs)
- Precise and easy to automate: block, alert, retro-search
- Expire in days to weeks
- Shared infrastructure causes false positives
TTPs
- Survive tool and infrastructure changes
- Need research and tuning to detect
- Map to ATT&CK, so coverage can be measured
Indicators still earn their keep in two places. Retro-hunting searches old logs for a newly published indicator to find past compromise. Short-lived blocking of active command and control buys time during an incident. Give every indicator a source, a first-seen date and an expiry, or your blocklists fill with stale entries that someone's cloud provider now reuses.
Sharing intel: STIX, TAXII, MISP and OpenCTI
STIX (Structured Threat Information Expression) 2.1 is the standard JSON format for threat intelligence. It defines objects such as indicator, malware, attack-pattern, threat-actor and report, plus relationship objects that link them. TAXII 2.1 is the HTTPS API for exchanging STIX: servers expose collections that clients poll or push to.
{
"type": "indicator",
"spec_version": "2.1",
"id": "indicator--8e2e2d2b-17d4-4cbf-938f-98ee46b3cd3f",
"created": "2026-12-01T10:00:00.000Z",
"modified": "2026-12-01T10:00:00.000Z",
"name": "Port forwarding via netsh portproxy",
"indicator_types": ["malicious-activity"],
"pattern": "[process:command_line MATCHES '.*portproxy add v4tov4.*']",
"pattern_type": "stix",
"valid_from": "2026-12-01T10:00:00Z"
}Two open-source platforms dominate for storing and sharing intel:
| MISP | OpenCTI | |
|---|---|---|
| Model | Events containing attributes and objects, tagged with taxonomies and galaxies | A STIX 2.1 knowledge graph of entities and relationships |
| Strength | Peer sharing between organizations, warning lists for known-benign values | Analysis and pivoting, many connectors (ATT&CK, MISP, CISA KEV and more) |
| Typical user | ISACs, CERTs, SOCs sharing indicators | CTI teams building an adversary knowledge base |
Shared intel carries handling rules. The Traffic Light Protocol (TLP 2.0) labels say who may receive it: TLP:RED, TLP:AMBER+STRICT, TLP:AMBER, TLP:GREEN and TLP:CLEAR.
The Diamond Model
The Diamond Model of Intrusion Analysis (Caltagirone, Pendergast and Betz, 2013) describes every intrusion event with four connected features. Its power is pivoting: from one known vertex, you discover the others.
Suppose a hunt finds a portproxy rule forwarding to an external IP (capability on a victim). Pivot to infrastructure: what else talked to that IP, and what does passive DNS say it hosted? Pivot from infrastructure to other victims in your estate, and from the combination to a likely adversary named in public reporting. Each event also carries meta-features: timestamp, phase, result, direction, methodology and resources.
From threat report to hunts, detections and metrics
Turning a report into action is a repeatable process.
Extract behaviors
Read the report and pull out every concrete action, quoting the sentence it came from. Commands, tools, targeted services and sequences matter more than the indicator appendix.
Map to ATT&CK and check the IDs
Assign a technique to each behavior and verify every ID against ATT&CK itself. Reports age: in 2026 ATT&CK split Defense Evasion into Stealth and Defense Impairment, so a 2023 report's T1070.001 is now revoked in favor of T1685.005.
Check visibility
For each technique, name the data source that would show it and whether you collect it. Techniques you cannot see become telemetry tickets, not hunts.
Hunt
Write a query per hypothesis, run it over a meaningful time range, and triage the results.
Convert and report
Turn reliable patterns into tested detections, file the gaps, and write a short hunt report.
Measuring hunt value
Counting "hunts completed" rewards busywork, and counting "incidents found" punishes you for having a clean network. Measure what hunts change.
| Metric | What it shows |
|---|---|
| Detections created or improved from hunts | Hunting feeding the automated layer |
| Telemetry gaps found and closed | Visibility actually getting better |
| Techniques moved up a coverage level | Measurable reduction in blind spots |
| Incidents found, and their dwell time | Real compromise caught that rules missed |
| Time from new intel to first hunt | How quickly you act on reporting |
Key terms
- Threat hunting
- A human-led, hypothesis-driven search for threats that evaded automated detection.
- Hypothesis
- A specific, testable statement of what an adversary behavior would look like in your data.
- Stacking
- Counting the values of a field and investigating the rarest ones.
- Priority intelligence requirement
- A written question that intelligence work must answer for a decision-maker.
- IOC
- An indicator of compromise: an observable value such as a hash, IP or domain tied to malicious activity.
- STIX and TAXII
- The standard JSON format for threat intelligence and the HTTPS API for exchanging it.
- MISP and OpenCTI
- Open-source platforms for storing, sharing and analyzing threat intelligence.
- Diamond Model
- An intrusion analysis model linking adversary, capability, infrastructure and victim, used for pivoting.
- TLP
- The Traffic Light Protocol, labels that set how widely shared intelligence may be redistributed.
Turn a CISA advisory into hunts and a detection
Goal: extract TTPs from CISA advisory AA23-144A, verify and map them to ATT&CK, run two hunts on the stack from the "Logging and telemetry" lab, convert one behavior into a tested Sigma rule, and write a hunt report.
You need: the running ~/seclab stack with both Windows datasets loaded, the ~/detections repo from the "Detection engineering" lab, Python 3, jq, and optionally an LLM you are allowed to use. All activity targets your own lab container and recorded datasets.
- Read the advisory and build a TTP table. Open AA23-144A and fill one row per behavior, quoting the source sentence. Start from these rows and add at least six more.
| Behavior (quoted) | ATT&CK ID | Data source | Visible in my lab? |
| --- | --- | --- | --- |
| "netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 ..." | T1090 | Process creation (Sysmon 1, 4688) | Rule only, no live data |
| "several failed logon (Event ID 4625) events for several different user accounts, followed by one or more successful logons" | T1110.003 | Authentication logs | Yes: linux-sshd |
| "net localgroup administrators", "whoami", "systeminfo", "ipconfig /all" | T1069.001, T1033, T1082, T1016 | Process creation | Yes: winlogs-lab (net only) |If you use an LLM to draft the table, give it the advisory text and require a verbatim quote for every row; delete any row whose quote you cannot find with your browser's search.
- Verify every technique ID against MITRE's official STIX data.
cd ~/seclab
curl -sSLo data/enterprise-attack.json https://raw.githubusercontent.com/mitre-attack/attack-stix-data/master/enterprise-attack/enterprise-attack.json#!/usr/bin/env python3
"""Check ATT&CK technique IDs against MITRE's official STIX bundle.
usage: python3 check_ttps.py data/enterprise-attack.json T1090 T1003.003 ...
"""
import json
import sys
with open(sys.argv[1], encoding="utf-8") as f:
bundle = json.load(f)
known = {}
for obj in bundle["objects"]:
if obj.get("type") != "attack-pattern":
continue
for ref in obj.get("external_references", []):
if ref.get("source_name") == "mitre-attack":
if obj.get("revoked"):
status = "REVOKED"
elif obj.get("x_mitre_deprecated"):
status = "deprecated"
else:
status = "ok"
known[ref["external_id"]] = (obj["name"], status)
for tid in sys.argv[2:]:
name, status = known.get(tid.upper(), ("not found in ATT&CK", "INVALID"))
print(f"{tid:<11} {status:<10} {name}")python3 check_ttps.py data/enterprise-attack.json T1090 T1110.003 T1069.001 T1033 T1082 T1016 T1003.003 T1070.001Expect ok for most IDs and REVOKED for T1070.001, the ID the advisory uses for clearing event logs. Look up its replacement on attack.mitre.org and fix your table.
- Generate fresh spray activity against your lab container: many usernames, then one real login.
for u in alice bob carol dave erin frank grace heidi; do
ssh -p 2222 -o BatchMode=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null "$u@127.0.0.1" true 2>/dev/null
done
ssh -p 2222 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null analyst@127.0.0.1 'id'Type lab-only-password when prompted.
- Hunt 1, password spraying (T1110.003). The hypothesis comes straight from the advisory: failures for several accounts, followed by a success, from one source.
FROM linux-sshd
| WHERE event.outcome IS NOT NULL
| EVAL failed_user = CASE(event.outcome == "failure", user.name),
success = CASE(event.outcome == "success", 1, 0)
| STATS users_tried = COUNT_DISTINCT(failed_user),
successes = SUM(success),
first_seen = MIN(@timestamp),
last_seen = MAX(@timestamp)
BY source.ip
| WHERE users_tried >= 3 AND successes >= 1
| SORT users_tried DESC./esql.sh hunts/h1-spray.esqlExpect one row: your Docker gateway IP, with users_tried of 8 or more and at least one success. In a real network, the next step is to ask what the successful account did after logging in.
- Hunt 2, discovery burst (T1087, T1069, T1033, T1082, T1016). Volt Typhoon ran many built-in discovery tools in quick succession. Group process launches by host, parent and ten-minute window, and look for parents that ran several distinct tools.
FROM winlogs-lab
| WHERE EventID == 1
| EVAL proc = MV_LAST(SPLIT(Image, "\\"))
| WHERE proc IN ("net.exe", "net1.exe", "whoami.exe", "systeminfo.exe", "ipconfig.exe",
"tasklist.exe", "nltest.exe", "netsh.exe", "wmic.exe", "arp.exe", "netstat.exe")
| EVAL window = DATE_TRUNC(10 minutes, @timestamp)
| STATS distinct_tools = COUNT_DISTINCT(proc), tools = VALUES(proc), launches = COUNT(*)
BY Hostname, ParentImage, window
| SORT distinct_tools DESC./esql.sh hunts/h2-discovery-burst.esqlThe recorded dataset only contains net.exe launched by PowerShell and net1.exe launched by net.exe, so expect small counts. Record that honestly: the query works, and the threshold you would alert on (for example three or more distinct tools) comes from running it over weeks of your own baseline.
- Stack a third data source for practice: which processes opened LSASS, and with what access rights?
FROM winlogs-lab
| WHERE EventID == 10 AND ends_with(TargetImage, "\\lsass.exe")
| STATS hits = COUNT(*) BY SourceImage, GrantedAccess
| SORT hits ASCExpect two rare rundll32.exe rows at the top, one with 0x1fffff (full access), and svchost.exe with low-privilege masks such as 0x1000 at the bottom with the most hits. Rare plus powerful is what stacking is for.
- Convert the portproxy behavior into a tested detection in your detections repo.
cd ~/detections && . .venv/bin/activate
mkdir -p tests/proc_creation_win_netsh_portproxy_addtitle: Port Forwarding Added via Netsh PortProxy
id: 5e3c9a7b-2f41-4d8e-b0c6-91a4e7d2f358
status: experimental
description: Detects netsh adding a portproxy rule, which Volt Typhoon used to relay traffic through compromised hosts (CISA AA23-144A).
references:
- https://www.cisa.gov/news-events/cybersecurity-advisories/aa23-144a
author: You
date: 2026-12-01
tags:
- attack.command-and-control
- attack.t1090
logsource:
category: process_creation
product: windows
detection:
selection_img:
- Image|endswith: '\netsh.exe'
- OriginalFileName: 'netsh.exe'
selection_cli:
CommandLine|contains|all:
- 'portproxy'
- 'add'
condition: all of selection_*
falsepositives:
- Administrators who use portproxy on purpose; allowlist them by host and owner
level: mediumT=tests/proc_creation_win_netsh_portproxy_add
printf '%s\n' '{"EventID":1,"Image":"C:\\Windows\\System32\\netsh.exe","OriginalFileName":"netsh.exe","CommandLine":"netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=9999 connectaddress=10.0.0.5 connectport=8443 protocol=tcp","ParentImage":"C:\\Windows\\System32\\cmd.exe"}' > $T/positive.jsonl
printf '%s\n' '{"EventID":1,"Image":"C:\\Windows\\System32\\netsh.exe","OriginalFileName":"netsh.exe","CommandLine":"netsh interface portproxy show all","ParentImage":"C:\\Windows\\System32\\cmd.exe"}' > $T/negative.jsonl
echo "--product windows --category process_creation" > $T/logsource
sigma check rules/ && ./scripts/test_rules.sh 2>/dev/nullExpect four ok lines. The positive is built from the advisory's own command; the negative is the read-only show variant the same actor also ran, which you might hunt but would not page on.
- Write the hunt report and commit everything.
# Hunt report: Volt Typhoon behaviors (CISA AA23-144A)
## Hypotheses
H1 password spraying, H2 discovery burst, H3 unusual LSASS access
## Data and time range
Indices, date range, known gaps (no live Windows endpoints, no netsh telemetry)
## Results
| Hypothesis | Query file | Result | Verdict |
| --- | --- | --- | --- |
## Outputs
- Detections: proc_creation_win_netsh_portproxy_add (tested)
- Gaps: list the advisory techniques you cannot see, and the source that would show them
- Baseline notes: what normal looked like
## Next hunt
One follow-up hypothesisCheck your work: check_ttps.py flags at least one revoked ID from the advisory, hunt 1 returns your gateway IP with eight or more usernames and a success, hunt 3 shows rundll32.exe with 0x1fffff, and the detection tests print four ok lines.
Stretch: build an ATT&CK Navigator layer for the advisory where each technique's score is your visibility level (0 no data, 1 data only, 2 tested detection), using the coverage script from the detection lab as a starting point, and compare it with your detection coverage layer.
Check yourself
A hunt for password spraying across six months of sshd logs finds no malicious activity, but shows that two bastion hosts were never sending logs. How should you judge this hunt?
Which statement is the best hunt hypothesis?
An LLM extracts 25 ATT&CK techniques from a 2023 advisory. Three of its IDs are revoked in current ATT&CK, and one row has no matching sentence in the report. What should you do?
Your intel feed delivers 50,000 new IP indicators a week, and your blocklist now causes outages for a cloud service your company uses. What is the root-cause fix?
Recap
- Hunting assumes compromise and is judged by what it changes: incidents, detections, closed gaps and baselines.
- Good hypotheses name a behavior, where it appears and what data confirms it; stacking, grouping and time windows do most of the work.
- Intelligence exists to serve decisions; write requirements first, then pick strategic, operational or tactical products for each audience.
- Indicators are precise but short-lived; TTPs are durable and map to ATT&CK.
- STIX and TAXII carry intel between tools such as MISP and OpenCTI, and the Diamond Model structures pivoting.
- LLMs speed up turning reports into hunts, but every quote, technique ID and query must be verified.
Go deeper
- CISA advisory AA23-144A: the Volt Typhoon living-off-the-land advisory used in the lab.
- The PEAK threat hunting framework (Splunk SURGe): hypothesis-driven, baseline and model-assisted hunts explained.
- The Diamond Model of Intrusion Analysis: the original paper by Caltagirone, Pendergast and Betz.
- STIX and TAXII introduction (OASIS): object types, relationships and how TAXII exchanges them.
- MISP project: the open-source sharing platform used by many CERTs and ISACs.
- MITRE ATT&CK STIX data: the machine-readable source for verifying technique IDs.