Cybersecurity Notes intermediate

πŸ” Password Cracking

Educational guide covering password hashing, hash identification, Hashcat, John the Ripper, wordlists, attack methods, common hash formats, and the interactive hash identifier.

Updated Aug 23, 2026 7 min read 13 views
#CEH#Hashing#Passwords#Hashcat#John the Ripper#Wordlists
Back to category

Warning

This page is strictly educational. It explains how password hashes work, how to identify them and which offline tools exist for defensive research and authorised assessments. It never functions as an online cracking service.

Password Hashing

What is hashing

A password hash is the output of a one-way cryptographic function applied to a password. The same password always produces the same digest, but deriving the password from the digest should be computationally infeasible.

text
password  ──▢  [ hash function ]  ──▢  fixed-size digest
"P@ssw0rd" ──▢  [ SHA-256 ]      ──▢  6b3a55e0261b03…

Systems store the digest β€” not the password. Authentication hashes the submitted password and compares digests.

Why passwords are hashed

  • Confidentiality β€” a database breach exposes digests, not plaintext credentials.
  • Non-reversibility β€” a proper hash function cannot be inverted analytically.
  • Verifiability β€” the server can still authenticate a user by re-hashing input.
  • Separation of duties β€” administrators operate the platform without seeing user secrets.

Hash vs encryption

PropertyHashEncryption
DirectionOne-wayTwo-way (with key)
Output sizeFixedDepends on input + mode
Reversible?NoYes, with the correct key
Typical usePassword storage, integrityConfidentiality of data
Key required?NoYes

Hashing answers "is this the same value?". Encryption answers "what was the original value?". Storing passwords with encryption is an anti-pattern β€” the key becomes the crown jewel.

Common algorithms

  • Fast general-purpose hashes β€” MD5, SHA-1, SHA-256, SHA-512. Built for speed and integrity, not password storage. Trivially parallelised on GPUs.
  • Password-storage KDFs β€” bcrypt, scrypt, PBKDF2, Argon2, yescrypt. Deliberately slow and, in modern variants, memory-hard.
  • Windows-specific β€” LM (broken, disabled since Vista), NTLM (unsalted MD4 of the UTF-16LE password), NetNTLMv1/v2 (network challenge-response).

Salting

A salt is a per-user random value mixed into the hash input.

text
digest = H(salt || password)

Salting defeats rainbow tables (precomputed hash β†’ password lookups become useless per user) and duplicate detection (two users with the same password produce different digests).

A salt does not need to be secret. It only needs to be unique per credential and long enough β€” 16 bytes / 128 bits is standard.

Peppering

A pepper is a secret value, shared across the application, added to the hashing input and stored outside the credential database (for example in a KMS or app config):

text
digest = H(salt || password || pepper)

Compromise of the database alone no longer yields testable hashes β€” an attacker also needs the pepper. Peppers do not replace salts; they layer on top.

Password storage

  • Store the algorithm identifier, cost parameters, salt and digest β€” usually in one Modular Crypt Format string such as $argon2id$v=19$m=65536,t=3,p=4$salt$digest.
  • Never store plaintext, reversible encryption, or unsalted fast hashes.
  • Re-hash transparently on next login when you raise cost parameters or migrate algorithms.
  • Compare digests with constant-time functions to avoid timing leaks.

Tip

For any new system use Argon2id where available, otherwise bcrypt with cost 12 or higher, otherwise scrypt or PBKDF2-HMAC-SHA256 with high iteration counts.

Hash Identification

Hash Identifier

The interactive identifier at the bottom of this page inspects prefix, length, character set and salt structure entirely in your browser, then lists likely algorithms with example offline analysis syntax.

HashID

  • Purpose β€” identify the type of a hash from its structure.
  • Platforms β€” Python, cross-platform.
  • Typical use β€” quickly narrowing candidate algorithms during triage.
  • Reference β€” https://github.com/psypanda/hashID
bash
hashid '5f4dcc3b5aa765d61d8327deb882cf99'
hashid -m hashes.txt

Name-That-Hash

  • Purpose β€” modern hash identifier with confidence scoring and metadata.
  • Platforms β€” Python, cross-platform.
  • Typical use β€” annotated identification with Hashcat / John mode suggestions and JSON output.
  • Reference β€” https://github.com/HashPals/Name-That-Hash
bash
nth --text '5f4dcc3b5aa765d61d8327deb882cf99'
nth -f hashes.txt -g

Detecting unknown hashes

