Threat Hunting — Proactive Adversary Detection
Hunt for adversaries who are already inside but haven't tripped an alert. Distinct from incident-triage (reactive, alert is firing) and from siem-detection (engineer rules so future alerts fire). This skill is the proactive layer — assume something has slipped through, look for it.
Hunting is hypothesis-driven, not browse-driven. "Let's look around the SIEM" is not hunting; "let's check for the specific pattern of T1059.001 (PowerShell) being launched by Office processes" is.
Cross-references: siem-detection (queries you write here often graduate to detection rules), incident-triage (what to do if a hunt confirms a finding), breach-patterns (a rich source of hunt hypotheses), disk-forensics (deeper analysis on confirmed hits).
Methodology — PEAK framework
The PEAK (Prepare, Execute, Act, Knowledge) framework from Splunk SURGe — the most actionable hunting methodology I've seen.
Step 1: Prepare
Form the hypothesis. Strong hypotheses share three properties:
- Specific — names a technique, log source, and expected artifact
- Testable — describes what evidence would confirm or deny
- Bounded — has a defined time window and scope
Bad hypothesis: "Look for anomalies in the SIEM"
Good hypothesis: "Within the last 30 days, no service account should have run interactive PowerShell with -encodedCommand flag (T1059.001 + T1027). Search Sysmon event 1 for parent process = service-account-launched scheduled task, child = powershell.exe, command line contains -enc or -encodedcommand."
Hunt hypothesis sources, ranked by yield:
| Source |
Yield |
Effort |
| Recent incident (yours or peer's) |
High |
Low — pattern is concrete |
breach-patterns skill catalog |
High |
Low — generalizes from public breaches |
| MITRE ATT&CK technique you don't have a detection for |
Medium |
Medium — read the technique, design the hunt |
| Threat intel report (CrowdStrike, Mandiant, vendor reports) |
Medium |
Medium — current patterns |
| Anomaly: "this number went up — why" |
Low |
Low — often FP, occasionally gold |
Step 2: Execute
Run the hunt. Three execution patterns:
Pattern A — Pivot from indicator. Start with a specific IOC (IP, hash, domain) and look for any host or user that touched it.
// Sentinel — pivot from a suspicious IP across all log sources
union *
| where TimeGenerated > ago(90d)
| where contains("198.51.100.42")
| project TimeGenerated, Type, Computer, _ResourceId
Pattern B — Pivot from technique. Start with an ATT&CK technique and look for any host doing that.
// Splunk — T1547.001 Registry Run Keys persistence
index=sysmon EventCode=13
TargetObject="*\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\*"
| stats values(Details) by Computer, User
| where len(values(Details)) > 1
Pattern C — Anomaly hunt. Establish a baseline; look for outliers.
// Sentinel — service accounts authenticating from new geographies
SigninLogs
| where TimeGenerated > ago(30d)
| where UserType == "Service"
| summarize Countries = make_set(Location) by UserPrincipalName
| where array_length(Countries) > 1
Step 3: Act
For every hit, three possible outcomes:
| Outcome |
Action |
| Confirmed malicious |
Escalate to incident-triage immediately |
| Confirmed benign |
Document and move on |
| Unknown / unable to confirm |
Deepen investigation (host artifacts, network traffic, user interview) |
Don't leave hits in the "unknown" state. Either resolve, or hand off with a documented next-step.
Step 4: Knowledge
The hunt's value isn't the one hit — it's the artifacts.
For each hunt:
- If you found something, write a detection rule so future occurrences fire automatically (see
siem-detection)
- If you didn't find anything, document the hunt — query, scope, time window, conclusion. Future hunters won't re-do it
- If the hunt was hard because of missing log coverage, document the gap and create a backlog item to fix log ingestion
Hunts that don't produce artifacts are work without compounding return. The whole point of the methodology is to turn every hunt into either a rule, a documented dead-end, or a coverage improvement.
High-yield hunt catalog
Persistence
- Scheduled tasks created outside business hours —
schtasks.exe /create from Sysmon event 1 + EventCode 4698 from Windows Security
- Run-key persistence — registry writes to
HKCU\...\Run, HKLM\...\Run, HKCU\...\RunOnce
- Service installation outside known software-install windows — EventCode 7045
- WMI persistence —
__EventFilter and CommandLineEventConsumer subscriptions
- Login items / launch daemons (macOS) —
/Library/LaunchDaemons/*.plist, ~/Library/LaunchAgents/*.plist
- Cron / systemd timers (Linux) —
/etc/cron.*, /etc/systemd/system/*.timer, user crontabs
Defense evasion
- PowerShell with
-EncodedCommand — base64-encoded scripts are evasion 80% of the time
certutil.exe -decode — LOLBin used to decode dropper payloads
- Sysmon EventCode 7 (Image loaded) for known-bad DLLs from non-standard paths
- Process executing from
%TEMP%, %APPDATA%, \Users\Public — non-standard exec paths
- Command-line obfuscation patterns — large amounts of
^, backticks, cmd /c echo y | ...
Credential access
- LSASS access from unexpected processes — Sysmon EventCode 10 with TargetImage =
lsass.exe and SourceImage not in [mssense.exe, NisSrv.exe, ...]
procdump.exe or comsvcs.dll use — process-dumping LOLBins
- NTDS.dit access outside backup windows — domain controller DB
- AWS
GetSessionToken or AssumeRole from new IPs — credential capture pivot
- OAuth consent grants for high-scope applications — see
iam-audit
Discovery
net group "Domain Admins" or equivalent enumeration commands
- AD service ticket requests for high-value SPNs (Kerberoasting prep) — EventCode 4769 with RC4 encryption
whoami /all, quser, nltest /domain_trusts — situational awareness commands run by service accounts (humans rarely run these)
- Cloud API listing —
ListBuckets, ListUsers, DescribeInstances from unusual principals
Lateral movement
- WMI execution to remote hosts — Sysmon EventCode 1 with
wmic.exe or Invoke-WmiMethod
- PsExec / remote service creation patterns — EventCode 7045 with random service name
- Remote registry connections to unusual hosts
- SSH key reuse — one private key authenticating to many hosts in a short window
- AWS / GCP
AssumeRole chains across accounts — pivot detection
Collection / staging / exfil
- Large-volume reads from cloud storage by single principal — unusual S3 / GCS access patterns
- Archive creation patterns —
Compress-Archive, 7z.exe, tar, zip operating on directories outside user home
- DNS queries to recently-registered domains — exfil over DNS or C2 beacon resolution
- Outbound TLS to high-risk geographies — depends on your organization's normal pattern
- Beaconing patterns — regular-interval connections (every N seconds ± jitter) to the same destination over hours
Cloud-specific
- IAM credential exfiltration patterns —
GetCredentialReport, GenerateCredentialReport from unusual principals
- IMDS access from unusual processes / containers — anything reaching
169.254.169.254 that isn't the cloud SDK
- CloudTrail / Audit Log tampering attempts —
StopLogging, DeleteTrail, log-bucket access from non-logging principals
- Cross-region resource creation by single principal in short window — pivot or coin-mining setup
Identity-provider-specific
- OAuth app grants of high-scope permissions (Google Workspace, M365) — adversary technique for persistence outside the user's password
- MFA method enrollment from new device — attacker registering their own MFA after stealing a session
- Sign-ins from impossible geographies — geolocation jumps that exceed travel time
- Service-account authentication from new client / new IP — service accounts should be predictable
Tools
- SIEM — Splunk, Sentinel, Elastic, Chronicle, Sumo, Wazuh
- EDR — CrowdStrike (RTR), SentinelOne (deep visibility), Microsoft Defender (advanced hunting), Carbon Black
- Sysmon — open-source endpoint logging on Windows, output to SIEM
- osquery — SQL queries over endpoint state (cross-platform)
- Velociraptor — open-source live response and hunting framework (much more capable than free EDR)
- Zeek — network metadata for traffic analysis
- MITRE ATT&CK Navigator — coverage visualization
- Hunt-Evil — hunting playbook content (open-source)
- MaxMind GeoIP — geolocation lookup for IP-based hunts
Output Format
# Threat Hunt Report
## Hunt name: [descriptive — e.g., "Office process → encoded PowerShell"]
## Hypothesis: [specific, testable, bounded]
## Date range: [from - to]
## Hunter: [name]
### Methodology
- ATT&CK technique(s): [TXXXX.NNN]
- Data sources queried: [list]
- Query / queries:
[the actual SIEM query]
### Findings
| Hit ID | Host / User / Resource | Outcome | Notes |
|--------|------------------------|---------|-------|
### Conclusion
- [Confirmed malicious / All benign / Inconclusive]
- [Confidence level — Low / Medium / High]
### Artifacts produced
- [ ] Detection rule added (link)
- [ ] Coverage gap documented (link)
- [ ] Negative-result documentation filed (link)
### Recommended follow-up
[Anything that needs deeper investigation, escalation, or future hunts]
Boundaries
- Hunt only environments the user has authorization for
- Never query SIEM / EDR data outside the user's authority — even if the dataset is available, scope matters
- For confirmed-malicious findings, escalate to
incident-triage immediately — do not continue hunting and risk tipping the adversary
- Live response actions (host isolation, account disablement) are incident response, not hunting — escalate
- Refuse to use threat-hunting techniques to surveil employees beyond what HR / legal has authorized
- Negative hunt results are valuable evidence, not failure — document and credit accordingly
References
- PEAK Threat Hunting Framework (Splunk SURGe)
- TaHiTI (Targeted Hunting integrating Threat Intelligence) — Dutch model
- MITRE ATT&CK
- "The ThreatHunter Playbook" (Cyb3rWard0g) — open-source content
- Sigma rules repo — many rules can become hunt queries
- "Practical Threat Intelligence and Data-Driven Threat Hunting" — Valentina Costa-Gazcón
- David Bianco's "Pyramid of Pain" — IOC value hierarchy
- SANS FOR508 / FOR578 course materials
- Velociraptor community hunt content
1---2name: threat-hunting3description: Conduct proactive, hypothesis-driven threat hunts — search SIEM / EDR / logs for adversaries who haven't tripped an alert yet. ATT&CK-driven, hypothesis-based methodology. Use when the user mentions 'threat hunting,' 'proactive hunt,' 'TaHiTI,' 'PEAK framework,' 'MITRE ATT&CK hunt,' 'hypothesis-driven hunt,' 'hunt hypothesis,' 'living off the land,' 'LOLBins,' 'beaconing,' 'lateral movement detection,' 'data staging,' 'persistence hunting,' or wants to find threats that have evaded existing detections.4---5
6# Threat Hunting — Proactive Adversary Detection
7
8Hunt for adversaries who are already inside but haven't tripped an alert. Distinct from `incident-triage` (reactive, alert is firing) and from `siem-detection` (engineer rules so future alerts fire). This skill is the *proactive* layer — assume something has slipped through, look for it.
9
10Hunting is hypothesis-driven, not browse-driven. "Let's look around the SIEM" is not hunting; "let's check for the specific pattern of T1059.001 (PowerShell) being launched by Office processes" is.
11
12Cross-references: `siem-detection` (queries you write here often graduate to detection rules), `incident-triage` (what to do if a hunt confirms a finding), `breach-patterns` (a rich source of hunt hypotheses), `disk-forensics` (deeper analysis on confirmed hits).
13
14## Methodology — PEAK framework
15
16The PEAK (Prepare, Execute, Act, Knowledge) framework from Splunk SURGe — the most actionable hunting methodology I've seen.
17
18### Step 1: Prepare
19
20Form the hypothesis. Strong hypotheses share three properties:
21
221. **Specific** — names a technique, log source, and expected artifact
232. **Testable** — describes what evidence would confirm or deny
243. **Bounded** — has a defined time window and scope
25
26**Bad hypothesis:** "Look for anomalies in the SIEM"
27**Good hypothesis:** "Within the last 30 days, no service account should have run interactive PowerShell with `-encodedCommand` flag (T1059.001 + T1027). Search Sysmon event 1 for parent process = service-account-launched scheduled task, child = `powershell.exe`, command line contains `-enc` or `-encodedcommand`."
28
29Hunt hypothesis sources, ranked by yield:
30
31| Source | Yield | Effort |
32|---|---|---|
33| Recent incident (yours or peer's) | High | Low — pattern is concrete |
34| `breach-patterns` skill catalog | High | Low — generalizes from public breaches |
35| MITRE ATT&CK technique you don't have a detection for | Medium | Medium — read the technique, design the hunt |
36| Threat intel report (CrowdStrike, Mandiant, vendor reports) | Medium | Medium — current patterns |
37| Anomaly: "this number went up — why" | Low | Low — often FP, occasionally gold |
38
39### Step 2: Execute
40
41Run the hunt. Three execution patterns:
42
43**Pattern A — Pivot from indicator.** Start with a specific IOC (IP, hash, domain) and look for any host or user that touched it.
44
45```kql
46// Sentinel — pivot from a suspicious IP across all log sources
47union *
48| where TimeGenerated > ago(90d)
49| where contains("198.51.100.42")
50| project TimeGenerated, Type, Computer, _ResourceId
51```
52
53**Pattern B — Pivot from technique.** Start with an ATT&CK technique and look for any host doing that.
54
55```spl
56// Splunk — T1547.001 Registry Run Keys persistence
57index=sysmon EventCode=13
58 TargetObject="*\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\*"
59| stats values(Details) by Computer, User
60| where len(values(Details)) > 1
61```
62
63**Pattern C — Anomaly hunt.** Establish a baseline; look for outliers.
64
65```kql
66// Sentinel — service accounts authenticating from new geographies
67SigninLogs
68| where TimeGenerated > ago(30d)
69| where UserType == "Service"
70| summarize Countries = make_set(Location) by UserPrincipalName
71| where array_length(Countries) > 1
72```
73
74### Step 3: Act
75
76For every hit, three possible outcomes:
77
78| Outcome | Action |
79|---|---|
80| Confirmed malicious | Escalate to `incident-triage` immediately |
81| Confirmed benign | Document and move on |
82| Unknown / unable to confirm | Deepen investigation (host artifacts, network traffic, user interview) |
83
84Don't leave hits in the "unknown" state. Either resolve, or hand off with a documented next-step.
85
86### Step 4: Knowledge
87
88The hunt's value isn't the one hit — it's the artifacts.
89
90For each hunt:
91
92- If you found something, **write a detection rule** so future occurrences fire automatically (see `siem-detection`)
93- If you didn't find anything, **document the hunt** — query, scope, time window, conclusion. Future hunters won't re-do it
94- If the hunt was hard because of missing log coverage, **document the gap** and create a backlog item to fix log ingestion
95
96Hunts that don't produce artifacts are work without compounding return. The whole point of the methodology is to turn every hunt into either a rule, a documented dead-end, or a coverage improvement.
97
98## High-yield hunt catalog
99
100### Persistence
101
102- **Scheduled tasks created outside business hours** — `schtasks.exe /create` from Sysmon event 1 + EventCode 4698 from Windows Security
103- **Run-key persistence** — registry writes to `HKCU\...\Run`, `HKLM\...\Run`, `HKCU\...\RunOnce`
104- **Service installation outside known software-install windows** — EventCode 7045
105- **WMI persistence** — `__EventFilter` and `CommandLineEventConsumer` subscriptions
106- **Login items / launch daemons (macOS)** — `/Library/LaunchDaemons/*.plist`, `~/Library/LaunchAgents/*.plist`
107- **Cron / systemd timers (Linux)** — `/etc/cron.*`, `/etc/systemd/system/*.timer`, user crontabs
108
109### Defense evasion
110
111- **PowerShell with `-EncodedCommand`** — base64-encoded scripts are evasion 80% of the time
112- **`certutil.exe -decode`** — LOLBin used to decode dropper payloads
113- **Sysmon EventCode 7 (Image loaded) for known-bad DLLs from non-standard paths**
114- **Process executing from `%TEMP%`, `%APPDATA%`, `\Users\Public`** — non-standard exec paths
115- **Command-line obfuscation patterns** — large amounts of `^`, backticks, `cmd /c echo y | ...`
116
117### Credential access
118
119- **LSASS access from unexpected processes** — Sysmon EventCode 10 with TargetImage = `lsass.exe` and SourceImage not in `[mssense.exe, NisSrv.exe, ...]`
120- **`procdump.exe` or `comsvcs.dll` use** — process-dumping LOLBins
121- **NTDS.dit access outside backup windows** — domain controller DB
122- **AWS `GetSessionToken` or `AssumeRole` from new IPs** — credential capture pivot
123- **OAuth consent grants for high-scope applications** — see `iam-audit`
124
125### Discovery
126
127- **`net group "Domain Admins"`** or equivalent enumeration commands
128- **AD service ticket requests for high-value SPNs** (Kerberoasting prep) — EventCode 4769 with RC4 encryption
129- **`whoami /all`, `quser`, `nltest /domain_trusts`** — situational awareness commands run by service accounts (humans rarely run these)
130- **Cloud API listing — `ListBuckets`, `ListUsers`, `DescribeInstances` from unusual principals**
131
132### Lateral movement
133
134- **WMI execution to remote hosts** — Sysmon EventCode 1 with `wmic.exe` or `Invoke-WmiMethod`
135- **PsExec / remote service creation patterns** — EventCode 7045 with random service name
136- **Remote registry connections to unusual hosts**
137- **SSH key reuse — one private key authenticating to many hosts in a short window**
138- **AWS / GCP `AssumeRole` chains across accounts** — pivot detection
139
140### Collection / staging / exfil
141
142- **Large-volume reads from cloud storage by single principal** — unusual S3 / GCS access patterns
143- **Archive creation patterns** — `Compress-Archive`, `7z.exe`, `tar`, `zip` operating on directories outside user home
144- **DNS queries to recently-registered domains** — exfil over DNS or C2 beacon resolution
145- **Outbound TLS to high-risk geographies** — depends on your organization's normal pattern
146- **Beaconing patterns** — regular-interval connections (every N seconds ± jitter) to the same destination over hours
147
148### Cloud-specific
149
150- **IAM credential exfiltration patterns** — `GetCredentialReport`, `GenerateCredentialReport` from unusual principals
151- **IMDS access from unusual processes / containers** — anything reaching `169.254.169.254` that isn't the cloud SDK
152- **CloudTrail / Audit Log tampering attempts** — `StopLogging`, `DeleteTrail`, log-bucket access from non-logging principals
153- **Cross-region resource creation by single principal in short window** — pivot or coin-mining setup
154
155### Identity-provider-specific
156
157- **OAuth app grants of high-scope permissions** (Google Workspace, M365) — adversary technique for persistence outside the user's password
158- **MFA method enrollment from new device** — attacker registering their own MFA after stealing a session
159- **Sign-ins from impossible geographies** — geolocation jumps that exceed travel time
160- **Service-account authentication from new client / new IP** — service accounts should be predictable
161
162## Tools
163
164- **SIEM** — Splunk, Sentinel, Elastic, Chronicle, Sumo, Wazuh
165- **EDR** — CrowdStrike (RTR), SentinelOne (deep visibility), Microsoft Defender (advanced hunting), Carbon Black
166- **Sysmon** — open-source endpoint logging on Windows, output to SIEM
167- **osquery** — SQL queries over endpoint state (cross-platform)
168- **Velociraptor** — open-source live response and hunting framework (much more capable than free EDR)
169- **Zeek** — network metadata for traffic analysis
170- **MITRE ATT&CK Navigator** — coverage visualization
171- **Hunt-Evil** — hunting playbook content (open-source)
172- **MaxMind GeoIP** — geolocation lookup for IP-based hunts
173
174## Output Format
175
176```markdown
177# Threat Hunt Report
178## Hunt name: [descriptive — e.g., "Office process → encoded PowerShell"]
179## Hypothesis: [specific, testable, bounded]
180## Date range: [from - to]
181## Hunter: [name]
182
183### Methodology
184- ATT&CK technique(s): [TXXXX.NNN]
185- Data sources queried: [list]
186- Query / queries:
187 [the actual SIEM query]
188
189### Findings
190| Hit ID | Host / User / Resource | Outcome | Notes |
191|--------|------------------------|---------|-------|
192
193### Conclusion
194- [Confirmed malicious / All benign / Inconclusive]
195- [Confidence level — Low / Medium / High]
196
197### Artifacts produced
198- [ ] Detection rule added (link)
199- [ ] Coverage gap documented (link)
200- [ ] Negative-result documentation filed (link)
201
202### Recommended follow-up
203[Anything that needs deeper investigation, escalation, or future hunts]
204```
205
206## Boundaries
207
208- Hunt only environments the user has authorization for
209- Never query SIEM / EDR data outside the user's authority — even if the dataset is available, scope matters
210- For confirmed-malicious findings, escalate to `incident-triage` immediately — do not continue hunting and risk tipping the adversary
211- Live response actions (host isolation, account disablement) are incident response, not hunting — escalate
212- Refuse to use threat-hunting techniques to surveil employees beyond what HR / legal has authorized
213- Negative hunt results are valuable evidence, not failure — document and credit accordingly
214
215## References
216
217- PEAK Threat Hunting Framework (Splunk SURGe)
218- TaHiTI (Targeted Hunting integrating Threat Intelligence) — Dutch model
219- MITRE ATT&CK
220- "The ThreatHunter Playbook" (Cyb3rWard0g) — open-source content
221- Sigma rules repo — many rules can become hunt queries
222- "Practical Threat Intelligence and Data-Driven Threat Hunting" — Valentina Costa-Gazcón
223- David Bianco's "Pyramid of Pain" — IOC value hierarchy
224- SANS FOR508 / FOR578 course materials
225- Velociraptor community hunt content