Overview
Eighteen is an Easy Windows box running a Windows Server 2025 domain controller with MSSQL, IIS, and WinRM exposed. The attack chain starts with given MSSQL credentials for kevin, who can impersonate the appdev login to access the financial_planner database containing a PBKDF2-hashed admin password. After cracking the hash, RID brute-forcing via MSSQL reveals domain users, and password spraying finds that adam.scott reuses the cracked password for WinRM access. Privilege escalation exploits BadSuccessor (CVE-2025-53779), a dMSA abuse vulnerability in Windows Server 2025, to impersonate the domain Administrator and extract their NTLM hash via secretsdump.
Key Attack Chain:
- MSSQL login as
kevin, impersonateappdevviaEXECUTE AS LOGIN - Dump
financial_planner.userstable to get admin’s PBKDF2 hash - Crack PBKDF2 hash (hashcat mode 10900) to recover
iloveyou1 - RID brute force via MSSQL to enumerate domain users
- Password spray
iloveyou1against all users –adam.scottworks for WinRM - BadSuccessor: create dMSA targeting Administrator, extract NTLM hash via Kerberos delegation
- Pass-the-hash as Administrator for root flag
Enumeration
Nmap Scan
|
|
PORT STATE SERVICE VERSION
80/tcp open http Microsoft IIS httpd 10.0
1433/tcp open ms-sql-s Microsoft SQL Server 2022 16.00.1000.00; RTM
5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
- Domain:
eighteen.htb/DC01.eighteen.htb - OS: Windows Server 2025 Datacenter (Build 26100)
- Clock skew: +7 hours (important for Kerberos)
Port 80 serves a financial planning web app with registration and login. The web app itself is not directly exploitable.
Foothold
MSSQL Enumeration
Connect to MSSQL with the given credentials kevin:iNa2we6haRj2gaw!:
|
|
Kevin has guest-level access. Check for impersonation privileges:
|
|
Kevin can impersonate appdev:
|
|
id full_name username email password_hash is_admin
1002 admin admin admin@eighteen.htb pbkdf2:sha256:600000$AMtzteQIG7yAbZIa$0673ad90a0b4afb19d662336f0fce3a9edd0b7b... 1
Cracking the PBKDF2 Hash
Convert the Werkzeug PBKDF2 hash to hashcat format:
|
|
|
|
sha256:600000:QU10enRlUUlHN3lBYlpJYQ==:BnOtkKC0r7GdZiM28Pzjqe3Qt7GRk3F74ozk1myIcTM=:iloveyou1
RID Brute Force
Enumerate domain users via MSSQL RID brute force:
|
|
Key users discovered:
jamie.dunn(1606),jane.smith(1607),alice.jones(1608)adam.scott(1609),bob.brown(1610),carol.white(1611),dave.green(1612)
Password Spray for WinRM
|
|
WINRM 10.129.5.252 5985 DC01 [+] eighteen.htb\adam.scott:iloveyou1 (Pwn3d!)
User Flag
|
|
Privilege Escalation
BadSuccessor (CVE-2025-53779)
The DC runs Windows Server 2025, which introduced Delegated Managed Service Accounts (dMSA). BadSuccessor abuses the msDS-ManagedAccountPrecededByLink attribute – any user who can create objects in an OU can create a dMSA that “succeeds” any account, inheriting its credentials via Kerberos.
1. Create Malicious dMSA
Via WinRM as adam.scott:
|
|
2. Set Up Chisel SOCKS Proxy
Kerberos port (88) is firewalled externally. Use chisel to tunnel through the victim:
|
|
Configure /etc/proxychains4.conf:
strict_chain
[ProxyList]
socks5 127.0.0.1 1080
3. Extract Administrator Hash
Use getST.py with -dmsa flag through the SOCKS proxy. Note the +7h clock skew requires faketime:
|
|
Output reveals the Previous keys which contain the Administrator’s NTLM hash:
[*] Previous keys:
[*] EncryptionTypes.rc4_hmac:0b133be956bfaddf9cea56701affddec
4. Secretsdump (Optional Verification)
|
|
Administrator:500:aad3b435b51404eeaad3b435b51404ee:0b133be956bfaddf9cea56701affddec:::
Root Flag
|
|
Or with evil-winrm:
|
|
Lessons Learned
- MSSQL impersonation opens lateral paths –
EXECUTE AS LOGINallowed kevin (guest) to access a restricted database through appdev, bypassing direct authorization checks - PBKDF2 doesn’t guarantee safety – Despite 600,000 iterations, the password
iloveyou1falls quickly to dictionary attacks. Strong passwords are still essential regardless of hashing algorithm - MSSQL RID brute forcing is powerful – Even without SMB access, MSSQL’s
SUSER_SNAME()function with constructed SIDs enables complete domain user enumeration - Password reuse across web and AD is common – The admin web app password was reused as adam.scott’s domain password
- BadSuccessor (CVE-2025-53779) is devastating – Any user who can create child objects in an OU can impersonate any account in the domain, including Administrator. The vulnerability is in the dMSA design of Windows Server 2025 and requires no special privileges beyond object creation
- Firewalled Kerberos requires tunneling – When only WinRM is exposed, chisel SOCKS proxying enables full Kerberos exploitation from the attacker machine