4. Privileges in Windows

https://docs.microsoft.com/en-us/windows/win32/secauthz/privileges Rights an account can be granted to perform variety of operations on local system like

Privileges are not equal to access rights, which system uses to grant/deny access to securable objects. User/group privs stored in database + granted via an access token when user logs into a system.

Account can have local privs on a specific computer and different privs on different systems if account belongs to AD Domain. Each time user attempts privileged actions, system reviews user's access token to see if account has required privileges - if so, checks to see if they are enabled.

Windows authorization process Security Principals are anything that can be authenticated by the windows OS - Including users and computer accounts, processes that run in the security context of another user/computer, or security groups these accounts belong to. Security principals are primary way of controlling access to resources on windows hosts

Every single security principal is identified by a unique SID (Security Identifier) When security principal is created, it is assigned a SID which remains assigned to that principal for its' lifetime.

![](/img/Pasted image 20250211152139.png)

Above highlevel diagram shows win authorization and access control process at a high level - showing for example, the process started when a user attempts to access a securable object such as a folder on a file share.

User access token (Including the User SID, SIDs for any groups they are members of, priv list, and other access information) -> compared against Access Control Entries (ACES) within the object's Security Descriptor (which contains security information about a securable object such as access rights granted to users or groups)

Rights and Privileges in Windows

Group Description
Default Administrators Domain Admins and Enterprise Admins are "super" groups.
Server Operators Members can modify services, access SMB shares, and backup files.
Backup Operators Members are allowed to log onto DCs locally and should be considered Domain Admins. They can make shadow copies of the SAM/NTDS database, read the registry remotely, and access the file system on the DC via SMB. This group is sometimes added to the local Backup Operators group on non-DCs.
Print Operators Members can log on to DCs locally and "trick" Windows into loading a malicious driver.
Hyper-V Administrators If there are virtual DCs, any virtualization admins, such as members of Hyper-V Administrators, should be considered Domain Admins.
Account Operators Members can modify non-protected accounts and groups in the domain.
Remote Desktop Users Members are not given any useful permissions by default but are often granted additional rights such as Allow Login Through Remote Desktop Services and can move laterally using the RDP protocol.
Remote Management Users Members can log on to DCs with PSRemoting (This group is sometimes added to the local remote management group on non-DCs).
Group Policy Creator Owners Members can create new GPOs but would need to be delegated additional permissions to link GPOs to a container such as a domain or OU.
Schema Admins Members can modify the Active Directory schema structure and backdoor any to-be-created Group/GPO by adding a compromised account to the default object ACL.
DNS Admins Members can load a DLL on a DC, but do not have the necessary permissions to restart the DNS server. They can load a malicious DLL and wait for a reboot as a persistence mechanism. Loading a DLL will often result in the service crashing. A more reliable way to exploit this group is to create a WPAD record.

User Rights Assignment Based on group membership and other factors such as priv assigned via domain / local Group Policy - users have various rights assigned to their account. https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/user-rights-assignment Above is detailed explanation of each of the user rights that can be set in Windows as well as security considerations applicable to each right Below are some key user rights assignments, which are settings applied to the localhost. These rights allow users to perform tasks on the system such as logon locally/remotely, access host from network, shutdown etc

Setting Constant Setting Name Standard Assignment Description
SeNetworkLogonRight Access this computer from the network Administrators, Authenticated Users Determines which users can connect to the device from the network. This is required by network protocols such as SMB, NetBIOS, CIFS, and COM+.
SeRemoteInteractiveLogonRight Allow log on through Remote Desktop Services Administrators, Remote Desktop Users This policy setting determines which users or groups can access the login screen of a remote device through a Remote Desktop Services connection. A user can establish a Remote Desktop Services connection to a particular server but not be able to log on to the console of that same server.
SeBackupPrivilege Back up files and directories Administrators This user right determines which users can bypass file and directory, registry, and other persistent object permissions for the purposes of backing up the system.
SeSecurityPrivilege Manage auditing and security log Administrators This policy setting determines which users can specify object access audit options for individual resources such as files, Active Directory objects, and registry keys. These objects specify their system access control lists (SACL). A user assigned this user right can also view and clear the Security log in Event Viewer.
SeTakeOwnershipPrivilege Take ownership of files or other objects Administrators This policy setting determines which users can take ownership of any securable object in the device, including Active Directory objects, NTFS files and folders, printers, registry keys, services, processes, and threads.
SeDebugPrivilege Debug programs Administrators This policy setting determines which users can attach to or open any process, even a process they do not own. Developers who are debugging their applications do not need this user right. Developers who are debugging new system components need this user right. This user right provides access to sensitive and critical operating system components.
SeImpersonatePrivilege Impersonate a client after authentication Administrators, Local Service, Network Service, Service This policy setting determines which programs are allowed to impersonate a user or another specified account and act on behalf of the user.
SeLoadDriverPrivilege Load and unload device drivers Administrators This policy setting determines which users can dynamically load and unload device drivers. This user right is not required if a signed driver for the new hardware already exists in the driver.cab file on the device. Device drivers run as highly privileged code.
SeRestorePrivilege Restore files and directories Administrators This security setting determines which users can bypass file, directory, registry, and other persistent object permissions when they restore backed up files and directories. It determines which users can set valid security principals as the owner of an object.

Further information can be found here.

whoami /priv will give a listing of all user rights assigned to your current user. Some rights are only available to administrative users and can only be listed/leveraged when running an elevated cmd/ps session.. Concepts of elevated rights and UAC are security features introduced in Vista to default to restricting applications from running with full perms unless necessary.

When running whoami /priv in an elevated prompt the disabled flag means we have the privilege assigned but it cannot be used in an access token until it is enabled. There's no easy built-in or cmdlet to enable. There's various ways to do this Powershell example: https://www.powershellgallery.com/packages/PoshPrivilege/0.3.0.0/Content/Scripts%5CEnable-Privilege.ps1

Detection https://blog.palantir.com/windows-privilege-abuse-auditing-detection-and-defense-3078a403d74e

Above is good article about detecting/preventing abuse, specifically logging: https://docs.microsoft.com/en-us/windows/security/threat-protection/auditing/event-4672 4672: Special privileges assigned to new logon