Title: John The Ripper Hash Formats used and required in Penetration TestingAuthor: unknowndevice64
John the Ripper is a favourite password cracking tool of many pentesters. There is plenty of documentation about its command line options.

I’ve encountered the following problems using John the Ripper. These are not problems with the tool itself, but inherent problems with pentesting and password cracking in general.

Sometimes I stumble across hashes on a pentest, but don’t recognise the format, don’t know if it’s supported by john, or whether there are multiple “–format” options I should try.
The hashes you collect on a pentest sometimes need munging into a different format… but what’s the format john is expecting?
John will occasionally recognise your hashes as the wrong type (e.g. “Raw MD5? as “LM DES”). This is inevitable because some hashes look identical.
Sometimes I gain access to a system, but can’t recall how to recover the password hashes for that particular application / OS.

These problems can all be sorted with a bit of googling or grepping through the john source code. I thought it might be helpful to compile a cheat sheet to reduce the amount of time I spend grepping and googling.

In the first release of this page I’ve:

Copied example hashes out of the source code for most supported hash types.
Provided examples of what your hashes.txt file might look like (though I’m sure other variations are supported that aren’t covered here yet).
For each example hash I’ve stated whether it will be automatically recognised by john, or whether you’ll have to use the “–format” option (in which case I’ve included which –format option you need)

I haven’t yet done the following:

Added reminders on how hashes can be collected.
Added information on how to munge the hashes into a format supported by john.

This sheet was originally based on john-1.7.8-jumbo-5. Changes in supported hashes or hash formats since then may not be reflected on this page.
afs – Kerberos AFS DES
Supported Hash Formats

$ cat hashes.txt
$K4$a8dc8aeaa2c48a97,
$ john hashes.txt
$ john --format=afs hashes.txt

$ cat hashes.txt
username:$K4$a8dc8aeaa2c48a97,
$ john hashes.txt
$ john --format=afs hashes.txt

$ cat hashes.txt
username:$K4$a8dc8aeaa2c48a97,:::::::
$ john hashes.txt
$ john --format=afs hashes.txt

bfegg – Eggdrop
Supported Hash Formats

$ cat hashes.txt
+C/.8o.Wuph9.
$ john hashes.txt # Doesn't work. JTR detects hash as "Traditional DES".
$ john --format=bfegg hashes.txt

$ cat hashes.txt
username:+C/.8o.Wuph9.
$ john hashes.txt # Doesn't work. JTR detects hash as "Traditional DES".
$ john --format=bfegg hashes.txt

$ cat hashes.txt
username:+C/.8o.Wuph9.:::::::
$ john hashes.txt # Doesn't work. JTR detects hash as "Traditional DES".
$ john --format=bfegg hashes.txt

bf – OpenBSD Blowfish
Supported Hash Formats

$ cat hashes.txt
$2a$05$CCCCCCCCCCCCCCCCCCCCC.7uG0VCzI2bS7j6ymqJi9CdcdxiRTWNy
$ john hashes.txt
$ john --format=bf hashes.txt

$ cat hashes.txt
username:$2a$05$CCCCCCCCCCCCCCCCCCCCC.7uG0VCzI2bS7j6ymqJi9CdcdxiRTWNy
$ john hashes.txt
$ john --format=bf hashes.txt

$ cat hashes.txt
username:$2a$05$CCCCCCCCCCCCCCCCCCCCC.7uG0VCzI2bS7j6ymqJi9CdcdxiRTWNy:::::::
$ john hashes.txt
$ john --format=bf hashes.txt

bsdi – BSDI DES
Supported Hash Formats

$ cat hashes.txt
_J9..SDSD5YGyRCr4W4c
$ john hashes.txt
$ john --format=bsdi hashes.txt

$ cat hashes.txt
username:_J9..SDSD5YGyRCr4W4c
$ john hashes.txt
$ john --format=bsdi hashes.txt

$ cat hashes.txt
username:_J9..SDSD5YGyRCr4W4c:::::::
$ john hashes.txt
$ john --format=bsdi hashes.txt

crypt – generic crypt(3)
Supported Hash Formats

$ cat hashes.txt
SDbsugeBiC58A
$ john hashes.txt # Doesn't work. JTR detects hash as "Traditional DES".
$ john --format=crypt hashes.txt

$ cat hashes.txt
username:SDbsugeBiC58A
$ john hashes.txt # Doesn't work. JTR detects hash as "Traditional DES".
$ john --format=crypt hashes.txt

