TechEarl

How to Identify a Hash Type (and Find the Hashcat Mode)

Before you can crack a hash you have to know what it is. I cover identifying a hash on sight from its prefix and length, the tools that do it for you, and the part most guides skip: mapping the algorithm to the right hashcat -m mode and John format.

Ishan Karunaratne⏱️ 7 min readUpdated
Share thisCopied
Identify any hash by prefix and length or with a tool, then map it to the right hashcat -m mode and John format. Fingerprint table, dnschkr Hash Identifier, name-that-hash.

You cannot crack a hash until you know what made it. Point hashcat at an NTLM hash with the MD5 mode and it will run happily and find nothing, because it is computing the wrong function. Identifying the hash, then mapping it to the right -m mode, is step two of every crack and the step beginners most often get wrong. The good news: most hashes wear their identity on their sleeve. Verified against hashcat 7.1.2.

TL;DR

A hash's prefix and length usually give it away. Anything starting $2a$/$2b$/$2y$ is bcrypt; $argon2id$ is Argon2; $6$ is sha512crypt; $1$ is md5crypt; $P$ or $H$ is phpass (old WordPress). A bare 32-character hex string is MD5 or NTLM (you cannot tell them apart by sight, context decides). When in doubt, paste it into the dnschkr Hash Identifier or run name-that-hash. Then map the algorithm to the hashcat -m mode and crack. The mapping is the part most guides skip, and it is below.

Identify by sight: the fingerprint table

Salted password hashes use a structured format (often "Modular Crypt Format") whose prefix names the algorithm. Raw hashes have no prefix, so you identify them by length. This table covers what you will actually meet:

Looks likeAlgorithmhashcat -mJohn format
$2a$, $2b$, $2y$ prefix, 60 charsbcrypt3200bcrypt
$argon2id$ / $argon2i$ prefixArgon234000argon2
$6$ prefixsha512crypt (Linux shadow)1800sha512crypt
$5$ prefixsha256crypt7400sha256crypt
$1$ prefixmd5crypt500md5crypt
$P$ or $H$ prefixphpass (old WordPress, phpBB)400phpass
$apr1$ prefixApache APR1-MD51600md5crypt-long
32 hex chars, no prefixMD5 or NTLM0 or 1000Raw-MD5 / NT
40 hex chars, no prefixSHA-1100Raw-SHA1
64 hex chars, no prefixSHA-2561400Raw-SHA256
128 hex chars, no prefixSHA-5121700Raw-SHA512
aad3b435... in a pairLM:NTLM (Windows dump)3000 / 1000LM / NT
contains ::: , longNetNTLMv2 (responder capture)5600netntlmv2
$krb5tgs$ / $krb5asrep$Kerberos TGS-REP / AS-REP13100 / 18200krb5tgs / krb5asrep
$WPAPSK$ / WPA*WPA handshake22000wpapsk

The big trap is the 32-hex ambiguity: MD5 and NTLM are both unsalted 32-character hex strings and are visually identical. You decide by where it came from: a Windows SAM or NTDS.dit dump is NTLM (-m 1000); a web app database is most likely MD5 (-m 0). When unsure, try both.

Use a tool: the dnschkr Hash Identifier

When the prefix is unfamiliar or you have a pile of mixed hashes, let a tool fingerprint it. I use the dnschkr Hash Identifier: paste a hash and it names the algorithm out of 50-plus formats, with a confidence level and a note on where that format is used. It runs entirely in the browser, so you are not pasting a hash into someone's server log.

Try it: dnschkr Hash Identifier

The dnschkr Hash Identifier detecting a pasted bcrypt hash with high confidence, noting the $2y$ prefix and that bcrypt is used by htpasswd, WordPress 6.8+, and BSD systems.
Paste a hash and the dnschkr Hash Identifier names the algorithm. Here it flags a bcrypt hash with high confidence and explains where bcrypt is used.

Notice what it tells you about the bcrypt example above: that bcrypt is what htpasswd, WordPress 6.8+, and BSD systems use. That context matters, because it tells you immediately that you are looking at a slow hash and should reach for a wordlist, not a brute force.

The command-line tools

If you live in the terminal, two options:

  • Name-That-Hash is the current go-to. It identifies the format, ranks candidates by likelihood, and (handily) prints the hashcat mode and John format for each guess:

    bash
    pip install name-that-hash
    nth -t '$2b$12$R9h/cIPz0gi.URNNX3kh2OPST9/PgBkqquzi.Ss7KIUgO2t0jWMUW'
  • hashcat itself can guess. hashcat 7 added --identify, which lists every mode whose format matches your input:

    bash
    hashcat --identify hashes.txt

    (On some platforms --identify is less stable than name-that-hash; if it misbehaves, fall back to name-that-hash or the dnschkr tool.)

The older hash-identifier and hashid tools still work but predate many modern formats; prefer name-that-hash or the dnschkr identifier for anything current.

Why "decrypt" tools are a different thing

Search "identify hash" and you will hit sites promising to "decrypt MD5." They are not identifying or decrypting anything, they are looking your hash up in a giant table of previously-cracked hashes. If the password was cracked before, you get a hit; if not, nothing. That is a precomputed-hash lookup (often loosely called a rainbow table, though a true rainbow table is a specific time-memory structure), useful as a free first check on fast unsalted hashes, useless against anything salted, and not the same as knowing the algorithm. Identify first, then crack with the right tool.

Need to make a hash to practice on?

Learning is easier when you can generate a known hash and crack it back. The dnschkr password tools include per-algorithm generators (MD5, bcrypt via the WordPress generator, NTLM, Argon2, and more), so you can produce a hash of a word you know, identify it here, then practise cracking it.

Where to go next

Sources

Authoritative references this article was fact-checked against.

Tagshash identificationhashcat modehash typespassword crackingname-that-hash

Found this useful? Pass it on.

Copied

Ishan Karunaratne

Software Systems Architect · Senior Software Engineer · Engineering Leadership

Software systems architect and senior software engineer with more than two decades designing, building, and running production software, Linux systems, and DevOps infrastructure, and lately working AI into the stack. Now a CTO, though what I write here is drawn from the full arc of that work, across architecture, engineering, and operations, not any single job.

Keep reading

Related posts

Where Windows NTLM hashes come from, why they fall fast, the optimal hashcat attack (-m 1000), realistic crack times on modern GPUs, and how NTLM differs from NetNTLMv2.

How to Crack NTLM Hashes with Hashcat

NTLM is the hash behind Windows and Active Directory passwords, and it is fast and unsalted, which is why a password audit cracks weak ones in seconds. I cover the hashcat command, where the hashes come from, realistic crack times, and the NetNTLMv2 distinction. Tested on hashcat 7.1.2.

Why MD5 falls in seconds, the optimal hashcat attack (-m 0), salted MD5 variants, the truth about MD5 decrypt sites, and why no app should store passwords as MD5.

How to Crack an MD5 Hash with Hashcat

MD5 is the easy case: fast, unsalted, and broken for passwords, which makes it the perfect place to learn cracking. I cover the hashcat command, salted MD5 variants, why MD5 decrypt sites are not what they claim, and why MD5 has no business storing a password. Tested on hashcat 7.1.2.