Jamal Darbo// Security PortfolioPortfolio v1
Portfolio Blog
Back to blog

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.

Kerberos series: view the reading order

A cybernetic shark beside the three-headed guardian Cerberus and a glowing Kerberos ticket

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:

IdentityRole
WINC$The account used by the service making the requests
hagit@ndThe user that service wants to represent
cifs/ndc.nd.cThe 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.

Opening Wireshark preferences from the Edit menu

Go to Protocols:

The Protocols section in Wireshark preferences

Go to KRB5 and add the keytab file and enable “Try to decrypt Kerberos blobs”:

KRB5 preferences with Kerberos decryption enabled and the keytab field highlighted

Choose the nd.kt file:

Selecting the nd.kt keytab included with the sample capture

Apply this filter to display the five packets we will examine:

frame.number in {10, 11, 12, 13, 15}
Wireshark displaying frames 10, 11, 12, 13 and 15
The five packets used to follow the delegation exchange.

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.

Frame 10 showing WINC$ as the client and krbtgt/ND.C as the ticket service
Frame 10, the TGT issued to 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.

Frame 11 showing hagit@nd in PA-FOR-USER
Frame 11, showing PA-FOR-USER and the requested service name.

Under req-body → sname, we find winc$, which is the requested destination.

Frame 11 showing winc$ as the requested service under req-body and sname
Frame 11, showing 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$.

Frame 12 showing hagit@nd as the client and winc$ as the service
Frame 12, the client name and the service name.

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$.

Frame 13 showing the TGT for krbtgt/ND.C and WINC$ in the decrypted authenticator
Frame 13, showing the ticket and authenticator.

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.

Frame 13 requesting a ticket for cifs/ndc.nd.c
Frame 13, showing the requested CIFS service.

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 additional ticket in frame 13 names winc$ as the service and hagit@nd as the client
Frame 13, showing the additional ticket and its client name.

The request now contains everything needed to describe what the service wants:

Part of the requestWhat it tells the KDC
TGT and authenticatorWINC$ is making the request
Additional ticketThe user being represented is hagit@nd
Requested service nameThe 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.

Frame 13 KDC options including constrained-delegation, forwardable and renewable
Frame 13, KDC options.

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.

The resource-based-constrained-delegation option is true in frame 13
Frame 13, the RBCD option.

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.

User account flags in the additional ticket PAC
Frame 13, user account flags.

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

Frame 15 showing a service ticket for hagit@nd to cifs/ndc.nd.c
Frame 15, the client and service names.

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

S4U delegation information showing cifs/ndc.nd.c as the target and winc$@ND.C as the transited service
Frame 15, showing the S4U delegation information.

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