What Is A Windows Security Identifier (SID)?


Intro

A security identifier (SID) is a unique value of variable length that is used to identify a security principal (such as a security group) in Windows operating systems. SIDs that identify generic users or generic groups is particularly well-known. Their values remain constant across all operating systems.


Documentation

 


Tips and Tidbits

  • Security identifiers

  • A security identifier (SID) is used to uniquely identify a security principal or security group.

  • Security principals can represent any entity that can be authenticated by the operating system, such as a user account, a computer account, or a thread or process that runs in the security context of a user or computer account.

  • The SID for a local account or group is generated by the Local Security Authority (LSA) on the computer, and it is stored with other account information in a secure area of the registry.

  • The SID for a domain account or group is generated by the domain security authority, and it is stored as an attribute of the User or Group object in Active Directory Domain Services.

  • For every local account and group, the SID is unique for the computer where it was created.

    • No two accounts or groups on the computer ever share the same SID.

  • Likewise, for every domain account and group, the SID is unique within an enterprise.

  • This means that the SID for an account or group that is created in one domain will never match the SID for an account or group created in any other domain in the enterprise.

  • SIDs always remain unique.

  • Security authorities never issue the same SID twice, and they never reuse SIDs for deleted accounts.

  • SIDs of Active Directory objects are stored in the ntds.dit database, and SIDs of local users and groups in the local Windows Security Account Manager (SAM) database in the HKEY_LOCAL_MACHINE\SAM\SAM registry key.

 


Well-Known SID Structures

For example, given a SID defined in the table below as S-1-5-21-<domain>-513, and the actual instance of the domain having the three sub authority values of 1, 2, and 3:

S-1: Indicates a revision or version 1 SID.

5: SECURITY_NT_AUTHORITY, indicates it's a Windows specific SID.

21: SECURITY_NT_NON_UNIQUE, indicates a domain id (or local computer identifer) will follow.

1-2-3: The next three SubAuthority arrays contain 32-bit random numbers to uniquely identify the domain.

RID: Indicates a unique object ID within the domain.

The actual constructed SID would be S-1-5-21-1-2-3-513.


Well-known SIDs (all versions of Windows)

All versions of Windows use the following well-known SIDs.

SID

Name

Description

S-1-0

Null Authority

An identifier authority.

S-1-0-0

Nobody

No security principal.

S-1-1

World Authority

An identifier authority.

S-1-1-0

Everyone

A group that includes all users, even anonymous users and guests. Membership is controlled by the operating system.

Note
By default, the Everyone group no longer includes anonymous users on a computer that is running Windows XP Service Pack 2 (SP2).

S-1-2

Local Authority

An identifier authority.

S-1-2-0

Local

A group that includes all users who have logged on locally.

S-1-3

Creator Authority

An identifier authority.

S-1-3-0

Creator Owner

A placeholder in an inheritable access control entry (ACE). When the ACE is inherited, the system replaces this SID with the SID for the object's creator.

S-1-3-1

Creator Group

A placeholder in an inheritable ACE. When the ACE is inherited, the system replaces this SID with the SID for the primary group of the object's creator. The primary group is used only by the POSIX subsystem.

S-1-3-4

Owner Rights

A group that represents the current owner of the object. When an ACE that carries this SID is applied to an object, the system ignores the implicit READ_CONTROL and WRITE_DAC permissions for the object owner.

S-1-4

Non-unique Authority

An identifier authority.

S-1-5

NT Authority

An identifier authority.

S-1-5-1

Dialup

A group that includes all users who have logged on through a dial-up connection. Membership is controlled by the operating system.

S-1-5-2

Network

A group that includes all users that have logged on through a network connection. Membership is controlled by the operating system.

S-1-5-3

Batch

A group that includes all users that have logged on through a batch queue facility. Membership is controlled by the operating system.

S-1-5-4

Interactive

A group that includes all users that have logged on interactively. Membership is controlled by the operating system.

S-1-5-5-X-Y

Logon Session

A logon session. The X and Y values for these SIDs are different for each session.

S-1-5-6

Service

A group that includes all security principals that have logged on as a service. Membership is controlled by the operating system.

S-1-5-7

Anonymous

A group that includes all users that have logged on anonymously. Membership is controlled by the operating system.

S-1-5-9

Enterprise Domain Controllers

