Kerberos

Kerberosting

Check the Imported Ticket

klist

after that you can test it with ls

ls \\<target machine>\c$

# to list file in the target machine with imported ticket.

Unconstrained Delegation

User --- authenticates to ---> IIS server ---> authenticates on behalf of the user ---> DB server

Any user authentication (i.e CIFS) to the computer with unconstrained delegation enabled on it, will cache that user's TGT in memory, which can later be dumped and reused by an adversary.

use tool -> powerview.ps1

Exploit:

We could wait for user to connect with IIS01 or do phishing attack to force user connect to IIS01.

Then check mimikatz again for TGT in the memory:

After we got OFFENSE.LOCAL/administrator, mean we got the administrator for entire domain.

run this command to export the TGT.

Then import the ticket with mimikatz

login with PSExec or PSSession

Note:

Reference:

Constrained Delegation

note:

cn (common name) -> current computer name

msds-allowedtodelegateto -> target computer

useraccountcontrol -> TRUSTED_TO_AUTH_FOR_DELEGATION

example: IIS01 allows to contrained delegation to FILE_01

User has to have an attribute TRUSTED_TO_AUTH_FOR_DELEGATION in order for it to be able to authenticate to the remote service.

TRUSTED_TO_AUTH_FOR_DELEGATION - (Windows 2000/Windows Server 2003) The account is enabled for delegation. This is a security-sensitive setting. Accounts that have this option enabled should be tightly controlled. This setting lets a service that runs under the account assume a client's identity and authenticate as that user to other remote servers on the network.

https://support.microsoft.com/en-gb/help/305144/how-to-use-useraccountcontrol-to-manipulate-user-account-properties

Exploit on the computer that has trusted_to_auth_for_delegation

When get the Base64 rubeus ticket.

Note:

When access kerberost things, make sure your clock screw is good.

reference: https://www.ired.team/offensive-security-experiments/active-directory-kerberos-abuse/abusing-kerberos-constrained-delegation

DC PrintSpooler

Our environment for this lab is:

  • ws01 - attacker compromised host with kerberos delegation enabled (attacker, server)

  • dc01 - domain controller running a print service (victim, target)

check with this

Before attack (administrator cmd in breached computer ws01 )

Then run SpoolSample.exe (cmd.exe) in IIS01

Rubeus could also import the TGT directly to memory:

We indeed got a TGT for DC01$ computer!

With this, we can make our compromised system ws01$ appear like a Domain Controller and extract an NTLM hash for the user offense\spotless which we know has high privileges in the domain:

reference:

https://www.ired.team/offensive-security-experiments/active-directory-kerberos-abuse/domain-compromise-via-dc-print-server-and-kerberos-delegation#execution

Last updated