Work through the structure in order:

  • 32 hex chars β†’ MD5 or NTLM (context decides).
  • 40 hex chars β†’ SHA-1.
  • 64 / 128 hex chars β†’ SHA-256 / SHA-512.
  • Starts with $2a$ / $2b$ / $2y$ β†’ bcrypt.
  • Starts with $argon2id$ β†’ Argon2id.
  • Starts with $y$ β†’ yescrypt.
  • Starts with $6$ / $5$ / $1$ β†’ SHA-512crypt / SHA-256crypt / MD5crypt.
  • Format LM:NTLM β†’ pwdump / secretsdump output.
  • Base64 charset with == padding β†’ often LDAP {SSHA}, Django or a re-encoded raw digest.

Confidence explanation

Identification is structural inference, never proof. Many algorithms share a length and charset, so results are ranked in words rather than percentages:

ConfidenceMeaning
Very likelyA unique prefix or format string matches exactly (bcrypt, Argon2, yescrypt).
LikelyLength and charset match a common format with few competitors.
PossibleStructure fits, but several algorithms share it (32 hex = MD5 or NTLM).
UnlikelyWeak structural match only β€” confirm with context before acting.

Context beats structure: where the hash came from (SAM dump, /etc/shadow, web app database, network capture) usually settles the ambiguity.

Cracking Tools

Hashcat

  • Purpose β€” GPU-accelerated offline password auditing framework.
  • Platforms β€” Windows, Linux, macOS.
  • Reference β€” https://hashcat.net/hashcat/
  • Typical use β€” auditing your own password policy, CTF challenges, forensics on evidence you own.

John the Ripper

  • Purpose β€” long-standing offline password security auditor from Openwall.
  • Platforms β€” Windows, Linux, macOS, BSD.
  • Typical use β€” cross-format hash auditing and format research; the jumbo build adds hundreds of community formats.
  • Reference β€” https://www.openwall.com/john/

Wordlists

A wordlist is simply a candidate password dictionary. Quality beats size: a small, targeted list usually beats a huge generic one.

rockyou.txt

  • What it is β€” a 14M-entry list from the RockYou breach (2009); the de-facto teaching wordlist.
  • Educational use β€” introductory dictionary labs, CTFs, password policy analysis.
  • Lab practice β€” keep it read-only and hash lab passwords with modern KDFs to show why raw MD5/SHA-1 fails.

SecLists

  • What it is β€” curated collection by Daniel Miessler covering passwords, usernames, fuzzing payloads and discovery lists.
  • Educational use β€” targeted labs such as top-500-worst-passwords, plus directory and parameter enumeration.
  • Reference β€” https://github.com/danielmiessler/SecLists

Custom wordlists

  • What they are β€” lists derived from a target's public content: company site, bios, product names, transcripts.
  • Educational use β€” showing how weak-but-common patterns (Season + Year + !, CompanyName123) survive policies.
  • Lab practice β€” generate with tools like cewl on lab domains only, keep results scoped, and destroy them after reporting.

Attack Methods

Documented as a learning aid only.

MethodConceptBest forLimitation
DictionaryTests entries from a wordlistWeak, reused passwordsMisses unlisted values
Rule-BasedMutates wordlist entriesPolicy patternsRule quality matters
MaskStructured character-class searchKnown formatsNeeds a known structure
HybridWordlist plus appended maskWord + digits habitsLarger keyspace
Brute ForceEvery combination in a keyspaceVery short secretsInfeasible past ~8 chars
CombinatorJoins words from two listsPassphrase habitsGrows quadratically
PRINCEBuilds chains from a base listUnknown structuresLess predictable coverage

Common Hash Types

FormatFamilyStatus
MD5Fast digestBroken for passwords
NTLMWindows local/domainVery weak, unsalted
bcryptAdaptive KDFGood, widely supported
yescryptMemory-hard KDFStrong, modern Linux default
SHA256crypt / SHA512cryptIterated crypt(3)Acceptable, older Linux
Argon2idMemory-hard KDFRecommended default
PBKDF2Iterated HMACAcceptable with high iterations
SHA-1 / SHA-256 (raw)Fast digestNot for passwords
Kerberos AS-REP / TGS-REPWindows ticketsWeak with poor passwords

Best Practices

  • Prefer long passphrases or a password manager over complexity rules.
  • Always store a unique random salt per credential.
  • Add a pepper kept outside the database when your threat model needs it.
  • Use Argon2id, bcrypt or yescrypt; never raw MD5, SHA-1 or SHA-256.
  • Enable MFA so a single leaked credential is not enough.

Interactive Hash Identifier

Paste a hash below to see likely formats, matching rationale and reference commands. Runs fully in your browser.

Hash Identifier

Educational only

This tool identifies hash formats only. It does not crack passwords, recover passwords, or communicate with any server.

Example commands are reference material for authorised lab systems only. This widget never executes them and never performs offline or online password cracking.