Skip to content

LearnIdentity

Password hash strength audit

Brief

An application that has run for years holds every hash format it ever used, and the old ones fall to a short wordlist in seconds. The audit sorts the hashes by algorithm and cost, runs the client's agreed wordlist, and reports cracked and shared passwords by account id, never by value.

Exam prep eJPT, OSCP

Stage
Escalation
Reviewed
On this page
  1. Check first
  2. Which hash formats are in the export, and how old?
  3. How many fall to the agreed wordlist?
  4. What do the cracked passwords look like, without printing them?
  5. Which accounts share a password?
  6. The defender sees
  7. Done when
  8. Not covered
  9. Tools
  10. Related research
  11. Reviewed

All commands

Situation
A user table export, or hashes a test found, handed over for an audit the client agreed in writing, with the wordlist and the time box set in that agreement. The hashes stay on one encrypted audit machine and are deleted when the report is out. John keeps every password it cracks, in plain text, in its pot file (~/.john/john.pot), so that file stays on the same machine and is deleted with them; no password is written into notes, evidence or the report.
Goal
A table of hash formats by count and age, the accounts whose passwords fell to the agreed wordlist, and the accounts that share an unsalted hash.
Outputs
Captured on 6 Nov 2026 in the Atarus Bench review lab, edition review-lab-0.2: John the Ripper 1.9.0 (Debian's core build) on Debian 13, against a user table a seed script writes from lab passwords with fixed salts, so every hash repeats. No client hash was used, and John's own output, which names each cracked password, was sent to /dev/null.

Check first

  • The written agreement for the audit: which export, the wordlist or how it is built, the time box, and who receives the results.
  • One encrypted machine for the hashes, no cloud cracking service, and a date the files are deleted.
  • How the application stores passwords today and what it used before, from the code or the team, so each format in the export can be dated.
  • The password policy the accounts were created under, to compare with what the audit finds.

Steps

Which hash formats are in the export, and how old?

awk -F, 'NR > 1 {print $3, $2}' users-export.csv \
  | sed -E 's/^(\$2[ab]\$[0-9]+\$)[^ ]* /\1 /; s/^\$1\$[^ ]* /$1$ /; s/^[0-9a-f]{32} /md5 /' | sort | uniq -c

Expected output

      2 $1$ 2015   # <- md5crypt, from a migration
      3 $2a$05$ 2018   # <- bcrypt at cost 5: 32 times cheaper to test than cost 10
      1 $2b$10$ 2019
      1 $2b$10$ 2023
      2 $2b$10$ 2024
      3 $2b$10$ 2025
      3 md5 2012   # <- 32 hex digits: unsalted MD5

The export has three columns: account id, the year the account was created, and the stored hash; change the field numbers to match another export. The prefix names the algorithm and, for bcrypt, the cost: $2b$10$ is bcrypt at cost 10, which doubles the work per guess for each step up. Pairing each format with the year the account was created shows the history: the app moved from unsalted MD5 to md5crypt to bcrypt and later raised the cost, but it never rehashed old accounts, so every generation is still there. A modern GPU tests billions of unsalted MD5 guesses a second, millions of md5crypt, and thousands of bcrypt at cost 10.

Negative result. Every hash uses the current algorithm and cost: Argon2id, scrypt, or bcrypt at cost 10 or more.

Fix. Rehash each account to the current scheme at its next successful login. For unsalted MD5, wrap now: store bcrypt of the MD5 value today, and replace it with bcrypt of the password at the next login, as the OWASP cheat sheet describes.

How many fall to the agreed wordlist?

awk -F, 'NR > 1 {print $1 ":" $3}' users-export.csv > users.john
for f in bcrypt md5crypt; do john --format=$f --wordlist=wordlist.txt users.john > /dev/null 2>&1; done
for f in bcrypt md5crypt; do john --show --format=$f users.john | cut -d: -f1 | grep .; done

Expected output

u1001
u1003
svc-reports   # <- a service account, which nobody resets by habit
u0412
4 password hashes cracked, 6 left   # <- bcrypt: 4 of 10
u0207
u0208
2 password hashes cracked, 0 left   # <- md5crypt: every one

The first line turns the export into John's account:hash form. John runs once per format, since it loads one format at a time, and its own output goes to /dev/null because it prints each password it finds. --show then lists the accounts it cracked; cut keeps the account id and drops the password before anything reaches the screen. The wordlist is the one agreed with the client: 30 words built from its name, seasons, years and the examples in its own policy, with no rules applied. Six accounts fell to it, including a service account and both md5crypt accounts. This John build has no format for the three unsalted MD5 hashes, so the audit is not done until they are tested too, with hashcat -m 0 or the jumbo build's Raw-MD5, under the same agreement.

Negative result. No account falls to the agreed list in the time box. Report that with the list's size and the time used, since it bounds the result.

Why this works

A wordlist does not reverse a hash: it hashes each candidate with each account's salt and compares. Cost slows each guess, but a password on the list falls whatever the cost.

Fix. Reset every cracked account, starting with service accounts, and screen new passwords against a blocklist of common, expected and breached values, as NIST SP 800-63B asks.

What do the cracked passwords look like, without printing them?

for f in bcrypt md5crypt; do
  john --show --format=$f users.john | awk -F: 'NF > 1 {p = $2; print $1, length(p),
    (p ~ /[A-Z]/ ? "upper" : "-"), (p ~ /[0-9]/ ? "digit" : "-"), (p ~ /[^A-Za-z0-9]/ ? "symbol" : "-")}'
