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.
$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
- Check the hash's raw structure first — length, delimiter positions, whether there's anything before or after the standard bcrypt fields. A clean 60-character
$2a$/$2b$/$2y$string with nothing extra is plain bcrypt (3200). Extra fields or a non-standard length point to a wrapped or application-specific variant. - Use an identification tool instead of eyeballing prefixes — John's own autodetect,
hashid, orname-that-hashall reason about structure rather than doing a substring match. - Treat a hashcat
--examplegrep hit as a lead, not a confirmation. If the estimated crack time looks wildly out of line with the hash's apparent strength, double-check the mode before letting it run.
The speed gap, separately
Even after fixing the mode, John still finished faster. Two compounding factors, unrelated to the mode mix-up:
- Backend. This run's hashcat was on the OpenCL CPU backend (PoCL), which reported a single thread for the bcrypt kernel. John used 4 OpenMP threads with a native SIMD-optimized bcrypt implementation.
- bcrypt is deliberately parallel-hostile. Its design goal is to resist exactly the brute-force parallelism GPUs and general-purpose frameworks are good at, so a purpose-built CPU implementation can end up ahead of a general OpenCL path, especially with no dedicated GPU in the picture.
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.