Forum Discussion
gpneira
Jul 20, 2023Copper Contributor
Detection rule Admin Grant permission granted
Hello, i have to deploy a rule that detects when a local user has recieved admin rights (or was added to a admin local group) and then this account made a loggin. i have the tables that come from ...
- Jul 23, 2023
Hey gpneira,
if I understand you correctly the query below should help you.First, it looks for 'UserAccountAddedToLocalGroup' and extends the necessary fields, especially AddedAccountSID . Then it joins this table with DeviceLogonEvents where AddedAccountSID == AddedAccountSID .
Please let me know if this worked for you.DeviceEvents | where ActionType == 'UserAccountAddedToLocalGroup' | extend AddedAccountSID = tostring(parse_json(AdditionalFields).MemberSid) | extend LocalGroup = AccountName | extend LocalGroupSID = AccountSid | extend Actor = trim(@"[^\w]+",InitiatingProcessAccountName) | join DeviceLogonEvents on $right.AccountSid == $left.AddedAccountSID | where IsLocalAdmin == 1 and AdditionalFields1.IsLocalLogon == true | project Timestamp, DeviceName, LocalGroup,LocalGroupSID, AddedAccountSID, Actor, ActionType
R3al3ztthevilin
Jul 28, 2023Copper Contributor
How
- R3al3ztthevilinJul 28, 2023Copper ContributorTo apply
- gpneiraJul 28, 2023Copper Contributorhow what sorry?