Skip to content

Latest commit

 

History

History
31 lines (26 loc) · 994 Bytes

LocalAdminsWithTheMostDevicesAccessed.md

File metadata and controls

31 lines (26 loc) · 994 Bytes

Hunt for Local Admins with the most RemoteInteractive logins

Query Information

Description

Hunt for Local Admins with the most RemoteInteractive logins

References

Defender XDR

DeviceLogonEvents
| where IsLocalAdmin == "True"
| where LogonType == "RemoteInteractive"
| extend IsLocalLogon = tostring(todynamic(AdditionalFields).IsLocalLogon)
| summarize DevicesAccessed = make_set(DeviceName) by AccountName, AccountDomain
| extend TotalDevices = array_length(DevicesAccessed)
| sort by TotalDevices

Sentinel

DeviceLogonEvents
| where IsLocalAdmin == "True"
| where LogonType == "RemoteInteractive"
| extend IsLocalLogon = tostring(todynamic(AdditionalFields).IsLocalLogon)
| summarize DevicesAccessed = make_set(DeviceName) by AccountName, AccountDomain
| extend TotalDevices = array_length(DevicesAccessed)
| sort by TotalDevices