A group that includes all domain controllers in a forest that uses an Active Directory directory service. Membership is controlled by the operating system.

S-1-5-10

Principal Self

A placeholder in an inheritable ACE on an account object or group object in Active Directory. When the ACE is inherited, the system replaces this SID with the SID for the security principal who holds the account.

S-1-5-11

Authenticated Users

A group that includes all users whose identities were authenticated when they logged on. Membership is controlled by the operating system.

S-1-5-12

Restricted Code

This SID is reserved for future use.

S-1-5-13

Terminal Server Users

A group that includes all users that have logged on to a Terminal Services server. Membership is controlled by the operating system.

S-1-5-14

Remote Interactive Logon

A group that includes all users who have logged on through a terminal services logon.

S-1-5-17

This Organization

An account that is used by the default Internet Information Services (IIS) user.

S-1-5-18

Local System

A service account that is used by the operating system.

S-1-5-19

NT Authority

Local Service

S-1-5-20

NT Authority

Network Service

S-1-5-21-domain-500

Administrator

A user account for the system administrator. By default, it is the only user account that is given full control over the system.

S-1-5-21-domain-501

Guest

A user account for people who do not have individual accounts. This user account does not require a password. By default, the Guest account is disabled.

S-1-5-21-domain-502

KRBTGT

A service account that is used by the Key Distribution Center (KDC) service.

S-1-5-21-domain-512

Domain Admins

A global group whose members are authorized to administer the domain. By default, the Domain Admins group is a member of the Administrators group on all computers that have joined a domain, including the domain controllers. Domain Admins is the default owner of any object that is created by any member of the group.

S-1-5-21-domain-513

Domain Users

A global group that, by default, includes all user accounts in a domain. When you create a user account in a domain, it is added to this group by default.

S-1-5-21-domain-514

Domain Guests

A global group that, by default, has only one member, the domain's built-in Guest account.

S-1-5-21-domain-515

Domain Computers

A global group that includes all clients and servers that have joined the domain.

S-1-5-21-domain-516

Domain Controllers

A global group that includes all domain controllers in the domain. New domain controllers are added to this group by default.

S-1-5-21-domain-517

Cert Publishers

A global group that includes all computers that are running an enterprise certification authority. Cert Publishers are authorized to publish certificates for User objects in Active Directory.

S-1-5-21-root domain-518

Schema Admins

A universal group in a native-mode domain; a global group in a mixed-mode domain. The group is authorized to make schema changes in Active Directory. By default, the only member of the group is the Administrator account for the forest root domain.

S-1-5-21-root domain-519

Enterprise Admins

A universal group in a native-mode domain; a global group in a mixed-mode domain. The group is authorized to make forest-wide changes in Active Directory, such as adding child domains. By default, the only member of the group is the Administrator account for the forest root domain.

S-1-5-21-domain-520

Group Policy Creator Owners

A global group that is authorized to create new Group Policy objects in Active Directory. By default, the only member of the group is Administrator.

S-1-5-21-domain-526

Key Admins

A security group. The intention for this group is to have delegated write access on the msdsKeyCredentialLink attribute only. The group is intended for use in scenarios where trusted external authorities (for example, Active Directory Federated Services) are responsible for modifying this attribute. Only trusted administrators should be made a member of this group.

S-1-5-21-domain-527

Enterprise Key Admins

A security group. The intention for this group is to have delegated write access on the msdsKeyCredentialLink attribute only. The group is intended for use in scenarios where trusted external authorities (for example, Active Directory Federated Services) are responsible for modifying this attribute. Only trusted administrators should be made a member of this group.

S-1-5-21-domain-553

RAS and IAS Servers

A domain local group. By default, this group has no members. Servers in this group have Read Account Restrictions and Read Logon Information access to User objects in the Active Directory domain local group.

S-1-5-32-544

Administrators

A built-in group. After the initial installation of the operating system, the only member of the group is the Administrator account. When a computer joins a domain, the Domain Admins group is added to the Administrators group. When a server becomes a domain controller, the Enterprise Admins group also is added to the Administrators group.

S-1-5-32-545

Users

A built-in group. After the initial installation of the operating system, the only member is the Authenticated Users group. When a computer joins a domain, the Domain Users group is added to the Users group on the computer.

S-1-5-32-546

Guests

A built-in group. By default, the only member is the Guest account. The Guests group allows occasional or one-time users to log on with limited privileges to a computer's built-in Guest account.

