Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Kerberos Hash & Fixed Base64 bug #54

Merged
merged 2 commits into from Mar 9, 2021
Merged

Added Kerberos Hash & Fixed Base64 bug #54

merged 2 commits into from Mar 9, 2021

Conversation

bee-san
Copy link
Member

@bee-san bee-san commented Mar 9, 2021

Fixes #53
Fixes #52

@bee-san bee-san merged commit 5579f53 into main Mar 9, 2021
@@ -1375,6 +1375,20 @@ class HashInfo:
)
],
),
Prototype(
regex=re.compile(
r"\$krb5tgs\$23\$\*(.*)\*\$(.*)",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like there are actually a couple different hash formats for Kerberos. Hashcat appears to call this one "Kerberos 5 TGS-REP etype 23".
https://hashcat.net/wiki/doku.php?id=example_hashes

Usually, these regexes are more strictly defined, we avoided .* in the past usually.

I looked at hashcat's source code and figured out how they're parsing this:
https://github.com/hashcat/hashcat/blob/master/src/modules/module_13100.c#L115-L116
(and apparently there's another compatible format $krb5tgs$23$checksum$edata2)

Here's a stricter regex that should match $krb5tgs$23$ hashes with account info.

Suggested change
r"\$krb5tgs\$23\$\*(.*)\*\$(.*)",
r"\$krb5tgs\$23\$\*[^*]*\*\$[a-f0-9]{32}\$[a-f0-9]{64,40960}",

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for this! You're right :) We couldn't find it in HashCat, but I've made it a GitHub issue :)

@bee-san bee-san mentioned this pull request Mar 10, 2021
@SkeletalDemise SkeletalDemise deleted the bee-fix-bugs branch March 11, 2021 00:35
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.

Cant find Kerberos 5 TGS-REP etype 23 'base64' in self.kwargs is always True
2 participants