VeriKQL by Kaushik Saha

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
✓ Verified by VeriKQLKusto.Language 12.4.1 · bundle 2026.10.29

Result on the sample · 2 rows

TimeGeneratedSenderFromAddressSubjectSenderIPv4DeliveryAction
2026-06-10 07:36:22ap@fabrikam.exampleRemittance advice 4471198.51.100.80Delivered
2026-06-10 07:55:12billing@invoices-contoso.exampleAction required: overdue invoice INV-20931203.0.113.45Delivered

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
✓ Verified by VeriKQLKusto.Language 12.4.1 · bundle 2026.10.29

Result on the sample · 2 rows

EmailTimeSenderFromAddressRecipientEmailAddressSenderIPv4SignInsFirstSignIn
2026-06-10 07:55:12billing@invoices-contoso.examplealex.morgan@contoso.com203.0.113.45112026-06-10 08:14:02
2026-06-10 07:55:14billing@invoices-contoso.examplepriya.nair@contoso.com203.0.113.45112026-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
✓ Verified by VeriKQLKusto.Language 12.4.1 · bundle 2026.10.29

Result on the sample · 2 rows

TimeGeneratedSenderFromAddressSubjectDeliveryAction
2026-06-10 07:31:05julia.santos@contoso.comQ2 close: timetableDelivered
2026-06-10 07:55:14billing@invoices-contoso.exampleAction required: overdue invoice INV-20931Delivered

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.