done

Expected output

u1001 11 upper digit symbol   # <- meets a complexity rule, and fell anyway
u1003 9 upper digit symbol
svc-reports 10 upper digit -
u0412 10 upper digit -
u0207 9 upper digit -
u0208 9 - digit -

The report needs the shape of the weak passwords, not their values: each line is an account id, the length and the character classes present. Five of six have an upper case letter and a digit, and two add a symbol; they meet a typical complexity rule and fell to a 30-word list, because people meet the rule with a word, a year and a symbol. All six are 11 characters or fewer. That is the finding for the policy: composition rules did not stop guessable passwords, and a blocklist holding the company name, seasons and years would have.

Negative result. No account cracked, so there is no shape to report.

Fix. Replace composition rules with a minimum length, a blocklist check at every change, and MFA, which together are what NIST SP 800-63B recommends.

Which accounts share a password?

awk -F, 'NR > 1 && length($3) == 32 && $3 ~ /^[0-9a-f]+$/ {n[$3]++; ids[$3] = ids[$3] " " $1}
  END {for (h in n) if (n[h] > 1) print n[h] " accounts share one unsalted hash:" ids[h]}' users-export.csv

Expected output

2 accounts share one unsalted hash: u0101 u0102   # <- the same password, found without cracking

Unsalted hashes give away shared passwords without any cracking: the same password always gives the same hash. Two of the three 2012 accounts share one. The command prints the accounts and never the hash: an unsalted MD5 is as good as the password to anyone with a lookup table, so it goes into no notes and no lookup site. With salts, as in every bcrypt and md5crypt hash here, equal passwords give different hashes, so this check applies only to the unsalted generation.

Negative result. Every hash in the export is salted, or no two unsalted hashes match.

Fix. The wrap-and-rehash above removes the unsalted generation; reset the accounts that share a hash first.

The defender sees

Nothing from the cracking: it runs offline on the audit machine. The defender's events are the export itself, a full read of the user table, which the database audit log or the admin action that ran it records, and afterwards the resets. A read of the whole table outside an agreed audit is worth an alert. If no log would show who exported the table, that goes in the report beside the findings.

Done when

Every hash in the export is sorted by format and cost, the agreed wordlist has run against every format in it, and the client holds the list of account ids to reset, with no password value in it.

Not covered

Active Directory exports and NTLM hashes, online guessing (see password spraying), GPU cracking at scale, building wordlists from leaked data, and the sha512crypt and yescrypt formats of Linux shadow files, which Debian's John 1.9.0 build has no format for.