π Password Cracking
Educational guide covering password hashing, hash identification, Hashcat, John the Ripper, wordlists, attack methods, common hash formats, and the interactive hash identifier.
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.
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
| Property | Hash | Encryption |
|---|---|---|
| Direction | One-way | Two-way (with key) |
| Output size | Fixed | Depends on input + mode |
| Reversible? | No | Yes, with the correct key |
| Typical use | Password storage, integrity | Confidentiality of data |
| Key required? | No | Yes |
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.
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):
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
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
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:
| Confidence | Meaning |
|---|---|
| Very likely | A unique prefix or format string matches exactly (bcrypt, Argon2, yescrypt). |
| Likely | Length and charset match a common format with few competitors. |
| Possible | Structure fits, but several algorithms share it (32 hex = MD5 or NTLM). |
| Unlikely | Weak 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
cewlon lab domains only, keep results scoped, and destroy them after reporting.
Attack Methods
Documented as a learning aid only.
| Method | Concept | Best for | Limitation |
|---|---|---|---|
| Dictionary | Tests entries from a wordlist | Weak, reused passwords | Misses unlisted values |
| Rule-Based | Mutates wordlist entries | Policy patterns | Rule quality matters |
| Mask | Structured character-class search | Known formats | Needs a known structure |
| Hybrid | Wordlist plus appended mask | Word + digits habits | Larger keyspace |
| Brute Force | Every combination in a keyspace | Very short secrets | Infeasible past ~8 chars |
| Combinator | Joins words from two lists | Passphrase habits | Grows quadratically |
| PRINCE | Builds chains from a base list | Unknown structures | Less predictable coverage |
Common Hash Types
| Format | Family | Status |
|---|---|---|
| MD5 | Fast digest | Broken for passwords |
| NTLM | Windows local/domain | Very weak, unsalted |
| bcrypt | Adaptive KDF | Good, widely supported |
| yescrypt | Memory-hard KDF | Strong, modern Linux default |
| SHA256crypt / SHA512crypt | Iterated crypt(3) | Acceptable, older Linux |
| Argon2id | Memory-hard KDF | Recommended default |
| PBKDF2 | Iterated HMAC | Acceptable with high iterations |
| SHA-1 / SHA-256 (raw) | Fast digest | Not for passwords |
| Kerberos AS-REP / TGS-REP | Windows tickets | Weak 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
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.
Related articles
System Hacking Overview
Goals of system hacking β gaining access, privilege escalation, persistence and log clearing β plus where credential hashes come from.
Credential Attacks
Credential dumping, password spraying, pass-the-hash, pass-the-ticket, token theft and the defences that stop them.
Steganography
Beginner-friendly steganography study guide: core concepts, stego vs crypto, types, tools, workflow, beginner tips and an interactive browser-only lab.
π Metasploit Framework
Complete educational guide to the Metasploit Framework, including msfconsole, modules, payloads, Meterpreter, auxiliary modules, exploitation workflow, post-exploitation, pivoting, resource scripts, plugins, troubleshooting, practical labs, and OSCP-oriented usage.