Level 6 · Is this one incident? · Mission 1 of 5 · by Kaushik Saha
The email
Alert Six alerts, one attacker · Idea join on $left / $right
Commands here project · where · == · and / or · sort by · count · summarize · min / max · join · kind=inner · all commands
Briefing
Five alerts, one account. How did it start? Alex says they clicked a link in an invoice email before the prompts
began. Microsoft Defender for Office 365 records every email in EmailEvents.
One idea: a second table, joined on a shared value
First, Alex's mail this morning:
EmailEvents
| where RecipientEmailAddress == "alex.morgan@contoso.com"
| sort by TimeGenerated asc
| project TimeGenerated, SenderFromAddress, Subject, SenderIPv4, DeliveryAction
Result on the sample · 2 rows
| TimeGenerated | SenderFromAddress | Subject | SenderIPv4 | DeliveryAction |
|---|---|---|---|---|
| 2026-06-10 07:36:22 | ap@fabrikam.example | Remittance advice 4471 | 198.51.100.80 | Delivered |
| 2026-06-10 07:55:12 | billing@invoices-contoso.example | Action required: overdue invoice INV-20931 | 203.0.113.45 | Delivered |
An "overdue invoice" at 07:55 from invoices-contoso.example: a look-alike domain, sent from 203.0.113.45. That is
the address of the brute force. Join the two tables on it; the columns have different names, so $left and $right
say which is which:
EmailEvents
| where IsFirstContact == true and DeliveryAction == "Delivered"
| project EmailTime = TimeGenerated, SenderFromAddress, RecipientEmailAddress, SenderIPv4
| join kind=inner (SigninLogs | summarize SignIns = count(), FirstSignIn = min(TimeGenerated) by IPAddress)
on $left.SenderIPv4 == $right.IPAddress
| project EmailTime, SenderFromAddress, RecipientEmailAddress, SenderIPv4, SignIns, FirstSignIn
Result on the sample · 2 rows
| EmailTime | SenderFromAddress | RecipientEmailAddress | SenderIPv4 | SignIns | FirstSignIn |
|---|---|---|---|---|---|
| 2026-06-10 07:55:12 | billing@invoices-contoso.example | alex.morgan@contoso.com | 203.0.113.45 | 11 | 2026-06-10 08:14:02 |
| 2026-06-10 07:55:14 | billing@invoices-contoso.example | priya.nair@contoso.com | 203.0.113.45 | 11 | 2026-06-10 08:14:02 |
The same address sent the phish to Alex and Priya at 07:55, and started signing in 19 minutes later.
Your turn
Show every email Priya Nair received today, oldest first, with the sender, the subject and whether it was delivered.
Write it in the box below and check it. Then compare with one answer; others can be right too.
Show one answer
EmailEvents
| where RecipientEmailAddress == "priya.nair@contoso.com"
| sort by TimeGenerated asc
| project TimeGenerated, SenderFromAddress, Subject, DeliveryAction
Result on the sample · 2 rows
| TimeGenerated | SenderFromAddress | Subject | DeliveryAction |
|---|---|---|---|
| 2026-06-10 07:31:05 | julia.santos@contoso.com | Q2 close: timetable | Delivered |
| 2026-06-10 07:55:14 | billing@invoices-contoso.example | Action required: overdue invoice INV-20931 | Delivered |
Check your own query
Write your query for the task above and check it against the real schema.
Debrief
The attack began with an email. Priya received it too: her account is the next one to check. Next, the last thing the attacker did.
All data on this page is sample data, made up for this course. The IP addresses come from ranges reserved for documentation, and the people and the company are fictional.
Mission by Kaushik Saha. Every query checked with Microsoft.Azure.Kusto.Language 12.4.1 against schema bundle 2026.10.29; every result computed on the course's sample with Kusto-Loco 1.4.9, an open-source KQL engine (credits). The story's clock reads 12:00 UTC on 10 June 2026.