You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix sapphire ticket generation when using ccache (-k) authentication
Three bugs prevented sapphire tickets from working with the -k (ccache)
flow:
1. oldSessionKey was never assigned in the ccache code path, causing
_extract_reply_ticket_times to fail with an unbound variable error.
When loading from ccache there is no key exchange, so oldSessionKey
equals sessionKey.
2. _extract_reply_ticket_times and the cipher-validation checks tried
to read the enc-part etype from the ccache-sourced AS_REP structure,
which may contain a stale/placeholder etype (e.g. DES etype 1) that
is absent from impacket's _enctype_table, raising a KeyError. These
checks are unnecessary for the -k path — the real cipher negotiation
happens during S4U2Self+U2U — so skip them entirely.
3. saveTicket loaded the existing KRB5CCNAME ccache and appended the
new ticket, carrying over the original TGT (e.g. DomainA\userA).
Downstream tools then picked the first matching krbtgt credential
instead of the sapphire ticket, causing cross-realm service tickets
to be issued for the wrong principal. Always create a fresh ccache
so the saved file contains only the forged ticket.
Tested with sapphire ticket generation using a ccache TGT, followed by
cross-realm TGS referral (DomainA → forest root → DomainB) to obtain
cifs/ and host/ service tickets under the impersonated identity.
0 commit comments