$ cat hashes.txt
username:SDbsugeBiC58A:::::::
$ john hashes.txt # Doesn't work. JTR detects hash as "Traditional DES".
$ john --format=crypt hashes.txt

des – Traditional DES
Supported Hash Formats

$ cat hashes.txt
SDbsugeBiC58A
$ john hashes.txt
$ john --format=des hashes.txt

$ cat hashes.txt
username:SDbsugeBiC58A
$ john hashes.txt
$ john --format=des hashes.txt

$ cat hashes.txt
username:SDbsugeBiC58A:::::::
$ john hashes.txt
$ john --format=des hashes.txt

dmd5 – DIGEST-MD5
Supported Hash Formats

TODO: No working example yet.
dominosec – More Secure Internet Password
Supported Hash Formats

$ cat hashes.txt
(GVMroLzc50YK/Yd+L8KH)
$ john hashes.txt
$ john --format=dominosec hashes.txt

$ cat hashes.txt
username:(GVMroLzc50YK/Yd+L8KH)
$ john hashes.txt
$ john --format=dominosec hashes.txt

$ cat hashes.txt
username:(GVMroLzc50YK/Yd+L8KH):::::::
$ john hashes.txt
$ john --format=dominosec hashes.txt

<none> – EPiServer SID Hashes
Supported Hash Formats

$ cat hashes.txt
0x5F1D84A6DE97E2BEFB637A3CB5318AFEF0750B856CF1836BD1D4470175BE 0x4D5EFDFA143EDF74193076F174AC47CEBF2F417F
$ john hashes.txt
$ # NB: There is no --format option for this hash type

$ cat hashes.txt
username:0x5F1D84A6DE97E2BEFB637A3CB5318AFEF0750B856CF1836BD1D4470175BE 0x4D5EFDFA143EDF74193076F174AC47CEBF2F417F
$ john hashes.txt
$ # NB: There is no --format option for this hash type

$ cat hashes.txt
username:0x5F1D84A6DE97E2BEFB637A3CB5318AFEF0750B856CF1836BD1D4470175BE 0x4D5EFDFA143EDF74193076F174AC47CEBF2F417F:::::::
$ john hashes.txt
$ # NB: There is no --format option for this hash type

hdaa – HTTP Digest access authentication
Supported Hash Formats

$ cat hashes.txt
$response$679066476e67b5c7c4e88f04be567f8b$user$myrealm$GET$/$8c12bd8f728afe56d45a0ce846b70e5a$00000001$4b61913cec32e2c9$auth
$ john hashes.txt
$ john --format=hdaa hashes.txt

$ cat hashes.txt
username:$response$679066476e67b5c7c4e88f04be567f8b$user$myrealm$GET$/$8c12bd8f728afe56d45a0ce846b70e5a$00000001$4b61913cec32e2c9$auth
$ john hashes.txt
$ john --format=hdaa hashes.txt

$ cat hashes.txt
username:$response$679066476e67b5c7c4e88f04be567f8b$user$myrealm$GET$/$8c12bd8f728afe56d45a0ce846b70e5a$00000001$4b61913cec32e2c9$auth:::::::
$ john hashes.txt
$ john --format=hdaa hashes.txt

hmac-md5 – HMAC MD5
Supported Hash Formats

$ cat hashes.txt
what do ya want for nothing?#750c783e6ab0b503eaa86e310a5db738
$ john hashes.txt
$ john --format=hmac-md5 hashes.txt

$ cat hashes.txt
username:what do ya want for nothing?#750c783e6ab0b503eaa86e310a5db738
$ john hashes.txt
$ john --format=hmac-md5 hashes.txt

$ cat hashes.txt
username:what do ya want for nothing?#750c783e6ab0b503eaa86e310a5db738:::::::
$ john hashes.txt
$ john --format=hmac-md5 hashes.txt

hmailserver – hmailserver
Supported Hash Formats

$ cat hashes.txt
cc06fa688a64cdeea43d3c0fb761fede7e3ccf00a9daea9c79f7d458e06f88327f16dd
$ john hashes.txt
$ john --format=hmailserver hashes.txt

$ cat hashes.txt
username:cc06fa688a64cdeea43d3c0fb761fede7e3ccf00a9daea9c79f7d458e06f88327f16dd
$ john hashes.txt
$ john --format=hmailserver hashes.txt

