Monteverde
Executive summary — Monteverde is a short chain that's very representative of a poorly secured hybrid Azure/AD environment. An anonymous LDAP bind hands over the full list of domain users; a username=password spray over that list lands
SABatchJobs:SABatchJobs, an account that opens a non-standard SMB share wheremhopeleft their password in plaintext inside anazure.xml.mhopegives WinRM access anduser.txt, and their membership in the Azure Admins group points straight at the real vector: the DC has Azure AD Connect installed, whose synchronization service stores its credentials reversibly encrypted in a local SQL database. Decrypting them reveals that the sync account is, directly, the domain's Administrator.
| Platform | Hack The Box |
| Operating system | Windows Server 2019 Build 17763 |
| Difficulty | Medium |
| Status | Retired |
| Target IP | 10.129.48.171 |
Attack map
[LDAP/389] anonymous bind -> full list of domain users
| username=password spray over that list
v
[SMB] SABatchJobs:SABatchJobs -- non-standard "users$" share
| users$\mhope\azure.xml -- plaintext password (PSADPasswordCredential)
v
[WinRM] mhope : 4n0therD4y@n0th3r$ -> user.txt
| mhope in "Azure Admins" + Azure AD Connect installed on the DC
v
[ADSync DB] local decryption with mcrypt.dll -> administrator:d0m@in4dminyeah!
|
v
[ROOT] WinRM as administrator -> root.txt (DCSync confirms the NT hash)
1. Reconnaissance
sudo nmap -p- --min-rate 3000 -T4 -Pn -oN nmap-allports.txt 10.129.48.171
sudo nmap -p53,88,135,139,389,445,464,593,636,3268,5985,9389 -sCV -Pn -oN nmap-services.txt 10.129.48.171
A response ttl=127 already gives away a Windows stack before reading a single service. The open port set (53, 88, 389, 445, 464, 636, 3268, 9389) is the textbook fingerprint of a Domain Controller: DNS, Kerberos, LDAP/LDAPS/GC and the AD web services endpoint. There's no web port at all — the entire attack surface runs over directory protocols. The detail worth keeping is 5985/WinRM being open: once a valid credential shows up, a shell is guaranteed without needing any extra exploit.
echo "10.129.48.171 megabank.local MEGABANK.LOCAL monteverde.megabank.local MONTEVERDE" | sudo tee -a /etc/hosts
Methodology note: it's worth checking clock skew against the DC first — here it's about 7 seconds, well inside Kerberos' default 5-minute tolerance, so there's no need to sync the clock for
netexec/Kerberos to work later on.
Resumen ejecutivo — Monteverde es una cadena corta pero muy representativa de un entorno híbrido Azure/AD mal asegurado. Un bind LDAP anónimo entrega la lista completa de usuarios del dominio; un password spray usuario=contraseña sobre esa lista da con
SABatchJobs:SABatchJobs, cuenta que abre un share SMB no estándar dondemhopedejó su contraseña en texto claro dentro de unazure.xml. Conmhopese consigue WinRM yuser.txt, y su pertenencia al grupo Azure Admins apunta directo al verdadero vector: el DC tiene instalado Azure AD Connect, cuyo servicio de sincronización guarda sus credenciales cifradas de forma reversible en una base de datos SQL local. Descifrarlas revela que la cuenta de sincronización es, directamente, el Administrator del dominio.
| Plataforma | Hack The Box |
| Sistema operativo | Windows Server 2019 Build 17763 |
| Dificultad | Medium |
| Estado | Retired |
| IP objetivo | 10.129.48.171 |
Mapa del ataque
[LDAP/389] bind anonimo -> lista de usuarios del dominio
| spray usuario=contrasena sobre esa lista
v
[SMB] SABatchJobs:SABatchJobs -- share no estandar "users$"
| users$\mhope\azure.xml -- password en claro (PSADPasswordCredential)
v
[WinRM] mhope : 4n0therD4y@n0th3r$ -> user.txt
| mhope in "Azure Admins" + Azure AD Connect instalado en el DC
v
[ADSync DB] descifrado local con mcrypt.dll -> administrator:d0m@in4dminyeah!
|
v
[ROOT] WinRM como administrator -> root.txt (DCSync confirma el NT hash)
1. Reconocimiento
sudo nmap -p- --min-rate 3000 -T4 -Pn -oN nmap-allports.txt 10.129.48.171
sudo nmap -p53,88,135,139,389,445,464,593,636,3268,5985,9389 -sCV -Pn -oN nmap-services.txt 10.129.48.171
Un ttl=127 en las respuestas ya delata una pila Windows antes de leer un solo servicio. El puerto abierto y el conjunto (53, 88, 389, 445, 464, 636, 3268, 9389) son la huella clásica de un Domain Controller: DNS, Kerberos, LDAP/LDAPS/GC y el servicio de gestión AD. No hay ningún puerto web — toda la superficie de ataque va a discurrir sobre protocolos de directorio. El detalle relevante es 5985/WinRM abierto: si se consigue una credencial válida, hay shell garantizada sin necesidad de un exploit adicional.
echo "10.129.48.171 megabank.local MEGABANK.LOCAL monteverde.megabank.local MONTEVERDE" | sudo tee -a /etc/hosts
Detalle de metodología: conviene comprobar el desfase horario con el DC antes de nada — aquí son unos 7 segundos, dentro de la tolerancia de 5 minutos de Kerberos por defecto, así que no hará falta sincronizar el reloj para que
netexec/Kerberos funcionen más adelante.
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.