Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <15a53-5fc0da80-f-6d5c6c00@39239343>
Date: Fri, 27 Nov 2020 11:52:15 +0100
From: "Sebastian Reitenbach" <sebastia@...-bugdead-prods.de>
To: john-users@...ts.openwall.com
Subject: cracking HMAC-SHA1 (key=salt)

Hi,

In a CTF I've got a number of hashes, this one is driving me nuts trying to crack it with john:
hash: e5d8870e5bdd26602cab8dbe07a942c8669e56d6
salt: tryhackme

The supposed to be password is: 481616481616

Identified it with hashid, gives a number of possibilities.
There are a number of writeups, all solve the CTF with hashcat.
Some of them with hashcat mode 110, others with mode 160.

hashcat mode 110 is sha1($pass.$salt), hashcat mode 160 is HMAC-SHA1 (key = $salt)
As far as I can see, hashcat mode 110 should be equivalent to JtR dynamic_24 sha1($p.$s). But that doesn't crack it.

trying to ensure dynamic_24 works as advertized:
echo -n '481616481616tryhackme' | sha1
and putting this into a hash file for john:
userID:$dynamic_24$5d0374a36358da86f4932a598485b546de204908$tryhackme

john is able to crack it, maybe the CTF writeups with hashcat mode 110 are bogus.

others writeups use hashcat mode 160, and from output of hashid:

[+] HMAC-SHA1 (key = $pass) [Hashcat Mode: 150][JtR Format: hmac-sha1]
[+] HMAC-SHA1 (key = $salt) [Hashcat Mode: 160][JtR Format: hmac-sha1]

checking here: https://www.freeformatter.com/hmac-generator.html#ad-output
giving the password and the secret key here, I indeed end up with the hash given
in the CTF, so verified the hash indeed is HMAC-SHA1 (key = $salt) .

prepared hash file for john:
tryhackme#e5d8870e5bdd26602cab8dbe07a942c8669e56d6
however, john --format=HMAC-SHA1 doesn't crack it, as it's using the password as key,
instead of the salt.

I was looking through the formats john supports, as well as the DYNAMIC documentation,
but was unable to spot anything that could help me to crack that hash with john.

Can I crack HMAC-SHA1 (key=salt) hashes with JtR, am I overlooking something?

cheers,
Sebastian

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.