Skip to content

Kerberos Delegation Abuse

Also calledUnconstrained delegation, Constrained delegation, RBCD, S4U

Uses a server trusted for delegation to reach other services in users' names.

Needs
Delegation ServerorDirectory Write
Gives
TGTandService TicketandDC Account

How the Attack Works

When a user who is not protected from delegation signs in with Kerberos to a server trusted for unconstrained delegation, the client also sends a forwarded copy of the user's TGT and its session key, and the server keeps both in LSASS. Whoever controls that server can use those TGTs anywhere, as those users, until they expire. Constrained and resource-based delegation forward no TGT, but let a server ask for tickets in a user's name to the services allowed (S4U2self and S4U2proxy). Control of such a server, or the right to write a computer's resource-based delegation attribute, therefore reaches those services as users not protected from delegation.

Read first Authentication and Authorisation, AP Exchange: Using the Ticket, The PAC and Its Signatures, Kerberos Delegation

How It Plays Out

The attack step by step. Each step shows which machines take part, what travels, the keys and tickets each side now holds, what is logged and what a defender can see.

dana signs in to a web app on srv-app-01, a server trusted for unconstrained delegation, which keeps her TGT.Step through it

ws-017 Client

  • dana's key
  • TGT
  • TGT session key
  • service ticket
  • service session key

srv-app-01 Web app server

dc-01 Domain controller

  • dana's key
  • krbtgt key
  • srv-fin-01 key
  1. Step 1 of 4, AP Request and TGT, ws-017 to srv-app-01
  2. Step 2 of 4, TGTs Kept in Memory, on srv-app-01
  3. Step 3 of 4, TGS Request as dana, srv-app-01 to dc-01
  4. Step 4 of 4, Ticket in dana's Name, dc-01 to srv-app-01
  1. Step 1 of 4: AP Request and TGT

    ws-017 Client to srv-app-01 Web app server

    Ticket shown, with a copy of her TGT KRB_AP_REQ Kerberos over HTTP, port 443

    dana opens the web app, and because srv-app-01 is trusted for unconstrained delegation, ws-017 sends a forwarded copy of her TGT too.

    What Travels in This Step

    • An authenticator KRB-CRED

      dana's name, the time, and a KRB-CRED holding a forwarded copy of her TGT and its session key

      Encrypted with the service session key Only ws-017 and srv-app-01 can open it.

    Keys and Tickets

    • srv-app-01 now holds TGT (new at this step) TGT session key (new at this step) service session key (new at this step)

    Logged

    • 4624 An account was successfully logged on

      On srv-app-01, in the Security log

      Impersonation Level Delegation, so the server may use her identity on other machines

      Reading Logon Events explains how to read it.

    What Defenders See

    The Security log on srv-app-01 shows event 4624 for dana with Impersonation Level Delegation. Nothing in the log marks the TGT inside her request.

    Hooks into Kerberos AP Request

  2. Step 2 of 4: TGTs Kept in Memory

    On srv-app-01 Web app server

    srv-app-01 keeps the forwarded TGT and session key in LSASS. Whoever controls it can take every one it holds.

    What Defenders See

    If the TGTs are copied out, srv-app-01 shows the signs of LSASS access, such as Sysmon event 10 in its Microsoft-Windows-Sysmon/Operational log. Used in place, they show only in the Security logs on dc-01 and the services they reach.

  3. Step 3 of 4: TGS Request as dana

    srv-app-01 Web app server to dc-01 Domain controller

    Request for a ticket in dana's name KRB_TGS_REQ Kerberos, port 88

    With her TGT, srv-app-01 asks dc-01 for a ticket in her name to srv-fin-01, a service the web app never uses.

    What Travels in This Step

    • dana's forwarded TGT

      Her name and groups, as the DC issued them

      Encrypted with the krbtgt AES key Only dc-01 can open it.

    • An authenticator

      dana's name and the time

      Encrypted with the TGT session key Only ws-017, srv-app-01 and dc-01 can open it.

    Logged

    • 4769 A Kerberos service ticket was requested

      On dc-01, in the Security log

      Account Name dana@CORP.EXAMPLE, Service Name srv-fin-01$, Client Address ::ffff:192.0.2.25

      TGS Reply: The Service Ticket explains how to read it.

    What Defenders See

    The Security log on dc-01 shows event 4769 for dana from srv-app-01's address with Transited Services empty, so it looks like her own request.

    Hooks into Kerberos TGS Request

  4. Step 4 of 4: Ticket in dana's Name

    dc-01 Domain controller to srv-app-01 Web app server

    Reply with a ticket in dana's name KRB_TGS_REP Kerberos, port 88

    dc-01 issues the ticket as it would to dana herself, since nothing tells it who holds her TGT.

    What Travels in This Step

    • The service ticket

      dana's name and groups, for srv-fin-01

      Encrypted with srv-fin-01's AES key Only dc-01 can open it.

    Keys and Tickets

    • srv-app-01 now holds service ticket (new at this step)

    What Defenders See

    Nothing more shows, because the reply writes no event of its own to the logs on dc-01.

