Level 3 · Did they get in? · Mission 3 of 5 · by Kaushik Saha
Last seen
Alert Failures, then a success · Idea arg_max
Commands here where · == · and / or · startswith · sort by · summarize · arg_max · all commands
Briefing
A SOC lead's first two questions: when did it start, and is it still going on? Find the last time each attacker address was seen.
One idea: arg_max keeps the whole row with the largest value
SigninLogs
| where IPAddress startswith "203.0.113." or IPAddress startswith "198.51.100."
| summarize arg_max(TimeGenerated, UserPrincipalName, AppDisplayName, ResultType) by IPAddress
| sort by TimeGenerated asc
Result on the sample · 3 rows
| IPAddress | TimeGenerated | UserPrincipalName | AppDisplayName | ResultType |
|---|---|---|---|---|
| 198.51.100.23 | 2026-06-10 07:46:58 | it.admin@contoso.com | Office 365 Exchange Online | 50126 |
| 203.0.113.45 | 2026-06-10 09:02:41 | alex.morgan@contoso.com | Azure Portal | 0 |
| 203.0.113.77 | 2026-06-10 09:58:44 | alex.morgan@contoso.com | Azure Storage | 0 |
Three outside addresses, not two. The spray stops at 07:46. 203.0.113.45 is last seen at 09:02 in the Azure
portal. And a new one, 203.0.113.77, is still signing in as Alex at 09:58, to Azure Storage.
Your turn
For each user, show their latest successful sign-in, with the time, the address and the app.
Write it in the box below and check it. Then compare with one answer; others can be right too.
Show one answer
SigninLogs
| where ResultType == "0"
| summarize arg_max(TimeGenerated, IPAddress, AppDisplayName) by UserPrincipalName
| sort by UserPrincipalName asc
Result on the sample · 12 rows
| UserPrincipalName | TimeGenerated | IPAddress | AppDisplayName |
|---|---|---|---|
| alex.morgan@contoso.com | 2026-06-10 09:58:44 | 203.0.113.77 | Azure Storage |
| ben.carter@contoso.com | 2026-06-10 10:11:38 | 192.0.2.20 | Microsoft Teams |
| it.admin@contoso.com | 2026-06-10 11:47:01 | 192.0.2.10 | Azure Portal |
| julia.santos@contoso.com | 2026-06-10 10:21:24 | 192.0.2.10 | Office 365 SharePoint Online |
| lena.fischer@contoso.com | 2026-06-10 10:06:53 | 192.0.2.20 | Office 365 Exchange Online |
| mei.chen@contoso.com | 2026-06-10 10:18:40 | 192.0.2.10 | Office 365 Exchange Online |
| omar.haddad@contoso.com | 2026-06-10 10:28:30 | 192.0.2.34 | My Apps |
| priya.nair@contoso.com | 2026-06-10 10:21:42 | 192.0.2.10 | Microsoft Teams |
| raj.patel@contoso.com | 2026-06-10 10:27:32 | 192.0.2.41 | Office 365 SharePoint Online |
| sam.okafor@contoso.com | 2026-06-10 10:25:28 | 192.0.2.10 | Office 365 SharePoint Online |
| sara.lind@contoso.com | 2026-06-10 11:02:40 | 192.0.2.20 | Office 365 Exchange Online |
| tom.becker@contoso.com | 2026-06-10 10:10:42 | 192.0.2.20 | Office 365 SharePoint Online |
Check your own query
Write your query for the task above and check it against the real schema.
Debrief
The attacker changed address after getting in. Level 5 follows what they did; first, one more check that makes this a detection.
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.