Lesson 70 — The Complete Advanced Threat Hunting Investigation
Bring together the full threat-hunting workflow: form a hypothesis, verify telemetry, investigate identity and endpoint changes, correlate network clues, and produce a defensible final case report.

What you will learn
Investigate a multi-stage case without confusing suspicious signals with proven attacker activity.
Agent Foskett case file — The midnight maintenance account
A privileged account signs in outside its usual hours. Shortly afterward, a Windows host records a new scheduled task, a privileged group membership change and outbound traffic to an unfamiliar destination. Are these events connected? Agent Foskett must establish an evidence-backed timeline and test an alternative explanation: an approved emergency maintenance operation.
Learning objectives
- Build a scoped, falsifiable advanced threat-hunting hypothesis.
- Verify table availability, collection coverage and retention before interpreting results.
- Investigate sign-ins, privilege changes and persistence indicators using KQL.
- Correlate Windows, Microsoft Entra and network observations cautiously.
- Map observed behaviour to MITRE ATT&CK only where supported.
- Deliver a concise case report with confidence, limitations and next actions.
The investigation hypothesis
Hypothesis: an unauthorized actor used a privileged identity, established persistence and contacted an external system. Alternatives: approved administrative work, endpoint management software, scheduled updates or unrelated events. A matching timestamp or username is a lead—not proof of a single attack chain.
The end-to-end hunting method
Define scope → validate sources → collect candidate evidence → enrich with context → correlate by stable identifiers → test competing explanations → assess confidence → document findings. Preserve original timestamps and record the timezone used in the report.
Know your data sources
These examples target SecurityEvent, SigninLogs, AuditLogs and CommonSecurityLog in Microsoft Sentinel Logs. Each table requires an appropriate connector and collection configuration. Defender XDR DeviceProcessEvents and DeviceNetworkEvents belong to Defender advanced hunting unless exposed through supported integration. Do not assume cross-product tables exist in every workspace.
Evidence sources and limitations
| Source | Useful evidence | Important limitation |
|---|---|---|
| SecurityEvent | Windows logons, privileged sessions, group and task changes | Event IDs depend on auditing and collection |
| SigninLogs | Microsoft Entra sign-in attempts and results | Cloud identity does not by itself prove host activity |
| AuditLogs | Directory and role-management activity | Payloads may require record-specific inspection |
| CommonSecurityLog | Network device events from supported CEF sources | Field meaning varies by vendor and parser |
| Defender XDR | Endpoint processes and network connections | Use the correct hunting interface and permissions |
Start with an evidence inventory
Record the investigation window, affected identities, hostnames, expected logging sources and approved maintenance windows. A zero-result query may mean absent telemetry, not absent attacker activity. Validate ingestion before drawing negative conclusions.
KQL hunt 1 — Verify Windows evidence coverage
SecurityEvent
| where TimeGenerated >= ago(7d)
| where EventID in (4624, 4672, 4698, 4702, 4697, 4728, 4732, 4756)
| summarize Events = count(), Hosts = dcount(Computer),
LastSeen = max(TimeGenerated) by EventID
| order by EventID ascConfirm expected host and event coverage before relying on the remaining hunts.
Authentication is the opening clue
Look for a change from the account’s normal sign-in pattern: new location, unusual time, repeated failures followed by success, or unfamiliar device context. Sign-in anomalies should be checked against travel, VPN egress, service accounts and known administrative workflows.
KQL hunt 2 — Review Entra sign-in outcomes
SigninLogs
| where TimeGenerated >= ago(7d)
| summarize Attempts = count(), Failures = countif(ResultType != "0"),
FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated)
by UserPrincipalName, IPAddress
| where Attempts >= 2
| order by Failures desc, Attempts descResultType 0 commonly indicates success; verify the event details and account baseline before labeling an IP suspicious.
Privilege changes require actor context
Windows event 4672 reports special privileges assigned to a new logon and is not, by itself, evidence that privileges were escalated. Group membership events such as 4728, 4732 and 4756 are stronger leads for membership changes, but require the group, target member, actor and approval context.
KQL hunt 3 — Triage privileged group changes
SecurityEvent
| where TimeGenerated >= ago(7d)
| where EventID in (4728, 4732, 4756)
| project TimeGenerated, Computer, EventID,
Account, Activity, EventData
| order by TimeGenerated desc
| take 250Inspect EventData for actor, member and group context; do not assume all changes were unauthorized.
Persistence is a separate question
Scheduled task events 4698 and 4702 can indicate task creation or modification, but neither proves that the task executed. Inspect task details and corroborate execution with appropriate process or task operational telemetry. Legitimate endpoint agents routinely create tasks.
KQL hunt 4 — Inspect task and service changes
SecurityEvent
| where TimeGenerated >= ago(7d)
| where EventID in (4698, 4702, 4697)
| project TimeGenerated, Computer, EventID,
Account, Activity, EventData
| order by TimeGenerated desc
| take 250Event 4697 concerns service installation; System event 7045 requires collection of the System channel and may reside in another table.
Network communication needs a baseline
Outbound traffic to an uncommon destination can be a useful lead, but business applications, cloud services and security tools may also generate recurring connections. Check source and destination context, protocol, volume, timing and any available endpoint process attribution.
KQL hunt 5 — Summarise outbound network destinations
CommonSecurityLog
| where TimeGenerated >= ago(24h)
| where isnotempty(DestinationIP)
| summarize Connections = count(),
FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated)
by SourceIP, DestinationIP, DestinationPort
| order by Connections desc
| take 100Requires a supported CEF data source. Frequent traffic is not automatically command-and-control; check device semantics and baseline.
Correlate carefully across tables
Use timestamps, normalized hostnames, device identifiers, account identities, source IPs and correlation IDs where available. Do not equate a public IP in a cloud sign-in with a local device IP without supporting context. Account names and timestamps alone can produce false joins.
Build the investigation timeline
This is an investigative sequence, not an assertion that every stage occurred or shares one cause.
Map behaviour to MITRE ATT&CK
Candidate mappings might include Valid Accounts (T1078), Account Manipulation (T1098), Scheduled Task/Job (T1053), and Application Layer Protocol (T1071). Apply a technique only when observed behaviour supports its definition. A logon, task or network connection does not automatically establish malicious use of that technique.
Separate fact, inference and unknown
| Category | Example |
|---|---|
| Observed fact | A 4732 event reports a local group membership addition on a named host |
| Inference | The change may have increased the target account’s access |
| Unknown | Whether the change was authorized and later used |
Keeping these categories separate prevents a plausible story from becoming an unsupported incident verdict.
Evaluate competing explanations
For each lead, check approved changes, software deployment records, privileged access management logs, endpoint ownership and normal service behavior. Ask what observation would disprove the original hypothesis. Escalate based on corroboration and organizational policy—not on the number of ATT&CK labels assigned.
Preserve investigation quality
Use read-only, time-bounded queries. Retain original record identifiers and raw evidence where policy permits. Note missing tables, time skew, result limits and schema assumptions. Coordinate any containment or remediation through the incident response process.
Case file resolution — The midnight maintenance account
Agent Foskett verifies that the privileged group change and scheduled task were recorded during an approved emergency maintenance window. The task was created by an authorized deployment system. The unfamiliar network destination belonged to the vendor’s update service, but endpoint process attribution was unavailable. The unusual Entra sign-in remained unexplained and was referred for identity-team validation.
Conclusion: a unified intrusion chain was not established. The administrative changes were supported by change records; the sign-in anomaly remained an open investigative lead. The final report distinguishes those outcomes instead of forcing a single verdict.
Hands-on lab — Complete the investigation
- Choose a permitted test environment and a seven-day investigation window.
- Confirm which required tables are available and record coverage gaps.
- Run the five hunts and identify candidate records.
- Inspect original event payloads and record stable identifiers.
- Build a timeline without assuming causality.
- Check change approvals and document two alternative explanations.
- Map only supported behaviours to MITRE ATT&CK.
- Write a case report with evidence, confidence, gaps and next steps.
Knowledge check
- Why must telemetry coverage be verified before a zero-result query is interpreted?
- Why does Windows event 4672 not prove privilege escalation?
- What additional evidence could prove a scheduled task executed?
- Why can matching timestamps produce misleading correlations?
- What distinguishes a supported ATT&CK mapping from a speculative one?
- How should unresolved leads appear in the final report?
Final investigation report template
Scope: timeframe, identities, hosts and data sources. Hypothesis: suspected activity and alternatives. Observed evidence: record IDs, timestamps, actors and affected assets. Analysis: correlations and counter-evidence. ATT&CK: supported mappings only. Confidence: high, medium or low with rationale. Limitations: missing logs and unresolved questions. Disposition: close, monitor or escalate under policy.
Operational quality checklist
- Opening HTML comment and lesson metadata match Lesson 70.
- Queries are read-only and use explicit time windows.
- Table names and connector prerequisites are stated.
- Line numbers align with each KQL line.
- Facts, hypotheses and unknowns are separated.
- Conclusions preserve alternative explanations.
- Navigation links only to published lessons.
Agent Foskett takeaway
A complete threat hunt is not the longest list of suspicious events. It is the clearest account of what the evidence supports, what it contradicts and what remains unknown.
The Logs Already Knew.
