Hypothesis-Driven Hunting and the Hunting Loop
Detection rules find what someone thought of in advance. Threat hunting is the proactive search for what the rules missed: an analyst forms a hypothesis about how an adversary could be operating in the environment right now, looks for evidence in the data, and either finds an intrusion or learns something that improves the rules. A hunt that finds nothing is not wasted if it leaves behind a new detection, a fixed data gap or a documented baseline. This lesson describes the hunting loop, where hypotheses come from, how to choose between them, and what a hunt must produce.
The loop
- Hypothesis: a specific, testable statement: "An adversary with a foothold on a workstation is using scheduled tasks created from the command line to keep access" is testable; "there may be malware" is not.
- Investigate with the data: queries, stacking, statistics, visualisation, pivoting from one finding to related entities.
- Uncover patterns and TTPs: what is normal, what is not, and what an adversary's version would look like here.
- Inform and enrich: turn what you learned into detections, baselines, data-source fixes and documentation. Then pick the next hypothesis.
If the hunt finds an active intrusion, it leaves the loop and becomes an incident (Triage, Escalation and Case Management).
The four steps follow the hunting loop that Sqrrl published around 2015. Later frameworks formalise the same loop. Splunk's PEAK framework (Prepare, Execute, Act with Knowledge) distinguishes three kinds of hunt: hypothesis-driven, baseline (exploratory: learn what normal looks like and find deviations) and model-assisted (using machine learning or statistics as the starting point). The older Hunting Maturity Model (HMM0 to HMM4, by David Bianco, published by Sqrrl) describes an organisation's progress from relying only on automated alerts to automating the outputs of its hunts.
Where hypotheses come from
| Source | Example hypothesis |
|---|---|
| Threat intelligence | "The group in last week's sector advisory uses rundll32.exe to load DLLs from C:\Users\Public; it may be here" |
| ATT&CK coverage gaps | "We have no rule for T1021.002 (SMB admin shares); lateral movement over admin shares may be happening unseen" (Coverage Mapping) |
| Situational awareness | "The VPN appliance had a critical vulnerability for two weeks before patching; it may have been used to get in" |
| Previous incidents | "The phishing campaign in March reached 40 mailboxes; only 3 were investigated" |
| Crown jewels | "Someone may be staging data from the finance share for exfiltration" |
| Baselines and anomalies | "Some workstations make DNS lookups at night with machine-like regularity" (DNS Beaconing) |
Choosing what to hunt
Time is the scarce resource, so hypotheses are prioritised. A simple score combines relevance (how likely given intel), impact (what is at stake if true), data readiness (can we test it with what we collect?) and effort.
import pandas as pd
hyp = pd.DataFrame([
# hypothesis, relevance 1-5, impact 1-5, effort (days), data needed
("H1 rundll32 loading DLLs from user-writable paths", 5, 4, 1, {"process_creation"}),
("H2 lateral movement over SMB admin shares", 4, 5, 3, {"windows_security_4624", "network_conn"}),
("H3 VPN appliance exploited before patching", 4, 5, 4, {"vpn_logs_90d", "appliance_disk"}),
("H4 staging of finance data before exfiltration", 3, 5, 3, {"file_access_finance", "proxy"}),
("H5 DNS beaconing at night from workstations", 3, 3, 1, {"dns"}),
], columns=["hypothesis", "relevance", "impact", "effort", "needs"])
AVAILABLE = {"process_creation", "windows_security_4624", "network_conn", "dns", "proxy", "vpn_logs_30d"}
hyp["missing"] = hyp.needs.apply(lambda n: sorted(n - AVAILABLE))
hyp["ready"] = hyp.missing.apply(lambda m: not m)
hyp["score"] = (hyp.relevance * hyp.impact / hyp.effort).round(1)
hyp = hyp.sort_values(["ready", "score"], ascending=[False, False])
for r in hyp.itertuples():
status = "ready" if r.ready else f"blocked: needs {', '.join(r.missing)}"
print(f"{r.score:5} {r.hypothesis:52} {status}") 20.0 H1 rundll32 loading DLLs from user-writable paths ready
9.0 H5 DNS beaconing at night from workstations ready
6.7 H2 lateral movement over SMB admin shares ready
5.0 H3 VPN appliance exploited before patching blocked: needs appliance_disk, vpn_logs_90d
5.0 H4 staging of finance data before exfiltration blocked: needs file_access_finance
H1 comes first by a wide margin (relevance 5 × impact 4 / 1 day = 20): it is fed by current intelligence, cheap, and the process-creation data is there. H5 is cheap too. H2 is valuable but takes three days. H3 and H4 have the highest impact but are blocked: the VPN logs are kept for 30 days, not the 90 the hypothesis needs, and nobody collects file access on the finance share. A blocked hypothesis is a finding in itself: it goes to the platform team as a data-source request with the hunt that needs it as the justification. The weights here are deliberately simple; what matters is that the choice is written down and revisited.
What every hunt must leave behind
A hunt report, short and in a fixed form, so hunts can be repeated and audited:
HUNT H1 rundll32 loading DLLs from user-writable paths 2026-01-16, analyst: hunter on duty
Hypothesis : an adversary loads payload DLLs with rundll32 from C:\Users\Public or %TEMP% (T1218.011)
Data : process creation (Sysmon 1 / EDR), 30 days, all workstations; gaps: 12 kiosks without EDR
Method : filter rundll32 with a DLL path under \Users\ or \Temp\; stack by DLL path and parent; review the tail
Findings : 2 hosts: ws15 (lib.dll from Office chain -> incident C-2301), ws33 (printer driver installer, benign)
Outputs : detection d-031 (Sigma, tested), allow-list entry for the driver installer (owner: desktop team),
data gap ticket: EDR on kiosks
Repeat : convert to scheduled detection; re-hunt variant with regsvr32 next quarterThe outputs line is the reason hunting exists: each hunt should make the automated layer better (Detection as Code), so that the next hunt can look for something new.
How hunting goes wrong, and the fix
- Hunting without a hypothesis: browsing dashboards until something looks odd finds odd things, rarely intrusions. Write the hypothesis down first, including what evidence would confirm or refute it.
- Hunting without data: two of the five hypotheses in the example are blocked; record the gaps and get them fixed, rather than hunting in what happens to be collected.
- Hunting without outputs: findings that stay in an analyst's notebook are lost. Use the report form, and convert repeatable hunts into detections.
- Confirmation bias: having decided that something is malicious, an analyst reads every ambiguous event as proof. Have a second person review findings before escalation.
Pitfalls
- Treating hunting as a separate team's hobby. Hunts work best with detection engineers and intel analysts in the loop.
- Only hunting the newest advisory. Older, well-known techniques are the most commonly used; coverage gaps there matter more.
- Too broad a scope. "All hosts, all time" makes queries slow and results unreadable; scope by asset group and time, then widen.
Practice
1. Rewrite "there may be insider data theft" as a testable hypothesis.
"A user with access to the finance share is copying an unusually large number of files from it to removable media or to a personal cloud-storage site in the weeks before leaving the company." It names the data (file-access logs, USB events, proxy), the population (finance share users, leavers from HR) and what evidence looks like (volume against the user's baseline).
2. H3 is blocked because only 30 days of VPN logs exist. What do you do?
Record the gap (90 days needed), file a retention change (Collecting, Shipping and Retaining Logs), and hunt what is possible now: the 30 days you have, plus the appliance's own logs and integrity check if the vendor provides one, and network logs for unusual connections from the appliance. Note in the report that the window before day −30 could not be examined.
3. Which output would you expect from H5 if it finds nothing malicious?
A baseline of periodic DNS clients (update agents, telemetry, monitoring) as an allow-list with owners, the tuned thresholds for regularity, and a scheduled report or detection based on them; possibly data-gap tickets (hosts using outside resolvers).
Test yourself
What makes a hunting hypothesis useful?
- It is vague enough to cover everything
- It is specific and testable: it names the behaviour, the data and what evidence would look like
- It comes from a vendor
- It is always about malware
Which step of the loop turns findings into lasting value?
- Hypothesis
- Investigate
- Inform and enrich: new detections, baselines, data-source fixes
- Deleting the notebook
In the prioritisation, why was H3 not first despite high relevance and impact?
- Its score was low
- The data it needs (90 days of VPN logs, appliance disk) is not available
- It was a duplicate
- It was too easy
What should happen when a hunt finds an active intrusion?
- Keep hunting quietly
- Leave the loop and open an incident with the normal escalation process
- Publish it on social media
- Delete the evidence