Skip to content

SID, RID and Windows Identity: The Foundational Mental Model

A Security Identifier (SID) is a variable-length binary data structure utilized by Windows to definitively identify security principals:

  • Users (human operators and service accounts).
  • Security Groups (local, domain global, domain local, universal).
  • Computers (COMPUTER$ domain machine accounts).
  • Built-in contexts and special authorities (Well-Known SIDs).

The Relative Identifier (RID) is the terminal numerical sub-authority segment of the SID. It is assigned sequentially by the issuing authority (either the local host SAM or the Active Directory RID Master FSMO role holder).


For digital forensics and incident response analysts, SID fluency is essential to avoid catastrophic misattributions:

  1. Account Recreation Traps: An adversary creates svc_temp, performs actions, and deletes it. A system administrator later legitimately creates an account with the same name. Log records contain the original SID (e.g., RID 1142), definitively proving the current account (RID 1185) did not author the historic malicious activity.
  2. Offline Disk Triage: When analyzing disk images without live Domain Controller connectivity, Windows cannot resolve SIDs to text strings. Analysts must decompose raw SIDs to determine privileges.
  3. Persistence via sIDHistory: Threat actors using Mimikatz can inject high-privileged SIDs (such as Domain Admins RID 512) into the sIDHistory attribute of a standard user. The account appears unprivileged in LDAP inspection, yet its logon access token contains administrative authority (see Doc 18: Cross-Domain Group Membership and Foreign Security Principals).

Consider the following SID string: S-1-5-21-3623811015-3361044348-30300820-1013

S - 1 - 5 - 21 - 3623811015 - 3361044348 - 30300820 - 1013
β”‚ β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ └── RID (Relative Identifier)
β”‚ β”‚ β”‚ β”‚ Domain Identifier (Sub-Authority)
β”‚ β”‚ β”‚ └── Non-unique Sub-Authority specifier (NT Authority)
β”‚ β”‚ └────── Top-Level Authority (5 = SECURITY_NT_AUTHORITY)
β”‚ └────────── Revision Level (always 1 in current Windows)
└────────────── String Literal Prefix
  • S: Standard string prefix identifying a SID.
  • 1: Specification revision level.
  • 5: Security Authority (SECURITY_NT_AUTHORITY).
  • 21: Specifies that the subsequent authority identifies an Active Directory domain or local host SAM.
  • 3623811015-3361044348-30300820: The Domain SID. A 96-bit random integer set assigned during OS setup or AD domain promotion. Every account belonging to this authority shares this identical prefix.
  • 1013: The RID. Monotonically increasing identifier uniquely indexing the object within this domain or SAM.

Certain RIDs and SIDs are universal across every Windows machine and Active Directory installation:

SID / RIDRepresentationAuthority & Scope
RID 500Built-in Administrator...-500 exists on every SAM host and AD domain.
RID 501Built-in GuestDisabled by default.
RID 502krbtgt Service AccountKey distribution center service account in Active Directory.
RID 512Domain AdminsDomain-wide administrative group.
RID 513Domain UsersStandard domain user baseline group.
RID 516Domain ControllersComputer accounts of all DCs in the domain.
RID 519Enterprise AdminsForest-root administrative group.
S-1-5-18NT AUTHORITY\SYSTEMOperating system kernel identity (LocalSystem).
S-1-5-19NT AUTHORITY\LOCAL SERVICERestricted local service context.
S-1-5-20NT AUTHORITY\NETWORK SERVICELocal service presenting host machine identity (COMPUTER$) on the network.
S-1-5-32-544BUILTIN\AdministratorsLocal machine administrative group present on every Windows OS.

  • Renaming Without Altering Identity: Renaming Administrator to Guest_Support does not alter its RID 500. It retains full administrative powers.
  • Determining Authority by Inspection: Comparing the 3 sub-authority blocks immediately demonstrates whether two log entries share the same domain authority or belong to separate SAMs.
  • Tracking Orphaned ACLs: When an NTFS permission displays S-1-5-21-...-1045 rather than a name, it proves the principal was deleted from the directory or originates from an unreachable foreign domain.

  • Inheriting Permissions via Recreation: Deleting CORP\alice (RID 1105) and recreating CORP\alice yields RID 1106. The new object inherits none of the direct ACL permissions granted to RID 1105.
  • Duplicate RIDs Within a Single Authority: The RID Master guarantees strict monotonicity and uniqueness within the issuing domain.
  • Unprivileged SID Forgery: Standard users cannot modify or forge SIDs inside an active logon token; this requires kernel-level or LocalSystem privileges (SeTcbPrivilege).


In a forest with two domains (CHILD.CORP and ROOT.CORP), an adversary compromises CHILD.CORP and seeks persistent, undetected control over ROOT.CORP:

  1. The attacker selects standard user CHILD\jdoe (SID: S-1-5-21-222-333-444-1102).
  2. Using Mimikatz (misc::addsid), the attacker writes the SID of ROOT.CORP’s Domain Admins group (S-1-5-21-999-888-777-512) into jdoe’s sIDHistory attribute.
  3. When jdoe authenticates, the KDC includes both the primary SID and all sIDHistory SIDs in the Kerberos authorization data (PAC).
  4. When accessing services in ROOT.CORP, the target host inspects the token, locates S-1-5-21-999-888-777-512, and grants complete administrative control, despite ADUC showing jdoe as a standard user.

This mechanism is analyzed further in Doc 18: Cross-Domain Group Membership and Foreign Security Principals and Doc 24: Lateral Movement Across Active Directory Domains.


EventID: 4720 # User Account Created
TargetUserName: attacker_backup
TargetSid: S-1-5-21-3623811015-3361044348-30300820-1185 <-- Note assigned RID
SubjectUserSid: S-1-5-21-3623811015-3361044348-30300820-500
EventID: 4765 # SID History Added (Critical Alert)
TargetUserName: jdoe
TargetSid: S-1-5-21-222-333-444-1102
SidHistoryValue: S-1-5-21-999-888-777-512 <-- Domain Admins injected

  1. Detect Accounts with sIDHistory via PowerShell:
    Terminal window
    Get-ADUser -Filter 'sidhistory -like "*"' -Properties sidhistory |
    Select-Object Name, SID, @{Name="sIDHistory";Expression={$_.sidhistory}}
  2. Translate SID to Account Offline / Scripting:
    Terminal window
    $objSID = New-Object System.Security.Principal.SecurityIdentifier("S-1-5-21-3623811015-3361044348-30300820-500")
    $objUser = $objSID.Translate([System.Security.Principal.NTAccount])
    $objUser.Value

  1. The SID is the only identity validated by the Windows security engine.
  2. The RID distinguishes unique objects within the same issuing domain or SAM.
  3. RID 500 is permanently the built-in Administrator, regardless of language or renamed strings.
  4. Deleting and recreating a user creates an entirely new SID and invalidates prior ACL rights.
  5. sIDHistory allows an account to carry authorizations across domains.