S-1-5-32-547

Power Users

A built-in group. By default, the group has no members. Power users can create local users and groups; modify and delete accounts that they have created; and remove users from the Power Users, Users, and Guests groups. Power users also can install programs; create, manage, and delete local printers; and create and delete file shares.

S-1-5-32-548

Account Operators

A built-in group that exists only on domain controllers. By default, the group has no members. By default, Account Operators have permission to create, modify, and delete accounts for users, groups, and computers in all containers and organizational units of Active Directory except the Builtin container and the Domain Controllers OU. Account Operators do not have permission to modify the Administrators and Domain Admins groups, nor do they have permission to modify the accounts for members of those groups.

S-1-5-32-549

Server Operators

A built-in group that exists only on domain controllers. By default, the group has no members. Server Operators can log on to a server interactively; create and delete network shares; start and stop services; back up and restore files; format the hard disk of the computer; and shut down the computer.

S-1-5-32-550

Print Operators

A built-in group that exists only on domain controllers. By default, the only member is the Domain Users group. Print Operators can manage printers and document queues.

S-1-5-32-551

Backup Operators

A built-in group. By default, the group has no members. Backup Operators can back up and restore all files on a computer, regardless of the permissions that protect those files. Backup Operators also can log on to the computer and shut it down.

S-1-5-32-552

Replicators

A built-in group that is used by the File Replication service on domain controllers. By default, the group has no members. Do not add users to this group.

S-1-5-32-582

Storage Replica Administrators

A built-in group that grants complete and unrestricted access to all features of Storage Replica.

S-1-5-64-10

NTLM Authentication

An SID that is used when the NTLM authentication package authenticated the client.

S-1-5-64-14

SChannel Authentication

An SID that is used when the SChannel authentication package authenticated the client.

S-1-5-64-21

Digest Authentication

An SID that is used when the Digest authentication package authenticated the client.

S-1-5-80

NT Service

An NT Service account prefix.

 


How To Get My User’s SID

 

wmic useraccount get name,sid Name SID Administrator S-1-5-21-65601276-2964384289-692651738-500 DefaultAccount S-1-5-21-65601276-2964384289-692651738-503 Guest S-1-5-21-65601276-2964384289-692651738-501 Roger S-1-5-21-65601276-2964384289-692651738-1001 WDAGUtilityAccount S-1-5-21-65601276-2964384289-692651738-504

 


Getting The Local Machine’s SID

 

The SID of the local computer (Machine SID) can be obtained using the PsGetSID tool (https://docs.microsoft.com/en-us/sysinternals/downloads/psgetsid ). But you have to download and install the tool on each computer manually.

.\PsGetsid64.exe

Or simply by trimming the last 4 characters (RID) from the SID of any local user:

$user=(Get-LocalUser Administrator).sid
$user -replace ".{4}$"



cd C:\Users\Roger\Downloads\PSTools PS C:\Users\Roger\Downloads\PSTools> .\PsGetsid64.exe PsGetSid v1.45 - Translates SIDs to names and vice versa Copyright (C) 1999-2016 Mark Russinovich Sysinternals - www.sysinternals.com SID for \\GOLDEN-IMAGE: S-1-5-21-65601276-2964384289-692651738 PS C:\Users\Roger\Downloads\PSTools> $user=(Get-LocalUser Administrator).sid >> $user -replace ".{4}$" S-1-5-21-65601276-2964384289-692651738 PS C:\Users\Roger\Downloads\PSTools> (Get-LocalUser Administrator).sid | ft AccountDomainSid, Value AccountDomainSid Value ---------------- ----- S-1-5-21-65601276-2964384289-692651738 S-1-5-21-65601276-2964384289-692651738-500

 

It is important that each computer in the domain has a unique local (machine) SID. If you are cloning computers or virtual machines or creating them from a template, you must run the sysprep utility before joining them to the domain. This tool resets the local Machine SID. This will save you from common trust relationship errors.

 


Get The Domain SID

If a Windows computer is joined to an Active Directory domain, it will have two different SIDs. The first SID is the local computer identifier (Machine SID), and the second is the unique computer object identifier in AD.

You can get the SID of a computer in the Active Directory domain using the command:

Get-ADComputer <computer name> -properties sid|select name,sid

© Roger Cruz - All rights reserved