Introduction
The Win32 Security model provides a robust framework for protecting resources, authenticating users, and enforcing access control on Windows operating systems.
Core Concepts
- Access Tokens – Represent the security context of a process or thread.
- Security Descriptors – Define who can access an object and what actions are allowed.
- Privileges – Specific rights granted to accounts, such as
SeShutdownPrivilege. - AUDIT – Tracks successful and failed security events.
Key APIs
Authentication Functions
LogonUser– Authenticates a user and returns a token.ImpersonateLoggedOnUser– Allows a thread to run under a different security context.CredRead / CredWrite– Access the Windows Credential Manager.
Access Control Functions
GetSecurityInfo– Retrieves a security descriptor for an object.SetSecurityInfo– Modifies the security descriptor.AccessCheck– Determines if a token has the requested access.
Interactive Demo
Enter a username to simulate token creation (demo only, no real authentication):