Security Identifier (SID) is a unique value assigned to each entity - or a principal - that can be authenticated by Windows, such as users and groups. The SID for local accounts and groups is generated by the Local Security Authority (LSA), and for domain users and domain groups, it’s generated on a Domain Controller (DC). The SID can’t be changed, is generated when the user or group is created and cannot be reused after account has been deleted.
Windows uses only the SID - not usernames - to identify principals for access control management.
The SID string consists of different parts, delimited by ”-”, and represented by the placeholders “S”, “R”, “X”, and “Y”. This representation is the fundamental structure of a SID.
S-R-X-Y
- The first part is a literal “S”, which indicates that the string is a SID.
- “R” stands for revision and is always set to “1”, since the overall SID structure continues to be on its initial version.
- “X” determines the identifier authority. This is the authority that issues the SID. For example, “5” is the most common value for the identifier authority. It specifies NT Authority and is used for local or domain users and groups.
- “Y” represents the sub authorities of the identifier authority. Every SID consists of one or more sub authorities. This part consists of the domain identifier and relative identifier (RID). The domain identifier is the SID of the domain for domain users, the SID of the local machine for local users, and “32” for built-in principals. The RID determines principals such as users or groups.
The RID starts at 1000 for nearly all principals.
There are SIDs that have a RID under 1000, which are called well-known SIDs. These SIDs identify generic and built-in groups and users instead of specific groups and users.
S-1-0-0 Nobody
S-1-1-0 Everybody
S-1-5-11 Authenticated Users
S-1-5-18 Local System
S-1-5-domainidentifier-500 Administrator