Skip to content

Breach Walkthrough

Lab Name: Breach
Difficulty: Medium
Platform: Vulnlab

In Breach, we start without credentials and use a writable SMB share to capture NTLM authentication. After cracking the password, we Kerberoast a service account and forge a Silver Ticket for MSSQL access. Finally, we abuse SeImpersonatePrivilege to reach SYSTEM.


We scan for open ports and services to find an initial attack path.

image.png

  • LDAP, Kerberos, and SMB are exposed, indicating an Active Directory environment.
  • These services provide opportunities for user enumeration, authentication attacks, and lateral movement.

image.png

  • The scan also reveals the domain name and Domain Controller hostname.
  • Adding these entries to /etc/hosts helps with Kerberos-based enumeration and improves tool reliability.

We use nxc with anonymous authentication to find accessible shares.

image.png

  • A share named Users is accessible with read permissions.
  • Another share named share is accessible with read and write permissions.
  • Read access to IPC$ allows RID cycling to enumerate domain users.

Read access to IPC$ lets us enumerate domain users and groups through RID cycling.

Terminal window
impacket-lookupsid anonymous@10.10.123.133
Output
Impacket v0.14.0.dev0 - Copyright Fortra, LLC and its affiliated companies
Password:
[*] Brute forcing SIDs at 10.10.123.133
[*] StringBinding ncacn_np:10.10.123.133[\pipe\lsarpc]
[*] Domain SID is: S-1-5-21-2330692793-3312915120-706255856
1000: BREACH\BREACHDC$ (SidTypeUser)
1101: BREACH\DnsAdmins (SidTypeAlias)
1102: BREACH\DnsUpdateProxy (SidTypeGroup)
1103: BREACH\SQLServer2005SQLBrowserUser$BREACHDC (SidTypeAlias)
1104: BREACH\staff (SidTypeGroup)
1105: BREACH\Claire.Pope (SidTypeUser)
1106: BREACH\Julia.Wong (SidTypeUser)
1107: BREACH\Hilary.Reed (SidTypeUser)
1108: BREACH\Diana.Pope (SidTypeUser)
1109: BREACH\Jasmine.Price (SidTypeUser)
1110: BREACH\George.Williams (SidTypeUser)
1111: BREACH\Lawrence.Kaur (SidTypeUser)
1112: BREACH\Jasmine.Slater (SidTypeUser)
1113: BREACH\Hugh.Watts (SidTypeUser)
1114: BREACH\Christine.Bruce (SidTypeUser)
1115: BREACH\svc_mssql (SidTypeUser)

The output reveals several domain users:

  • Julia.Wong
  • Christine.Bruce
  • Diana.Pope
  • Jasmine.Price
  • George.Williams
  • Jasmine.Slater
  • Hugh.Watts
  • Christine.Bruce
  • Claire.Pope
  • Hilary.Reed
  • svc_mssql

This user list is useful for further enumeration and password spraying attacks.

We have read access to the Users share and read/write access to share. We can check both for useful files.

Using smbclient to access the shares

image.png

image.png

  • We upload a test file named finance.txt to confirm that the share is writable. It works!
  • We can use this writable share for an NTLM coercion (watering-hole) attack with NTLM Theft.

image.png

image.png

We generate a malicious LNK file with ntlm_theft and upload it to the writable SMB share.

Setting Up responder

We start Responder to capture NTLM authentication attempts.

image.png

image.png

  • An NetNTLMv2 challenge-response is captured for the user Julia.Wong.

The captured NetNTLMv2 challenge-response is cracked using Hashcat with mode 5600.

image.png

image.png

  • We cracked the password!
  • Valid credentials are now available for authenticated enumeration.

We use the credentials to enumerate shares as julia and check julia.wong under transfer for useful files.

image.png

  • Julia Wong’s credentials give us more SMB access, and we find the user flag in local.txt.

image.png

  • We found and submitted the user flag.
  • We now continue with further enumeration and exploitation to obtain the root flag.

