Shadow Credentials
Tools: Whisker https://github.com/eladshamir/Whisker , pyWhisker https://github.com/ShutdownRepo/pywhisker , ShadowSpray https://github.com/Dec0ne/ShadowSpray/
Add Key Credentials to the attribute msDS-KeyCredentialLink of the target user/computer object and then perform Kerberos authentication as that account using PKINIT to obtain a TGT for that user. When trying to pre-authenticate with PKINIT, the KDC will check that the authenticating user has knowledge of the matching private key, and a TGT will be sent if there is a match.
WARNING! User objects can't edit their own msDS-KeyCredentialLink attribute while computer objects can. Computer objects can edit their own msDS-KeyCredentialLink attribute but can only add a KeyCredential if none already exists
Requirements
1) Domain Controller on (at least) Windows Server 2016
2) Domain must have Active Directory Certificate Services and Certificate Authority configured
3) PKINIT Kerberos authentication
4) An account with the delegated rights to write to the msDS-KeyCredentialLink attribute of the target object
Exploitation
Windows
1) # Lists all the entries of the msDS-KeyCredentialLink attribute of the target object.
2) # Generates a public-private key pair and adds a new key credential to the target object.
Linux
Scenarios:
Scenario 1: Shadow Credential relaying
1) Trigger an NTLM authentication from DC01 (PetitPotam)
2) Relay it to DC02 (ntlmrelayx)
3) Edit DC01 's attribute to create a Kerberos PKINIT pre-authentication backdoor (pywhisker)
Alternatively :
Scenario 2: Workstation Takeover with RBCD
Only for C2: Add Reverse Port Forward from 8081 to Team Server 81
1) Set up ntlmrelayx to relay authentication from target workstation to DC
2) Execute printer bug to trigger authentication from target workstation
3) Get a TGT using the newly acquired certificate via PKINIT
4) Get a ST (service ticket) for the target account
5) Utilize the ST for future activity
Last updated