Skip to content

Check cached TGT matches requested user in getST.py#2218

Open
p-nowodzinski wants to merge 1 commit into
fortra:masterfrom
p-nowodzinski:impacket-getst-cache-principal-check
Open

Check cached TGT matches requested user in getST.py#2218
p-nowodzinski wants to merge 1 commit into
fortra:masterfrom
p-nowodzinski:impacket-getst-cache-principal-check

Conversation

@p-nowodzinski

Copy link
Copy Markdown

Cached Kerberos TGTs are only reused when they belong to the same principal requested via the CLI.

Previously, getST.py reused a cached TGT based only on realm/domain resolution from CCache.parseFile(), without validating that the cached credential belonged to the requested username.

This could result in incorrect credential reuse when multiple principals exist within the same realm.

This change adds a principal equality check using impacket.krb5.types.Principal, ensuring both username and realm match before reusing a cached TGT.

  • Add principal-level validation for cached TGT reuse in getST.py
  • Invalidate cached TGT when username does not match requested principal
  • Fall back to requesting a new TGT when mismatch is detected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant