portfolio terminal
Identity & Access
Kerberos delegation explained with Wireshark
A Wireshark walkthrough of S4U2Self and S4U2Proxy, following a service's request for a ticket on behalf of a user.
Imagine using an application that retrieves files from another server. The application knows who you are, but it still needs to connect to the server holding those files.
Kerberos delegation allows the application to make that connection on your behalf. The receiving server can then check your permissions when deciding what you may access.
In this article, we will follow that process through a Wireshark capture. Three identities matter:
| Identity | Role |
|---|---|
WINC$ | The account used by the service making the requests |
hagit@nd | The user that service wants to represent |
cifs/ndc.nd.c | The destination service |
Our example uses resource-based constrained delegation, or RBCD. This is a form of delegation where permissions are configured on the account representing the destination resource. Those permissions determine which service accounts may act on behalf of users toward that resource.
The goal in this capture is straightforward: WINC$ wants a ticket that allows it to authenticate to cifs/ndc.nd.c as hagit@nd.
Preparing Wireshark
We will use Wireshark’s RBCD sample capture, recorded in February 2019. The archive includes a keytab containing the keys needed to decrypt the sample’s protected fields.
To follow along, open the capture, then go to Edit → Preferences → Protocols → KRB5. Enable Try to decrypt Kerberos blobs and select the included nd.kt file.
Go to Protocols:
Go to KRB5 and add the keytab file and enable “Try to decrypt Kerberos blobs”:
Choose the nd.kt file:
Apply this filter to display the five packets we will examine:
frame.number in {10, 11, 12, 13, 15}
A ticket to the service itself: S4U2Self
We begin with frame 10. The KDC returns a TGT for WINC$. The response’s client name, cname, is WINC$, and the ticket’s service name, sname, is krbtgt/ND.C.
WINC$.This tells us who will make the following requests. The service has its own credentials and will authenticate to the KDC as WINC$. It does not need the user’s TGT for the exchange shown here.
In frame 11, the service requests a ticket to itself for hagit@nd. This step is called S4U2Self, short for Service for User to Self. It lets a service obtain a ticket representing a user to that same service.
Under padata → PA-FOR-USER, we find hagit@nd. This is the user the service wants to represent.
PA-FOR-USER and the requested service name.Under req-body → sname, we find winc$, which is the requested destination.
winc$ as the requested service under req-body → sname.Together, these fields mean:
Give me a ticket for hagit@nd to my own service, winc$.
The capture does not show how the application originally identified the user. S4U2Self does not require the user to send their password in this request.
In frame 12, the KDC returns the requested ticket. The client name is hagit@nd, and the service name is winc$.
The service now holds a ticket representing the user to itself. This is a preparation step. It does not yet have a ticket for the destination CIFS service.
A ticket to another service: S4U2Proxy
That request happens in frame 13, using S4U2Proxy. This allows the service to request a ticket to another service on behalf of the user.
First, look inside padata → PA-TGS-REQ. The embedded AP-REQ contains a TGT and an authenticator. The TGT is addressed to krbtgt/ND.C, and the decrypted authenticator names WINC$.
This answers the first question: who is asking the KDC? The answer is still WINC$.
Next, look at req-body → sname. The requested destination is now cifs/ndc.nd.c.
The service also supplies an additional ticket. Under req-body → additional-tickets, we find the ticket from frame 12. Its service name is winc$, and its decrypted client name is hagit@nd.
The request now contains everything needed to describe what the service wants:
| Part of the request | What it tells the KDC |
|---|---|
| TGT and authenticator | WINC$ is making the request |
| Additional ticket | The user being represented is hagit@nd |
| Requested service name | The destination is cifs/ndc.nd.c |
The additional ticket is often called an evidence ticket. It gives the KDC a previously issued ticket connecting the user to the requesting service. The KDC still needs to check whether that service may act for the user toward the new destination.
Under req-body → kdc-options, Wireshark shows constrained-delegation: True. Microsoft calls this option cname-in-addl-tkt. It tells the KDC to take the user identity from the additional ticket when processing the request.
The other highlighted values, such as forwardable and renewable, are requested options. To see what the KDC actually granted, we would need to inspect the resulting ticket.
Under PA-PAC-OPTIONS, we also see resource-based-constrained-delegation: True.
This signals support for RBCD. It does not give the service permission to delegate. The KDC checks the configured delegation permissions before issuing the ticket. Those permissions are stored in Active Directory and are not shown in this capture.
The additional ticket also contains a PAC, which carries Windows authorization information about the user.
These describe the account. Normal Account does not tell us whether the user has administrative privileges, and the password-expiration setting does not grant delegation permission. They should not be used to explain why this request succeeds.
The ticket returned by the KDC
The answer arrives in frame 15. The KDC returns a service ticket with:
Client: hagit@nd
Service: cifs/ndc.nd.c
This is the key result: WINC$ made the request, but the issued ticket represents hagit@nd. The requesting service can use the returned credentials to authenticate to the CIFS service on the user’s behalf.
The ticket also records information about the delegation. Inside its decrypted PAC, the S4U Delegation Info section contains:
S4U2proxyTarget: cifs/ndc.nd.c
S4UTransitedServices:
winc$@ND.C
The first field identifies the destination. The second records the service through which delegation occurred. This helps explain how the user’s identity reached the destination service.
Here, WINC$ requests a ticket representing hagit@nd. The username tells us whose identity the ticket carries. Following the request and the delegation information reveals which service obtains it.
An attacker who compromises an account allowed to delegate could use those permissions to request tickets on behalf of eligible users. The configured delegation permissions and those users’ access rights would shape how far that access could extend.
Frame 15 confirms that the KDC issued the requested ticket. To establish what happened next, we would need evidence from the connection to the CIFS service or its logs. The capture contains no file access, and the destination would still need to validate the authentication and check the user’s permissions.
Sources
-
Wireshark: RBCD sample capture and keytab
https://wiki.wireshark.org/uploads/__moin_import__/attachments/SampleCaptures/rbcd_win_with_keys.tgz
-
Microsoft: Resource-based Kerberos constrained delegation
-
Microsoft MS-SFU: S4U2Self
-
Microsoft MS-SFU: Sending an S4U2Proxy request
-
Microsoft MS-SFU: Checking resource-based delegation permissions
-
Microsoft MS-SAMR: User account flags
-
Microsoft MS-PAC: S4U delegation information