Author: Andrew Rathbun
Description: An operation was attempted on a privileged object
EventId: 4674
Channel: Security
Provider: Microsoft-Windows-Security-Auditing
Maps:
  -
    Property: UserName
    PropertyValue: "%domain%\\%user% (%sid%)"
    Values:
      -
        Name: domain
        Value: "/Event/EventData/Data[@Name=\"SubjectDomainName\"]"
      -
        Name: user
        Value: "/Event/EventData/Data[@Name=\"SubjectUserName\"]"
      -
        Name: sid
        Value: "/Event/EventData/Data[@Name=\"SubjectUserSid\"]"
  -
    Property: ExecutableInfo
    PropertyValue: "%ProcessName% (PID: %ProcessId%)"
    Values:
      -
        Name: ProcessName
        Value: "/Event/EventData/Data[@Name=\"ProcessName\"]"
      -
        Name: ProcessId
        Value: "/Event/EventData/Data[@Name=\"ProcessId\"]"
  -
    Property: PayloadData1
    PropertyValue: "PrivilegeList: %PrivilegeList%"
    Values:
      -
        Name: PrivilegeList
        Value: "/Event/EventData/Data[@Name=\"PrivilegeList\"]"
  -
    Property: PayloadData2
    PropertyValue: "ObjectServer: %ObjectServer%"
    Values:
      -
        Name: ObjectServer
        Value: "/Event/EventData/Data[@Name=\"ObjectServer\"]"
  -
    Property: PayloadData3
    PropertyValue: "SubjectLogonId: %SubjectLogonId%"
    Values:
      -
        Name: SubjectLogonId
        Value: "/Event/EventData/Data[@Name=\"SubjectLogonId\"]"

# Documentation:
# https://www.ultimatewindowssecurity.com/securitylog/encyclopedia/event.aspx?eventid=4674
# https://docs.microsoft.com/en-us/windows/security/threat-protection/auditing/event-4674
# https://github.com/nasbench/EVTX-ETW-Resources/blob/main/ETWProvidersCSVs/Internal/Microsoft-Windows-Security-Auditing.csv
#
# Example Event Data:
# - <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
# - <System>
#  <Provider Name="Microsoft-Windows-Security-Auditing" Guid="{54849625-5478-4994-A5BA-3E3B0328C30D}" />
#  <EventID>4674</EventID>
#  <Version>0</Version>
#  <Level>0</Level>
#  <Task>13056</Task>
#  <Opcode>0</Opcode>
#  <Keywords>0x8010000000000000</Keywords>
#  <TimeCreated SystemTime="2015-10-09T00:22:36.237816000Z" />
#  <EventRecordID>1099680</EventRecordID>
#  <Correlation />
#  <Execution ProcessID="496" ThreadID="504" />
#  <Channel>Security</Channel>
#  <Computer>DC01.contoso.local</Computer>
#  <Security />
#  </System>
# - <EventData>
#  <Data Name="SubjectUserSid">S-1-5-19</Data>
#  <Data Name="SubjectUserName">LOCAL SERVICE</Data>
#  <Data Name="SubjectDomainName">NT AUTHORITY</Data>
#  <Data Name="SubjectLogonId">0x3e5</Data>
#  <Data Name="ObjectServer">LSA</Data>
#  <Data Name="ObjectType">-</Data>
#  <Data Name="ObjectName">-</Data>
#  <Data Name="HandleId">0x0</Data>
#  <Data Name="AccessMask">16777216</Data>
#  <Data Name="PrivilegeList">SeSecurityPrivilege</Data>
#  <Data Name="ProcessId">0x1f0</Data>
#   <Data Name="ProcessName">C:\\Windows\\System32\\lsass.exe</Data>
#   </EventData>
#   </Event>
