Bert-Jan Pals unknown stable kql

Sign Ins by compromised account

List the interactive and noninteractive signins that have been performed by a compromised account. This can be done based on the UPN of the compromised account.

View Source

Detection Logic

let CompromisedAccountUPN = "test@test.com";
let SearchWindow = 48h; //Customizable h = hours, d = days
let aadFunc = (tableName: string, email: string) {
    table(tableName)
| where TimeGenerated > ago(SearchWindow)
| where ResultType == 0
| where UserPrincipalName == email
};
let aadSignin = aadFunc("SigninLogs", CompromisedAccountUPN);
let aadNonInt = aadFunc("AADNonInteractiveUserSignInLogs", CompromisedAccountUPN);
union isfuzzy=true aadSignin, aadNonInt
// In case of all details remove line below
| project TimeGenerated, Category, Location, AppDisplayName, ClientAppUsed, RiskState

Field Validations

Loading…

Comments (0)

Loading comments...