Skip to content

Conversation

@aelmosalamy
Copy link

A story of pain and sorrow

Tools like Rubeus write base64-encoded Kirbi tickets to the terminal. I often find myself repeating this sequence:

  1. Re-run Rubeus with /unwrap
  2. Copy the ticket
  3. Save into ticket.kirbi.b64
  4. Decode base64 -d ticket.kirbi.b64 > ticket.kirbi
  5. ticketConverter.py ticket.kirbi ticket.ccache

ticketConverter's current behavior

ticketConverter.py currently only works with binary tickets. If it receives a base64-encoded ticket it fails:

$ ticketConverter.py ticket.kirbi.b64 ticket.ccache
Impacket v0.13.0.dev0+20251002.113829.eaf2e556 - Copyright Fortra, LLC and its affiliated companies

[X] unknown file format

How this commit ends the pain

Added a new option -b/--base64:

$ ticketConverter.py -h
Impacket v0.13.0.dev0+20251002.113829.eaf2e556 - Copyright Fortra, LLC and its affiliated companies

usage: ticketConverter.py [-h] [-b] input_file output_file

positional arguments:
  input_file    File in kirbi (KRB-CRED) or ccache format
  output_file   Output file

options:
  -h, --help    show this help message and exit
  -b, --base64  Decode input ticket from base64 with unwrap support

Example with base64-encoded Kirbi ticket:

$ ticketConverter.py ticket.kirbi.b64 ticket.ccache --base64
Impacket v0.13.0.dev0+20251002.113829.eaf2e556 - Copyright Fortra, LLC and its affiliated companies

[*] base64 decoding ticket
[*] converting kirbi to ccache...
[+] done

Seamlessly works the other way too:

$ ticketConverter.py ticket.ccache.b64 ticket.kirbi --base64
Impacket v0.13.0.dev0+20251002.113829.eaf2e556 - Copyright Fortra, LLC and its affiliated companies

[*] base64 decoding ticket
[*] converting ccache to kirbi...
[+] done

Code edits

I made sure the commit is as non-invasive as possible.

It only adds a new function base64_decode_with_unwrap which is only applied if the -b/--base64 is provided. Otherwise, everything behaves as before.

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