Detection and responseHackBlue

Sign-in log query lab

Query 45 sign-in events in KQL or SPL style and separate a password spray from a brute force and from users mistyping their passwords.

  • Interactive lab
  • Intermediate
  • 5 graded steps
  • 0 of 5 solved

This lab is part of One alert, before you escalate.

Your goal

Your goalUse queries to tell a password spray from a brute force and from users mistyping, and find the account the spray broke into.

The SigninLogs table holds 45 sign-in events from one morning. The SOC got a vague alert about “lots of failed logins” and wants to know whether it is a spray, a brute force, or users mistyping passwords.

Write queries in KQL style (SigninLogs | where … | summarize … by …) or SPL style (search index=signin … | stats … by …). The engine supports where, search, summarize or stats with count and dcount, project, order or sort, take or head, distinct, and count.

What’s on screen
Query
the text box at the top. Type a query in KQL or SPL style. The results update as you type.
Example queries
the buttons under the box. Each one loads a working query you can edit.
Results
the table below, one row per result, with the columns your query asked for.
Walkthrough
the numbered path beside the workbench (below it on a phone). Each step says what to do and what you should see. Hints open one at a time.
QueryKQL style

4 rows

Columns: TimeGenerated UserPrincipalName IPAddress ResultType AppDisplayName Location · ResultType 0 is success, 50126 is a bad password, 50053 is a locked account.

Results
IPAddresscount_
203.0.113.4517
198.51.100.2315
198.51.100.1452
198.51.100.1411

The whole walkthrough

Every step in order: 285 words, about 2 min. It gives away every answer, so try the steps first.