Needs First

What the attacker must already hold for this attack to be possible.

  • A Server Trusted for Delegation or Write Access to a Directory ObjectControl of a server trusted for delegation, or the right to change a computer's resource-based delegation.

Comes From

Gives the Attacker

What running it hands the attacker to use next.

  • A TGTThe TGTs of users who sign in to an unconstrained delegation server, usable anywhere.
  • A Service TicketService tickets in the name of any user not protected from delegation, to the services it reaches.
  • A DC's Computer AccountA DC's own TGT, when a forced callback makes a DC sign in to an unconstrained delegation server.

Leads To

What Defenders See

What this attack leaves for a defender to find, and what to read in each. None of it is proof on its own, so treat each as a lead and confirm it against the rest.

Event and LogWritten OnLook ForSwitch It On
4769 A Kerberos service ticket was requested (opens in a new tab) Security logDomain controllersA user's tickets asked for from a delegation server's address to services it never uses, with Transited Services filled for constrained delegation.TGS Reply: The Service Ticket explains how to read it.Audit Kerberos Service Ticket Operations
4742 A computer account was changed (opens in a new tab) Security logDomain controllers'Trusted For Delegation' or 'Trusted To Authenticate For Delegation' enabled, or AllowedToDelegateTo changed, on a computer.Audit Computer Account Management
4738 A user account was changed (opens in a new tab) Security logDomain controllers for domain accounts, the computer itself for local onesThe same delegation settings changed on a user account, such as a service account.Audit User Account Management
5136 A directory service object was modified (opens in a new tab) Security logDomain controllers, for objects with a matching audit entrymsDS-AllowedToActOnBehalfOfOtherIdentity written on a computer, which grants resource-based delegation and is seen only with an audit entry.Audit Directory Service Changes, and an audit entry (SACL) on the object
4741 A computer account was created (opens in a new tab) Security logDomain controllersA computer account created by an ordinary user, which resource-based delegation abuse can then use.Audit Computer Account Management

What It Looks Like

One event from the worked example, decoded field by field, so you can see what to read in it and what each value means.

4769 A Kerberos service ticket was requested

In the Security log on dc-01,

A ticket to srv-fin-01 in dana's name, asked for by srv-app-01 with her forwarded TGT.

  • The ticket is in dana's name, though dana did not ask for it.

    As Windows writes it: Account Name dana@CORP.EXAMPLE

  • The file server. Delegation exists so the web app can reach its own back end for users. A service it never uses is the lead.

    As Windows writes it: Service Name srv-fin-01$

  • srv-app-01, not ws-017, because her forwarded TGT is being used by the server that holds it.

    As Windows writes it: Client Address ::ffff:192.0.2.25

  • Empty, because with unconstrained delegation the server presents dana's own TGT, so this reads like a request she made herself.

    As Windows writes it: Transited Services -

Defender for Identity Alerts

Where Defender for Identity runs, its sensors raise these from what they read on the servers they are installed on, domain controllers above all. Each names what it flags, which is a lead to confirm, not proof on its own.

Blind Spots

Where this attack leaves little or nothing to see, so a quiet log is not read as an all-clear.

  • Unconstrained delegation is quiet in use, because the forwarded TGT rides inside an ordinary sign-in, so know which servers hold the setting rather than wait for its use.
  • 4742 does not show resource-based delegation, and only 5136, with an audit entry on the attribute, records that change. Defender for Identity alerts on suspicious ones.

Hunt It

The query to run in each tool, and how well each one sees this attack. Pick the tool you use, and the others load their query when you open them.

Needs Defender for Identity sensors on every DC. An attribute change alert shows the setup, not an impersonation. To see which servers hold unconstrained delegation, use the Unsecure Kerberos delegation assessment.

KQLDefender XDR, Advanced hunting
// Defender for Identity alerts on Kerberos delegation, with the accounts and devices in themAlertEvidence| where Timestamp > ago(30d)| where Title has "delegation"| project Timestamp, Title, EntityType, EvidenceRole, AccountName, DeviceName, RemoteIP| order by Timestamp desc

How to Prevent It

The controls that break this attack, each with how it helps here and, where the Registry topic has it, where to check it on a machine.

Sources