MDI (Identity)
Introduction
Devices Accessed By Compromised Device
// Define the compromised device and search window
let CompromisedDevice = "PC01.exampledomain.com";
let SearchWindow = 48h; // Customizable: h = hours, d = days
// Query to investigate devices accessed by the compromised device
IdentityLogonEvents
| where TimeGenerated >= ago(SearchWindow) // Use Sentinel's default time field
| where DeviceName == CompromisedDevice // Filter for the compromised device
| extend
FormattedTimestamp = format_datetime(TimeGenerated, 'yyyy-MM-dd HH:mm:ss'), // Human-readable timestamp
AccessDetails = strcat(ActionType, " via ", Protocol) // Combine action type and protocol for detailed context
| summarize
TotalAccessedDevices = dcount(DestinationDeviceName), // Count unique destination devices accessed
AccessedDevices = make_set(DestinationDeviceName), // List of destination devices accessed
AccountsUsed = make_set(AccountName), // List of accounts used in the access
AccountDomains = make_set(AccountDomain), // List of account domains
ActionsPerformed = make_set(ActionType), // List of unique action types
ProtocolsUsed = make_set(Protocol), // List of unique protocols
IPAddressesInvolved = make_set(IPAddress), // List of unique IP addresses involved
TargetDevices = make_set(TargetDeviceName), // List of target devices
AccessEventCount = count() // Total number of access events
by bin(TimeGenerated, 1h), DeviceName // Group by time bins and device
| project
FormattedTimestamp, // Include formatted timestamp
DeviceName, // Compromised device
TotalAccessedDevices, // Number of unique devices accessed
AccessedDevices, // List of accessed devices
AccountsUsed, // List of accounts used
AccountDomains, // List of account domains
ActionsPerformed, // List of actions performed
ProtocolsUsed, // List of protocols used
IPAddressesInvolved, // List of IP addresses
TargetDevices, // List of target devices
AccessEventCount // Count of access events
| order by FormattedTimestamp desc // Sort by the most recent eventsIdentify All Suspicious Activities From The Compromised Accounts
Identify Failed Login Attempts From Users
Lateral Movement By Compromised Accounts
User Added To Sensitive Group
Anomalous Group Policy Discovery
SMB File Copy
Identify Suspicious SMB Activity
Reference
Last updated