Skip to content

Commit 939702b

Browse files
committed
kerberoast cracking updates
1 parent 3d019f8 commit 939702b

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

documentation/modules/auxiliary/gather/kerberoast.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ $krb5tgs$23$*kerber.roastable$MSF.LOCAL$http/abc2.msf.local*$d335dc07b2c018de2a1
6666
$krb5tgs$17$low.admin$MSF.LOCAL$*http/abc.msf.local*$a1c7c1c1e31e36cdb0721928$b69b48...
6767
[!] NOTE: Multiple encryption types returned - will require separate cracking runs for each type.
6868
[*] To obtain the crackable values for a praticular type, run `creds`:
69-
[*] creds -t krb5tgs-rc4 -O 20.248.208.9 -o <outfile.(jtr|hcat)>
69+
[*] creds -t krb5tgs -O 20.248.208.9 -o <outfile.(jtr|hcat)>
7070
[*] creds -t krb5tgs-aes128 -O 20.248.208.9 -o <outfile.(jtr|hcat)>
7171
[*] Auxiliary module execution completed
7272
```

lib/metasploit/framework/hashes.rb

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ module Framework
88
# http://pentestmonkey.net/cheat-sheet/john-the-ripper-hash-formats
99
# https://openwall.info/wiki/john/sample-hashes
1010
# QNX formats -> https://moar.so/blog/qnx-password-hash-formats.html
11-
# rubocop:disable Metrics/ModuleLength
1211
module Hashes
1312
JTR_NTLMV1 = 'netntlm'.freeze
1413
JTR_NTLMV2 = 'netntlmv2'.freeze
@@ -67,9 +66,9 @@ def self.identify_hash(hash)
6766
return 'nt'
6867
when hash.length == 65 && hash =~ /^[\da-fA-F]{32}:[\da-fA-F]{32}$/
6968
return 'lm'
70-
when hash =~ /^[^\\\/:*?"<>|]{1,20}[:]{2,3}([^\\\/:*?"<>|]{1,20})?:[a-f0-9]{48}:[a-f0-9]{48}:[a-f0-9]{16}$/
69+
when hash =~ %r{^[^\\/:*?"<>|]{1,20}:{2,3}([^\\/:*?"<>|]{1,20})?:[a-f0-9]{48}:[a-f0-9]{48}:[a-f0-9]{16}$}
7170
return 'netntlm'
72-
when hash =~ /^([^\\\/:*?"<>|]{1,20}\\)?[^\\\/:*?"<>|]{1,20}[:]{2,3}([^\\\/:*?"<>|]{1,20}:)?[^\\\/:*?"<>|]{1,20}:[a-f0-9]{32}:[a-f0-9]+$/
71+
when hash =~ %r{^([^\\/:*?"<>|]{1,20}\\)?[^\\/:*?"<>|]{1,20}:{2,3}([^\\/:*?"<>|]{1,20}:)?[^\\/:*?"<>|]{1,20}:[a-f0-9]{32}:[a-f0-9]+$}
7372
return 'netntlmv2'
7473
# OSX
7574
when hash.start_with?('$ml$') && hash.split('$').last.length == 256
@@ -124,18 +123,18 @@ def self.identify_hash(hash)
124123
when hash =~ /^\*?[\da-fA-F]{32}\*[\da-fA-F]{32}$/
125124
# we accept the beginning star as optional
126125
return 'vnc'
127-
when hash =~ /^\$pbkdf2-sha256\$[0-9]+\$[a-z0-9\/.]+\$[a-z0-9\/.]{43}$/i
126+
when hash =~ %r{^\$pbkdf2-sha256\$[0-9]+\$[a-z0-9/.]+\$[a-z0-9/.]{43}$}i
128127
return 'pbkdf2-sha256'
129128
when hash =~ /^\$sntp-ms\$[\da-fA-F]{32}\$[\da-fA-F]{96}$/
130129
return 'timeroast'
131130
when hash =~ /^\$krb5tgs\$23\$\*.+\$[\da-fA-F]{32}\$[\da-fA-F]+$/
132-
return 'krb5tgs-rc4'
131+
return 'krb5tgs'
133132
when hash =~ /^\$krb5tgs\$18\$.+\$[\da-fA-F]{24}\$[\da-fA-F]+$/
134133
return 'krb5tgs-aes256'
135134
when hash =~ /^\$krb5tgs\$17\$.+\$[\da-fA-F]{24}\$[\da-fA-F]+$/
136135
return 'krb5tgs-aes128'
137136
when hash =~ /^\$krb5asrep\$23\$[^:]+:[\da-fA-F]{32}\$[\da-fA-F]+$/
138-
return 'krb5asrep-rc4'
137+
return 'krb5asrep' # hashcat is krb5asrep-rc4, but we use john format
139138
end
140139
''
141140
end

0 commit comments

Comments
 (0)