Table of Contents
- Description
- Commands
- Interesting groups
- Default groups for a default user
- Default groups for a default admin
Description
Windows groups are collections of user accounts with shared permissions and privileges. They simplify management by allowing administrators to assign rights to multiple users at once. Groups exist at both local and domain levels.
Commands
Viewing groups
CMD:
whoami /all - Which this user’s groups and rights
net user <USERNAME> - View groups of an another user
Powershell:
Get-LocalUser | Where-Object { $_.Name -eq $env:USERNAME } | Select-Object -ExpandProperty Groups - View groups of a current user
Get-LocalUser <USERNAME> | Select-Object -ExpandProperty Groups - View groups of an another user
Get-ADUser $env:USERNAME -Properties MemberOf | Select-Object -ExpandProperty MemberOf - View the current user’s groups
Get-ADUser <USERNAME> -Properties MemberOf | Select-Object -ExpandProperty MemberOf - View other user’s groups
PowerView:
Get-NetLocalGroup - PowerView script used to enumerate local groups on a local or remote machine. Performed from a Windows-based host
Get-DomainGroupMember - PowerView script used to return the members of a specific domain group. Performed from a Windows-based host
Get-DomainGroupMember -Identity "Domain Admins" -Recurse - PowerView script used to list all the members of a target group ("Domain Admins") through the use of the recurse option (-Recurse). Performed from a Windows-based host
Get-ADGroup -Identity "Help Desk Level 1" -Properties * \| Select -ExpandProperty Members - PowerView tool used to view the members of a target security group (Help Desk Level 1) from a Windows-based host
Get-DomainGroupMember -Identity "Help Desk Level 1" \| Select MemberName - PowerView tool used to view the members of a specific security group (Help Desk Level 1) and output only the username of each member (Select MemberName) of the group from a Windows-based host
Add-DomainGroupMember -Identity 'Help Desk Level 1' -Members 'damundsen' -Credential $Cred2 -Verbose - PowerView tool used to add a specific user (damundsen) to a specific security group (Help Desk Level 1) in a target Windows domain from a Windows-based host
Interesting groups
AD contains many default or built-in security groups, some of which grant their members powerful rights and privileges which can be abused to escalate privileges within a domain and ultimately gain Domain Admin or SYSTEM privileges on a Domain Controller (DC). Membership in many of these groups should be tightly managed as excessive group membership/privileges is a common flaw in many AD networks that attackers look to abuse. Some of the most common built-in groups are listed below:
Often used:
Default Administrators - Domain Admins and Enterprise Admins are “super” groups with high-level privileges across the domain.
Server Operators - Members can modify services, access SMB shares, and back up files on domain controllers.
Backup Operators - Members can log onto DCs, back up files, make shadow copies of the SAM/NTDS database, read the registry remotely, and access the file system via SMB. This group may also be added to non-DCs.
Print Operators - Members can log onto DCs and potentially load malicious drivers, which can be used for privilege escalation or system disruption.
Hyper-V Administrators - If virtual DCs exist, members should be considered Domain Admins due to control over virtualized environments.
Account Operators - Members can modify non-protected accounts and groups in the domain.
Remote Desktop Users - Members have minimal default permissions but can be granted “Allow Login Through Remote Desktop Services,” allowing lateral movement via RDP.
Remote Management Users - Members can log onto DCs using PSRemoting and may be extended to non-DCs. This usually allows the member to connect via WinRM.
Group Policy Creator Owners - Members can create new GPOs but need additional permissions to link them to domains or OUs.
Schema Admins - Members can modify the Active Directory schema and backdoor new GPOs by adding compromised accounts to the object ACL.
DNS Admins - Members can load a DLL on a DC but cannot restart the DNS server. They can exploit this by creating a WPAD record or using DLL loading for persistence.
Less often used:
Domain Computers - Contains all non-DC computers in the domain.
Domain Controllers - Contains all DCs within the domain.
Domain Guests - Includes domain guest accounts with limited access.
Domain Users - All user accounts within the domain.
Enterprise Admins - Full forest-wide control, can create child domains.
Event Log Readers - Read access to event logs on local computers.
IIS_IUSRS - Used by Internet Information Services (IIS).
Pre-Windows 2000 Compatible Access - Legacy compatibility group with potential security risks.
Protected Users - Enhanced protection against credential theft.
Read-only Domain Controllers - Contains all Read-only DCs in the domain.
Default groups for a default user
For a local user on a standalone Windows machine:
Users- Standard group with limited permissions.Authenticated Users- Represents all logged-in users.
For a domain user on a domain-joined machine:
Domain Users- All user accounts in the domain.Users- Standard local group on the machine.Authenticated Users- All logged-in users across the domain.Everyone- Represents all users accessing the system.
Default groups for a default admin
For a local administrator on a standalone Windows machine:
Administrators– Full control over the system.Users– Basic permissions for compatibility.Authenticated Users– All logged-in users.Everyone– Anyone accessing the system.
For a domain administrator on a domain-joined machine:
Domain Admins– Full control over the domain.Administrators– Full control over the local machine.Users– Basic local permissions.Authenticated Users– All logged-in users.Everyone– Anyone accessing the system.