0) What Threat Hunting is (and isn’t)
Threat hunting is a proactive, hypothesis-driven search for unknown or currently undetected adversary activity across endpoint, identity, network, cloud, and SaaS.
It is not alert triage. Triage starts from a detection; hunting starts from a question:
“If an attacker used T1059 PowerShell to pull creds and pivot via RDP, what traces would exist in our logs right now?”
Hunting outputs are:
-
Findings (confirmed/likely benign),
-
New detections (SIEM/XDR rules, Sigma),
-
Data/visibility gaps to fix,
-
Playbooks to automate next time.
1) Prereqs: Data, Access, and Baselines
Minimum data plane
-
Endpoint: EDR/OS telemetry (process/start/stop, parent/child, command-line, module loads), Sysmon (1, 3, 7, 8, 10, 11, 13, 22, 23, 24, 25).
-
Identity: IdP (Okta/Azure AD) sign-ins, MFA, role/consent grants, token logs.
-
Network: DNS, proxy/HTTP, NetFlow/PCAP/Zeek, TLS JA3/JA3S, egress firewall.
-
Email: Secure email gateway (headers, URL/attachment verdicts), user-reported phishing.
-
Cloud/SaaS: AWS CloudTrail, Azure Activity/Sign-in, GCP Audit, storage access, admin actions.
-
Control plane: CMDB/asset inventory, user directory, threat intel (internal + OSINT).
Baselines to compute (and refresh weekly)
-
Process ancestry (top N chains per role),
-
Admin tool usage (who legitimately runs PS/WMIC/AD tools),
-
Login geography & ASN per user,
-
Normal egress (dest hostnames, ports),
-
Service-to-service flows (for microsegmentation).
2) Method: Hypothesis → Hunt → Pivot → Outcome
-
Pick a TTP (map to ATT&CK): e.g., T1055 Process Injection.
-
Form a hypothesis tied to your telemetry:
-
“If an attacker injects into
lsass.exe, we’ll see handle opens withPROCESS_VM_READ+ EDR memory dump events + spike inlsassCPU.”
-
-
Define observables/features (fields, sequences, thresholds).
-
Query + iterate (multiple lenses: endpoint, identity, network, cloud).
-
Enrich (TI, WHOIS, GeoIP, reputation, internal context).
-
Decide outcome:
-
Escalate incident • Write detection • Tune out noise • File data gap.
-
-
Record in the huntbook (template below).
3) Core Hunt Patterns (with copy-paste queries)
Replace indexes/sourcetypes to match your stack. Use these as starters and tune to your environment.
A) Credential Access & Privilege Abuse
Goal: Catch theft/escalation before lateral movement.
KQL (Azure Sign-in – “impossible travel + new admin”)
SPL (Splunk – “sudden MFA fatigue”)
EQL (Elastic – LSASS access / dumping)
B) Initial Access → LOLBins / Scripted Execution
KQL (Office spawning script interpreters)
SPL (macro download behavior)
C) Lateral Movement (PsExec / WMI / RDP)
KQL (new remote service creation – PsExec-like)
SPL (suspicious RDP fan-out)
D) Data Staging & Exfiltration
KQL (staging archives prior to exfil)
SPL (DNS tunneling indicators)
E) Cloud Control Plane Hunts
AWS CloudTrail – unusual AssumeRole
Azure OAuth consent / risky app
GCP – service account key creation
F) C2 & Post-Exploitation
Zeek/TLS JA3 outliers
EDR beacons with sleep jitter
4) AI-Augmented Hunting (how to use ML safely)
-
Unsupervised outliering for user logon time, process trees, egress volumes.
-
Semi-supervised: seed from known bad → learn look-alikes.
-
Feature engineering:
-
Process ratio metrics (child/parent entropy, script length, flag density),
-
Auth sequence features (fail→success windows, geo distance),
-
DNS features (label count, char entropy, unique domain fan-out).
-
-
Tooling: Jupyter +
pandas,scikit-learn, MSTICPy for TI/geo enrichment. -
Guardrails: Keep models explainable; always ship deterministic detections derived from ML findings.
5) From Hunt → Detection (Detection Engineering Pipeline)
-
Convert query to Sigma (portable YAML).
-
Back-test 30–90 days; collect FPs.
-
Add contextual filters (business apps, admin ranges).
-
Publish to SIEM/XDR; attach SOAR response.
-
Add review date (tune or retire).
Sigma example (Office → Script Launch)
6) Huntbook Template (copy this)
Hunt ID / Name
Hypothesis: (one sentence, falsifiable)
ATT&CK: tactics/techniques
Data: sources & fields used
Queries: KQL/SPL/EQL links
Enrichment: TI, WHOIS, asset owner
Findings: IOCs, hosts, users, timeline
Outcome: incident | new detection | gap | benign pattern
Detection Rule Link: SIEM/XDR/Sigma
Owner / Due / Review Date
7) Metrics that matter (prove value)
-
Hunts/quarter & % with outcomes (incident/detection/gap).
-
Detection coverage vs MITRE ATT&CK (% techniques with rules).
-
Dwell time reduction for hunted families (before/after).
-
Noise burn-down (alerts/day reduced by tuning).
-
Mean time to first evidence in hunts (< 30 min for top TTPs).
8) 30/60/90 Hunting Program Plan
Day 0–30 (Foundations)
-
Confirm telemetry coverage & retention (≥ 90 days key logs).
-
Build 10 starter hunts for: phishing → initial exec, credential theft, RDP fan-out, archive staging, OAuth consent.
-
Stand up huntbook, tag assets, create Purple-Team slot weekly.
Day 31–60 (Scale & Automate)
-
Convert ≥ 6 hunts to detections + SOAR actions.
-
Baseline identity and egress; publish “known-good” allowlists.
-
Add cloud hunts (AssumeRole, key creation, public bucket drift).
Day 61–90 (Mature)
-
ML outlier jobs for login patterns & DNS.
-
Quarterly tabletop + back-test: measure coverage vs top 10 TTPs seen.
-
Publish a “Hunt to Detect” changelog for the exec dashboard.
9) Golden Hunt Library (keep these ready)
-
AitM/MFA-bombing: fail bursts → push approvals → success from new ASN.
-
LSASS dump:
procdump/comsvcs/rundll32touching LSASS + temp.dmp. -
PsExec chain:
PSEXESVCservice creation + SMB pipes + remote cmd. -
WMI persistence:
EventFilter/Consumer/Bindingtrio in WMI repo. -
Archive staging: 7z/rar + large write burst + new external PUT/POST.
-
DNS tunnel: high TXT ratio, long/entropy labels, single host fan-out.
-
OAuth abuse: risky scopes (Mail.Read, offline_access), sudden tenant-wide consent.
-
S3/GCS exfil: unusual GET/PUT spikes from workstation subnets.
CyberDudeBivash Expert Take
Great hunting is disciplined curiosity: pick one TTP, look from four angles (endpoint, identity, network, cloud), prove or disprove fast, and always ship a follow-up (detection, automation, or data fix). Do this weekly, and you will force adversaries to make noise — noise you now detect at machine-speed.
Author/Brand: CyberDudeBivash • Powered by: CyberDudeBivash • © CyberDudeBivash
Hashtags: #CyberDudeBivash #ThreatHunting #ATTACK #DFIR #SIEM #XDR #SOAR #BlueTeam #PurpleTeam #AIsecurity
