Hashcat Picked the Wrong bcrypt Mode (and John Cracked It in 2 Seconds)

A bcrypt hash from a database dump matched a hashcat example by prefix alone — and the mode that matched was wrong. Here's why that match was misleading, and how to check a bcrypt variant properly.

Cracking the same bcrypt hash, hashcat estimated over a day to finish a rockyou.txt run. John the Ripper cracked it in 2 seconds. The hash wasn't unusually strong — hashcat was running the wrong mode the whole time.

The hash

$2a$08$zyiNvVoP/UuSMgO2rKDtLuox.vYj.3hZPVYq3i4oG3/CtgET7CjjS

Standard-looking bcrypt: a $2a$ version tag, cost factor 08, then a 22-character salt and a 31-character hash. 60 characters total, no extra delimiters.

How the wrong mode got picked

A natural first move is to grep hashcat's built-in examples for the prefix:

hashcat --example | grep -A 15 -B 15 '$2a$08'

That returned mode 33800 — WBB4 (Woltlab Burning Board) [bcrypt(bcrypt($pass))] — a double-bcrypt construction where the password is hashed twice. The example hash for that mode looks close enough to pass a glance:

$2a$08$hashcatohohohohohohohegk6PN.SFkoXxDIkacAGKFN9AF8nx.Hi

Running with -m 33800 "worked" in the sense that hashcat accepted the hash and started cracking — it just never had a real chance of finishing in reasonable time, because it was computing bcrypt twice per candidate for a hash that only needed it once.

Matching on $2a$08 alone finds every mode that starts a bcrypt hash that way — it says nothing about what happens inside the hash. A grep hit here is a lead, not a confirmation.

Why the match was misleading

Grepping for $2a$08 matches on version tag and cost factor alone, and that combination is shared by dozens of unrelated application-specific bcrypt variants — forum software, CMS plugins, custom wrappers — not just plain bcrypt. The example hash for 33800 happens to start with the same $2a$08$ prefix as plain bcrypt, but the prefix says nothing about whether there's an extra layer of hashing wrapped around the core bcrypt call — that only shows up in the mode's actual construction (bcrypt(bcrypt($pass))), not in the string format.

Switching to mode 3200 (plain bcrypt) matched the hash correctly and cracked it in line with John's result.

A better way to identify the mode

The speed gap, separately

Even after fixing the mode, John still finished faster. Two compounding factors, unrelated to the mode mix-up:

Neither tool is "better" at bcrypt in general — the gap here mostly comes from which backend actually got exercised, not from a flaw in hashcat itself.

Takeaway

A matching prefix and cost factor is not the same as a matching algorithm. Before committing to a long crack, confirm the mode against the hash's actual structure, or against an identification tool's output, rather than the first grep hit that looks similar.

Related: Restricted shell escape techniques, SSH -L forward: empty reply on localhost.

© PacketUtils. Tools run in your browser. Review every command before using it in production.HomeAboutContactPrivacy PolicyGitHub