Generated by GPT-5-mini| SAM (Security Account Manager) | |
|---|---|
| Name | Security Account Manager |
| Developer | Microsoft |
| Released | Windows NT 3.1 |
| Latest release | Windows 10/11 (integrated) |
| Programming language | C, C++ |
| Operating system | Microsoft Windows |
| License | Proprietary |
SAM (Security Account Manager) is the centralized credential and account database used by Microsoft Windows operating systems to store user and group account information, password hashes, and related security identifiers. Originally introduced with Windows NT 3.1, it plays a core role in local authentication, authorization, and identity management across Windows desktops and servers, interacting with components such as the Local Security Authority and the Active Directory ecosystem. SAM underpins many administrative operations and forensic investigations involving account compromise, lateral movement, and privilege escalation.
The SAM service functions as a repository for local account records, storing credentials for Microsoft Windows user and group accounts, and integrating with domain services like Active Directory when present. It interfaces with the Local Security Authority subsystem, the Security Support Provider Interface, and the Winlogon process to support interactive logon, network authentication, and service account validation. Administrators encounter SAM when managing local policies in tools such as Microsoft Management Console snap-ins, while incident responders analyze SAM artifacts alongside logs from the Event Viewer and traces from the Windows Registry.
SAM data is primarily persisted in the Windows Registry hive file located on disk, historically in files such as SAM and SYSTEM within the %SystemRoot%\System32\Config directory. Internally, SAM maps accounts to Security Identifier values and stores attributes including relative identifiers, account names, and password hashes. On domain controllers, SAM concepts are subsumed under Active Directory databases implemented with the Extensible Storage Engine; on stand‑alone hosts the SAM hive operates alongside the Local Security Authority Subsystem Service. Tools that interact with SAM include system utilities like regedit, forensic suites like The Sleuth Kit, and password recovery tools used by administrators or auditors.
Account lifecycle operations—creation, modification, disablement, and deletion—are exposed through APIs provided by NetUserAdd, NetUserSetInfo, and the Local Security Authority RPC interfaces. During interactive logon, Winlogon coordinates with credential providers such as the Kerberos provider and the NTLM provider to validate credentials against SAM-stored hashes or, in domains, against Active Directory KDCs. Service accounts and built‑in accounts (for example, Administrator and Guest) have special treatment in SAM, with predefined relative identifiers and flags that affect password policies and logon rights.
SAM does not store plaintext passwords; instead it stores hashed representations such as NTLM hash and, historically, LAN Manager (LM) hash formats, with LM hashes phased out in modern releases. The operating system protects SAM on disk using system mechanisms tied to the SYSKEY utility in legacy Windows and to DPAPI and volume protections in contemporary releases, while access to the SAM hive requires SYSTEM privileges enforced by Windows Access Control Lists and kernel enforcement. Cryptographic primitives and protocols interacting with SAM include RC4 (in historical contexts), AES for encrypted channels, and authentication protocols like Kerberos and NTLMv2 that rely on SAM-derived secrets.
Access to SAM data requires elevated privileges mediated by kernel‑level security checks and Access Control Lists; typical user accounts cannot directly read the SAM hive. Administrative principals such as members of the Administrators group, or SYSTEM, can extract hashes via authorized tools or via offline analysis by mounting disk images. Group membership and privilege assignments stored in SAM influence authorization decisions enforced by components like the Security Account Manager Service and the Local Security Policy infrastructure. On domain controllers, access control for account data follows Active Directory delegation models and Group Policy processing.
Local SAM hives can be backed up by system state backups, imaging solutions, or snapshot technologies like Volume Shadow Copy Service, enabling restore of account data after corruption or ransomware events. In domain environments, account data is replicated via Active Directory multi‑master replication using the Directory Replication Service and the Knowledge Consistency Checker, with USN‑based change tracking and tombstone semantics for deletions. Disaster recovery procedures reference tools such as ntdsutil and system state restore workflows documented by Microsoft for authoritative and non‑authoritative restores.
Threat actors target SAM to obtain credential material for lateral movement, privilege escalation, and persistence. Notable techniques include offline hash extraction from exposed SAM files, pass‑the‑hash attacks leveraging NTLM artifacts, and credential dumping via utilities demonstrated in red‑team frameworks such as those associated with Mimikatz. Exploits often combine local privilege escalation vulnerabilities, misconfigured access controls, or backup exposures; high‑profile incidents and research from entities like Microsoft Security Response Center and security vendors have documented trimmed‑down LM hash recovery and NTLM downgrade vulnerabilities.
System administrators manage SAM via built‑in tools like Local Users and Groups (lusrmgr.msc), secpol.msc, and scripting through PowerShell cmdlets, while auditors and forensic analysts examine SAM artifacts with suites such as Volatility and disk analysis tools like EnCase. During incident response, analysts correlate SAM data with audit logs from the Windows Event Log, network traces captured by Wireshark, and domain replication metadata to reconstruct account abuse, timeline of changes, and scope of compromise. Best practices adopt least‑privilege administration, credential hygiene such as managed service accounts, and monitoring tied to Security Information and Event Management platforms.
Category:Microsoft Windows security