Skip to content
WETNav

Investigation · Credentials

Who was added to privileged groups, and by whom?

Track additions and removals in privileged groups, the account lifecycle around them, and the session behind each change, to catch escalation and backdoors.

When you would ask thisYou need to know whether the attacker granted themselves or an account elevated rights, who made the change, and from where.

Steps

  1. 1

    Pull the group membership changes

    Three events cover additions by group scope: 4728 for a security-enabled global group, 4732 for a local group and 4756 for a universal group. Each records MemberName and MemberSid (who was added), TargetUserName (the group), and SubjectUserName with SubjectLogonId (who made the change). Pull all three and sort by time. An addition to Domain Admins, Enterprise Admins, Administrators or another sensitive group outside a change window, or by an account that is not an administrator, is the finding to escalate.

    All privileged-group additions with actor (collected .evtx)
    Get-WinEvent -Path .\Security.evtx `
      -FilterXPath "*[System[EventID=4728 or EventID=4732 or EventID=4756]]" |
      ForEach-Object { $x = [xml]$_.ToXml(); [pscustomobject]@{
        Time   = $_.TimeCreated
        Group  = ($x.Event.EventData.Data | Where-Object Name -eq 'TargetUserName').'#text'
        Member = ($x.Event.EventData.Data | Where-Object Name -eq 'MemberName').'#text'
        By     = ($x.Event.EventData.Data | Where-Object Name -eq 'SubjectUserName').'#text' } }
  2. 2

    Check for add-then-remove and group creation

    Attackers often add an account to a privileged group, use it, then remove it to cover the tracks, leaving elevated access only briefly. Pull the removal events 4729 (global), 4733 (local) and 4757 (universal) and line them up against the additions by MemberSid: a short-lived membership that spans exactly the attacker's active window is deliberate. Also check 4727, 4731 and 4754 for newly created groups, which can be used to grant rights through a group that did not exist before the incident.

  3. 3

    Correlate the account lifecycle

    A group change is often paired with account manipulation. Event 4720 is a new account, 4722 its enabling, 4724 an administrative password reset, 4738 a change to the account, 4725 disabling, 4726 deletion and 4781 a rename. A sequence of create (4720), enable (4722) and add-to-group (4728) in quick succession is a backdoor account being stood up. A 4724 password reset on an existing privileged account is an account takeover rather than a new foothold.

  4. 4

    Identify the session behind the change

    Resolve who really made the change and from where. Take SubjectLogonId from the group-change event and join it to the 4624 that opened that session to recover the source IpAddress, LogonType and workstation; a 4672 for the same logon confirms it held administrative privilege. This converts an account name into an origin: an unexpected source host or a network (Type 3) logon behind a Domain Admins change points to the lateral path the attacker used to make it.

  5. 5

    Flag the highest-value targets and AdminSDHolder

    Not all privileged groups are equal. Prioritize changes to Domain Admins, Enterprise Admins, Schema Admins, Administrators, Backup Operators, Account Operators and Protected Users, because membership there is effectively domain control or audit evasion. Also watch event 4780, which fires when the ACL is set on accounts that are members of administrative groups (the AdminSDHolder process); unexpected 4780 activity can indicate manipulation of the protection mechanism that keeps privileged accounts locked down.

Where it goes wrong

  • For 4732 (local group) the MemberName is frequently an unresolved SID rather than a name, so resolve the SID before concluding who was added.
  • Changes to domain groups are logged on the domain controller that processed them, not on member servers, and replicate from the originating DC, so collect from the right DC.
  • 4756 (universal group) is recorded on a global-catalog-capable DC; a workstation or member-server log will never show it.
  • Nested group membership means an account can gain effective privileged rights without a direct 4728 to the sensitive group, so trace nested adds, not just direct ones.
  • SID history abuse grants privilege without any group-addition event, so a clean 4728 history does not rule out elevated access.
  • These events show the change, not the current state; always confirm the live membership in AD, because a later legitimate removal can hide an addition that has already rolled out of the log.

Beyond event logs

Current group membership in AD

Active Directory (Get-ADGroupMember) and the ntds.dit database

The authoritative present-day membership. Compare it against the change events to spot members that were added without a corresponding logged addition, which suggests the event was cleared or the change predates retention.

AD replication metadata

repadmin /showobjmeta on the group object

Shows the per-attribute version and originating DC and time for membership changes, which can recover when and where a change was made even if the Security event has rolled.

SYSVOL and GPO changes

\\<domain>\SYSVOL and the Group Policy objects

Privilege can also be granted through Restricted Groups or GPO-delivered local admin membership; check GPO modification times alongside the direct group events.

References