$ cat hashes.txt
username:cc06fa688a64cdeea43d3c0fb761fede7e3ccf00a9daea9c79f7d458e06f88327f16dd:::::::
$ john hashes.txt
$ john --format=hmailserver hashes.txt

ipb2 – IPB2 MD5
Supported Hash Formats

$ cat hashes.txt
$IPB2$2e75504633$d891f03a7327639bc632d62a7f302604
$ john hashes.txt
$ john --format=ipb2 hashes.txt

$ cat hashes.txt
username:$IPB2$2e75504633$d891f03a7327639bc632d62a7f302604
$ john hashes.txt
$ john --format=ipb2 hashes.txt

$ cat hashes.txt
username:$IPB2$2e75504633$d891f03a7327639bc632d62a7f302604:::::::
$ john hashes.txt
$ john --format=ipb2 hashes.txt

krb4 – Kerberos v4 TGT
Supported Hash Formats

$ cat hashes.txt
$af$ENGIN.UMICH.EDU$44feffd06e68e30bc8890e253760858d
$ john hashes.txt
$ john --format=krb4 hashes.txt

$ cat hashes.txt
username:$af$ENGIN.UMICH.EDU$44feffd06e68e30bc8890e253760858d
$ john hashes.txt
$ john --format=krb4 hashes.txt

$ cat hashes.txt
username:$af$ENGIN.UMICH.EDU$44feffd06e68e30bc8890e253760858d:::::::
$ john hashes.txt
$ john --format=krb4 hashes.txt

krb5 – Kerberos v5 TGT
Supported Hash Formats

$ cat hashes.txt
$krb5$oskov$ACM.UIUC.EDU$4730d7249765615d6f3652321c4fb76d09fb9cd06faeb0c31b8737f9fdfcde4bd4259c31cb1dff25df39173b09abdff08373302d99ac09802a290915243d9f0ea0313fdedc7f8d1fae0d9df8f0ee6233818d317f03a72c2e77b480b2bc50d1ca14fba85133ea00e472c50dbc825291e2853bd60a969ddb69dae35b604b34ea2c2265a4ffc72e9fb811da17c7f2887ccb17e2f87cd1f6c28a9afc0c083a9356a9ee2a28d2e4a01fc7ea90cc8836b8e25650c3a1409b811d0bad42a59aa418143291d42d7b1e6cb5b1876a4cc758d721323a762e943f774630385c9faa68df6f3a94422f97
$ john hashes.txt
$ john --format=krb5 hashes.txt

$ cat hashes.txt
username:$krb5$oskov$ACM.UIUC.EDU$4730d7249765615d6f3652321c4fb76d09fb9cd06faeb0c31b8737f9fdfcde4bd4259c31cb1dff25df39173b09abdff08373302d99ac09802a290915243d9f0ea0313fdedc7f8d1fae0d9df8f0ee6233818d317f03a72c2e77b480b2bc50d1ca14fba85133ea00e472c50dbc825291e2853bd60a969ddb69dae35b604b34ea2c2265a4ffc72e9fb811da17c7f2887ccb17e2f87cd1f6c28a9afc0c083a9356a9ee2a28d2e4a01fc7ea90cc8836b8e25650c3a1409b811d0bad42a59aa418143291d42d7b1e6cb5b1876a4cc758d721323a762e943f774630385c9faa68df6f3a94422f97
$ john hashes.txt
$ john --format=krb5 hashes.txt

$ cat hashes.txt
username:$krb5$oskov$ACM.UIUC.EDU$4730d7249765615d6f3652321c4fb76d09fb9cd06faeb0c31b8737f9fdfcde4bd4259c31cb1dff25df39173b09abdff08373302d99ac09802a290915243d9f0ea0313fdedc7f8d1fae0d9df8f0ee6233818d317f03a72c2e77b480b2bc50d1ca14fba85133ea00e472c50dbc825291e2853bd60a969ddb69dae35b604b34ea2c2265a4ffc72e9fb811da17c7f2887ccb17e2f87cd1f6c28a9afc0c083a9356a9ee2a28d2e4a01fc7ea90cc8836b8e25650c3a1409b811d0bad42a59aa418143291d42d7b1e6cb5b1876a4cc758d721323a762e943f774630385c9faa68df6f3a94422f97:::::::
$ john hashe


Submitted On: 2019-05-18 20:27:41