Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Support for Cracking Active Directory Kerberos Keys - Etypes 3/17/18 #1386
I'd like to request the ability to crack Kerberos keys in hashcat. As you may already be aware, Kerberos keys in AD are deterministically derived from the password of the related account. So the keys are hashes in effect. One of the reasons that this has not gotten much attention is that in most places in an Active Directory environment, where you are going to encounter Kerberos keys, you are also going to encounter NTLM hashes or passwords(e.g. mimikatz and NTDS database). However there are places of potential research, that interface with AD, but are not Windows. Macs, Linux and random embedded devices are more likely to use Kerberos only for authentication. While it is true that getting access to the key is enough to authenticate against AD, being able to crack a password allows for more flexibility in toolset, as not many tools support kerberos authentication and virtually no built-in to the OS tools support this kind of auth.
As part of a recent DerbyCon talk, we developed a PoC Kerberos key generator and cracker: echidna. This is probably the most consolidated place to look at how the key generation works. There Is plenty of info in MS-KILE as well, and it references the various RFCs.
I would recommend using the hash format that Secretsdump uses(same as echidna uses). While you could make the argument that using a keytab would be better, I don't think this is the way to go, the format contains binary and can contain multiple keys... It would be confusing. Here are some example keys using the domain/username:password TEST.LOCAL/test:password:
# python krbKeyGenerate.py -u test -d TEST.LOCAL -p password TEST.LOCAL\test:aes256-cts-hmac-sha1-96:487addf1717899f2ee45c4b67e159d54adec46d086f339b88fd7deaa25d49a65 TEST.LOCAL\test:aes128-cts-hmac-sha1-96:6fb8b78e20ad3df6591cabb9cacf4594 TEST.LOCAL\test:des-cbc-md5:9dbc9bea23237fae TEST.LOCAL\test:rc4_hmac:8846f7eaee8fb117ad06bdd830b7586c
Note that RC4 probably doesn't need to be done, as the key used is the NTLM hash.
If you have any questions or suggestions, let me know.