We use nxc to collect AD objects and their relationships.

image.png

  • After dumping the Active Directory object data, we can move the files to the current working directory and ingest them into BloodHound for attack path analysis.

We import the data into BloodHound to look for attack paths from julia.wong.

image.png

  • While using the built-in queries to identify Kerberoastable users, we discovered the MSSQLSvc account, which we can potentially abuse.

3.3 Kerberoasting the MSSQL Service Account

Section titled “3.3 Kerberoasting the MSSQL Service Account”

Let’s Kerberoast the MSSQLSvc service account using impacket-GetUserSPNs to request a Ticket Granting Service (TGS) ticket. Since Kerberos service tickets are encrypted using the service account’s NTLM hash, the retrieved TGS can be cracked offline to recover the plaintext password.

image.png

Using Hashcat, we can attempt to crack the extracted Kerberos TGS hash by specifying the module -m 13100, which corresponds to Kerberos 5 TGS-REP (RC4-HMAC).

image.png

image.png

  • We cracked the hash and recovered the password. We can check BloodHound for attack paths from this account.

With control of the service account, we may be able to impersonate users within that service.

Note: I tried accessing MSSQL with impacket-mssqlclient, but it did not work. BloodHound also showed no special permissions for the account, so we try a Silver Ticket attack.

The permissions available to a service account determine what we can do with it. Here, we target the MSSQL server using the compromised account.

For the Silver Ticket attack, we need:

  • The service account’s RC4-HMAC (NTLM) hash
  • The domain SID and the target service SPN

image.png

  • We identified the domain SID. Next, we convert the recovered password into an NTLM hash to create a silver ticket.

Note: This step can be skipped, as we already obtained the domain SID earlier while performing RID cycling using anonymous access!!.

Convert Password to NTLM Hash

image.png

  • Using CyberChef, we converted the plaintext password into an NTLM hash.
  • We use impacket-ticketer to forge a Silver Ticket and authenticate as Administrator within the MSSQL service.

image.png

  • The ticket has been successfully created.

Setting Env Variable for Authentication

Next, we export it by setting the Kerberos ticket environment variable so it can be used for authentication.

image.png

image.png

  • We enable xp_cmdshell to execute system commands. Using this capability, we upload a reverse shell to gain initial access and continue enumerating the system.

image.png

  • Enumeration reveals that this user has the SeImpersonatePrivilege enabled.
  • Since this privilege is present, we can abuse it by uploading GodPotato along with a stageless payload. Executing GodPotato with the payload allows us to escalate privileges and obtain an Administrator-level reverse shell.

We use Sliver for a stable interactive session, with session management for post-exploitation and privilege escalation.

image.png

  • In this step, we generate a Windows stageless payload using Sliver and configure a listener to receive the callback.

image.png

  • Move the payload to the file_share folder so we can serve it to the target.

Setting up the listener

image.png

Setting up the HTTP server to deliver the payload

image.png

A lightweight HTTP server is set up to host the payload.

We use xp_cmdshell to download both GodPotato and the stageless Sliver payload onto the target system via curl.

We transfer the binaries to C:\Temp, then run GodPotato with the stageless payload as its argument. It abuses SeImpersonatePrivilege through token impersonation and connects back to our Sliver listener.

image.png

image.png

image.png

image.png

  • The Sliver session confirms successful privilege escalation, and the current token context is shown as:

NT AUTHORITY\SYSTEM

image.png

  • We retrieved and submitted the root flag!

  • Anonymous SMB access enabled NTLM coercion via a writable share.
  • NTLM credentials for Julia.Wong were captured and cracked.
  • Kerberoasting exposed the svc_mssql service account.
  • A Silver Ticket allowed Administrator impersonation to the targeted MSSQL service. That service ticket did not grant general-purpose Administrator access across the domain.
  • SeImpersonatePrivilege was abused using GodPotato to achieve SYSTEM access.