Defender-DeviceLogonEvents

4 ActionTypes

ActionTypeTitle
anyLogon activity (any)
LogonSuccessLogon succeeded
LogonFailedLogon failed
LogonAttemptedLogon attempted (no result yet)

any: Logon activity (any)

#
Table
DeviceLogonEvents

Description

Logon activity (any)

Fields #

NameDescription
DeviceId
Timestamp
ActionType
LogonTypeLogon type code (2=Interactive, 3=Network, 4=Batch, 5=Service, 7=Unlock, 8=NetworkCleartext, 9=NewCredentials, 10=RemoteInteractive, 11=CachedInteractive).
AccountName
AccountDomain
AccountSid
RemoteIP
RemotePort
IsLocalAdmin
InitiatingProcessFileName
FailureReason

Common Indicators #

Field/value combinations most frequently checked by detection rules targeting this event, derived from cross-vendor predicate analysis.

FieldKindValueRulesVendors
ProtocoleqNTLM1 rulekusto
userends_with$1 ruleelastic, kusto

Detection Rules #

View all rules referencing this event →

Kusto #

  • Password Spray source: Below queries detect password spray attacks using sliding window count plugin. Because of implementation of the sliding window, queries work better than the bin() usage, but may create duplicate alerts. Grouping can be used in such cases. Sentinel Query:
  • Potential NTLM Relay Attack to Domain Controller source: Below query detects NTLM authentication coming from Domain Controller machine accounts. This is not an expected behavior and it's an indication of NTLM relay attack.
    If NTLM Relaying is done towards a Linux machine, this query won't detect that. The attacker must have access to a Linux device in that case though.

References #

LogonSuccess: Logon succeeded

#
Table
DeviceLogonEvents

Description

Logon succeeded

Fields #

NameDescription
DeviceId
Timestamp
LogonTypeLogon type code (2=Interactive, 3=Network, 4=Batch, 5=Service, 7=Unlock, 8=NetworkCleartext, 9=NewCredentials, 10=RemoteInteractive, 11=CachedInteractive).
AccountName
AccountDomain
RemoteIP
RemotePort
IsLocalAdmin

Common Indicators #

Field/value combinations most frequently checked by detection rules targeting this event, derived from cross-vendor predicate analysis.

FieldKindValueRulesVendors
EventTypeeqLogonSuccess3 ruleskusto
EventTypeeqPowerShellCommand1 rulekusto
LogonTypeeqNetwork2 ruleselastic, kusto, sigma, splunk
RemoteIPTypeneLoopback2 ruleskusto
DestinationPortin4451 ruleelastic, kusto
DestinationPortin801 ruleelastic, kusto, splunk
ProtocoleqNTLM1 rulekusto
TargetDomainNameinPUT YOUR AD DOMAINS HERE!1 rulekusto
TargetDomainNameincontoso1 rulekusto
TargetDomainNameincontoso.local1 rulekusto
parent_process_nameeqwsmprovhost.exe1 ruleelastic, kusto, splunk
subnetis_null1 rulekusto

Detection Rules #

View all rules referencing this event →

Kusto #

  • Password Spraying source medium: This query detects a password spraying attack, where a single machine has performed a large number of failed login attempts, with a large number of different accounts. For each account, the attacker uses just a few attempts to prevent account lockout. This query uses the DeviceLogonEvents per machine to detect a password spraying attacks. The machine against which the password spraying is performed (can be DC, a server or even an endpoint) needs to be enrolled in Microsoft Defender for Endpoint.↳ also matches LogonFailed: Logon failed
  • Service Accounts Performing Remote PS source high: Service Accounts Performing Remote PowerShell. The purpose behind this detection is for finding service accounts that are performing remote powershell sessions. There are two phases to the detection: Identify service accounts, Find remote PS cmdlets being ran by these accounts. To accomplish this, we utilize DeviceLogonEvents and DeviceEvents to find cmdlets ran that meet the criteria. One of the main advantages of this method is that only requires server telemetry, and not the attacking client. The first phase relies on the DeviceLogonEvents to determine whether an account is a service account or not, consider the following accounts with logons:. Random_user has DeviceLogonEvents with type 2, 3, 7, 10, 11 & 13. Random_service_account 'should' only have DeviceLogonEvents with type 3,4 or 5.
  • NTLM Relay Attack source: This query searches for successful NTLM network logins where the device name contained in the NTLM authentication message contains a device that is known to MDE, but the source IP address is different from the known source IP address for that specific device. This could indicate an attacker is relaying the NTLM authentication information. To remove false positives, this query also searches for an outgoing network connection from the initiator to the attacker.
Show 2 more (5 total)
  • Potentially Relayed NTLM Authentication - Microsoft Defender for Endpoint source: The below query detects NTLM logons where Network Address in the logon event doesn't match the Workstation Name's IP. This indicates potentially relayed NTLM authentication. It analyzes only the logons with domain accounts having admin privileges.
  • Detect service account login on new device source: This detection rule tries to flag suspicious logins on devices from service accounts, for which these service accounts did not login into those devices for the last 14 days. This might indicate that the service account is compromised and is being used for lateral movement into the environment. Most service accounts have a fairly static set of devices they authenticate to. Because of this, it is easier to flag deviations for service accounts compared to user accounts. However, some service accounts are known to dynamically log into devices based on observed events (susch as the MDI service accounts). Because of this some environment specific finetuning might be needed to reduce BP detections.

References #

LogonFailed: Logon failed

#
Table
DeviceLogonEvents

Description

Logon failed

Fields #

NameDescription
DeviceId
Timestamp
LogonTypeLogon type code (2=Interactive, 3=Network, 4=Batch, 5=Service, 7=Unlock, 8=NetworkCleartext, 9=NewCredentials, 10=RemoteInteractive, 11=CachedInteractive).
AccountName
AccountDomain
RemoteIP
FailureReason

Common Indicators #

Field/value combinations most frequently checked by detection rules targeting this event, derived from cross-vendor predicate analysis.

FieldKindValueRulesVendors
RemoteIPTypeneLoopback1 rulekusto

Detection Rules #

View all rules referencing this event →

Kusto #

  • Password Spraying source medium: This query detects a password spraying attack, where a single machine has performed a large number of failed login attempts, with a large number of different accounts. For each account, the attacker uses just a few attempts to prevent account lockout. This query uses the DeviceLogonEvents per machine to detect a password spraying attacks. The machine against which the password spraying is performed (can be DC, a server or even an endpoint) needs to be enrolled in Microsoft Defender for Endpoint.↳ also matches LogonSuccess: Logon succeeded

References #

LogonAttempted: Logon attempted (no result yet)

#
Table
DeviceLogonEvents

Description

Logon attempted (no result yet)

Fields #

NameDescription
DeviceId
Timestamp
LogonTypeLogon type code (2=Interactive, 3=Network, 4=Batch, 5=Service, 7=Unlock, 8=NetworkCleartext, 9=NewCredentials, 10=RemoteInteractive, 11=CachedInteractive).
AccountName
RemoteIP

References #