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 devices with specific names. Here's a simplified explanation:

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

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

  3. Filter for Suspicious Devices: It filters the combined data to find records where either the DeviceName or WorkstationName contains any of the suspicious names ("kali" or "parrot").

  4. Extract Relevant Information: For each record that matches the criteria, it extracts and standardizes key information:

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

In summary, this query helps identify and extract details about events involving devices with names that are typically associated with security testing or penetration testing tools.

Details

Jose Sebastián Canós profile picture

Jose Sebastián Canós

Released: June 26, 2024

Tables

IdentityLogonEventsIdentityQueryEventsIdentityDirectoryEventsSecurityEvent

Keywords

DevicesIdentitySecurityEvents

Operators

letdynamicunionisfuzzywherehas_anyorextendcoalesce

Actions

GitHub