Query Details

Multiple Suspicious Device Name

Query

let suspicious_device_name = dynamic([
    "kali",
    "parrot"
]);
union isfuzzy=true
    IdentityLogonEvents,
    IdentityQueryEvents,
    IdentityDirectoryEvents,
    SecurityEvent
| where DeviceName has_any (suspicious_device_name) or WorkstationName has_any (suspicious_device_name)
| extend
    SourceAccount = coalesce(AccountUpn, Account),
    SourceIPAddress = coalesce(IPAddress, IpAddress),
    SuspiciousDeviceName = coalesce(DeviceName, WorkstationName)

Explanation

This query is designed to identify potentially suspicious activities involving specific devices. Here's a simplified breakdown:

  1. Define Suspicious Device Names: It starts by listing device names that are considered suspicious, specifically "kali" and "parrot".

  2. Combine Data from Multiple Sources: It merges data from four different event logs: IdentityLogonEvents, IdentityQueryEvents, IdentityDirectoryEvents, and SecurityEvent. The isfuzzy=true option allows for a more flexible combination of these data sources.

  3. Filter for Suspicious Devices: It filters the combined data to find any records where the device name or workstation name matches any of the suspicious device names ("kali" or "parrot").

  4. Extract Relevant Information: For each matching record, it extracts and standardizes key information:

    • SourceAccount: The user account involved, using either AccountUpn or Account.
    • SourceIPAddress: The IP address involved, using either IPAddress or IpAddress.
    • SuspiciousDeviceName: The name of the suspicious device, using either DeviceName or WorkstationName.

In summary, this query searches through various logs to find and highlight events involving devices with names that are typically associated with security testing or hacking tools, and it organizes the relevant details for further analysis.

Details

Jose Sebastián Canós profile picture

Jose Sebastián Canós

Released: June 26, 2024

Tables

IdentityLogonEventsIdentityQueryEventsIdentityDirectoryEventsSecurityEvent

Keywords

IdentityLogonEventsIdentityQueryEventsIdentityDirectoryEventsSecurityEventDeviceNameWorkstationNameSourceAccountSourceIPAddressSuspiciousDeviceName

Operators

letdynamicunionisfuzzywherehas_anyorextendcoalesce

Actions

GitHub