Skip to content

Cracking WordPress password hashes: phpass and the new bcrypt format

WordPress just changed how it hashes passwords. Identify legacy $P$ phpass and the new $wp$2y$ bcrypt format, and crack each with the right hashcat mode.

Published on 4 min read

WordPress powers a huge share of the web, and for its entire 20-plus-year history every one of those passwords was hashed with phpass — a portable, iterated-MD5 scheme shared with old Drupal and phpBB installs. That changed in WordPress 6.8, released April 2025: new and updated passwords now hash with bcrypt instead. A wp_users dump pulled from a real, long-running site can contain both formats at once, so cracking WordPress properly now means recognizing two completely different hash families instead of one.

Legacy phpass: the $P$ hash

Every WordPress install from 2.5 (2008) through 6.7 stored passwords like this, in the user_pass column of wp_users:

$P$9d2OMJEOHyPg11MeSv46hashcatG.F1

This is phpass, the same portable hash used by older Drupal 6 and phpBB3 installs (phpBB3 uses an $H$ prefix instead, but the algorithm is identical). The character immediately after $P$ is a cost indicator, encoding the iteration count as a power of two. WordPress's own class-phpass.php has defaulted to a log2 cost of 8 — 2⁸⁺⁵ = 8,192 MD5 iterations per guess — for essentially its entire history, so you can assume that figure unless you have reason to think a site customized it.

Crack it with hashcat mode 400 or John's phpass format:

echo '$P$9d2OMJEOHyPg11MeSv46hashcatG.F1' > hash.txt && hashcat -m 400 -a 0 hash.txt /usr/share/wordlists/rockyou.txt
echo '$P$9d2OMJEOHyPg11MeSv46hashcatG.F1' > hash.txt && john --format=phpass --wordlist=/usr/share/wordlists/rockyou.txt hash.txt

8,192 iterations of MD5 is nowhere near as slow as bcrypt or sha512crypt, but it is enough to meaningfully outrun a raw MD5 dump — expect thousands to low tens of thousands of guesses per second on a GPU rather than billions. A wordlist with rules is the right tool; a brute-force mask attack past six or seven characters stops being realistic at this speed.

The new format: $wp$2y$ bcrypt

WordPress 6.8 changed wp_hash_password() to use PHP's native password_hash() with bcrypt. Because bcrypt only looks at the first 72 bytes of its input and silently drops the rest, WordPress first runs the password through HMAC-SHA384 (keyed with the fixed string wp-sha384), base64-encodes the result, and only then feeds that into bcrypt. The stored hash looks like an ordinary bcrypt string with a wp$ tag spliced in front:

$wp$2y$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy

That pre-hash step means a plain bcrypt cracker will not verify this correctly — plain $2y$ bcrypt (mode 3200) hashes the password directly, this format hashes HMAC-SHA384(password) instead. Hashcat added a dedicated mode for exactly this, listed on its example-hashes page as "Wordpress bcrypt(hmac-sha384($pass))":

echo '$wp$2y$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy' > hash.txt && hashcat -m 35500 -a 0 hash.txt /usr/share/wordlists/rockyou.txt

As of this writing John the Ripper has no built-in format for the $wp$2y$ construction — only an open feature request for one — so hashcat mode 35500 is the practical path for this specific hash. If your build reports it as unsupported, run hashcat --example-hashes | grep -i wordpress to confirm the mode your installed version actually ships, since bridge-style modes have moved around hashcat's numbering before.

Cost-wise, this is ordinary bcrypt: the two digits after $2y$ are the cost factor, and the HMAC-SHA384 pre-hash adds one fixed, cheap step rather than materially slowing the attack down further. Treat its speed the same way you'd treat any bcrypt hash at that cost factor.

Why your dump might have both

WordPress 6.8 did not rehash existing accounts on upgrade — wp_check_password() still verifies a $P$ hash against the old phpass logic, and only replaces it with a fresh $wp$2y$ hash the next time that specific user successfully logs in or resets their password. On a site that has been running for years with infrequent logins by some accounts (a stale admin account, a long-forgotten author), you should expect a mix: recently active users on bcrypt, dormant ones still on phpass. Identify each hash by its prefix before picking a mode — $P$ or $H$ means mode 400, $wp$2y$ means mode 35500 — rather than assuming an entire table is uniform.

What this means practically

The phpass accounts in that mix are your best targets: 8,192 MD5 iterations clears a wordlist-plus-rules attack fast. The bcrypt accounts cost whatever the configured cost factor dictates, typically the PHP default of 10, which is slow enough that only weak or reused passwords are realistic hits. Either way, start with the hash type index to confirm you have the right page for the prefix in front of you, and pair the attack with a wordlist and rules setup tuned to how people actually choose WordPress admin passwords — plenty of Sitename2024!-shaped guesses, not random noise.

Related articles

Extract a crackable hash from a LUKS header or a BitLocker volume, pick the right hashcat mode for LUKS1 vs LUKS2 and user-password vs recovery-password BitLocker, and run the attack.
Extract the hash from an encrypted id_rsa or id_ed25519 with ssh2john, pick the right hashcat mode for legacy PEM keys, and know when only John the Ripper can touch a modern OpenSSH key.
Why bcrypt drops cracking throughput from billions to thousands per second: the cost factor, its GPU-hostile key schedule, and the 72-byte truncation gotcha.