Commands / Passwords and hashes

Passwords and hashes

hashid

Also hash identifier, hash type, identify hash, hash-identifier

Names the likely algorithm of an unknown hash from its shape, so you can pick the right cracker mode.

A raw hash in a database or config carries no label, and a cracker must be told which algorithm it is before it can attack it. hashid reads a hash and prints the formats that produce a digest of that shape — its length and any prefix. A 32-character hex string is md5 (or NTLM); 40 characters is SHA-1; 64 is SHA-256; a $1$ prefix is md5crypt, $6$ is sha512crypt, $2y$ is bcrypt. The point is to choose the matching hashcat mode: guess wrong and the wrong -m cannot even load the hash, or cracks a different one and sends you down a dead end. hashid narrows the field by shape; the context (where you found it, which app wrote it) settles the rest.

hashid command usage

hashid HASH
hashid -m HASH

Options

HASH
the hash string to identify (quote it if it contains symbols)
-m
also print the matching hashcat mode number for each candidate

hashid examples

hashid da61475c8fef7bd2880ca5a1c025dee4de7e2721
Identifies a 40-character hash — SHA-1 (hashcat -m 100).
Analyzing 'da61475c…'
[+] SHA-1 
[+] Double SHA-1 
[+] RIPEMD-160
hashid 8edca3e99ceb125c2bb296138b7ceb1c1a81b8ddc1581857a8fa317565c783c9
Identifies a 64-character hash — SHA-256 (hashcat -m 1400).
hashid -m '$1$Acm3Salt$2XakqGP6LTtVRlnnCrQ.2.'
Names a $1$ hash as md5crypt and prints its hashcat mode.

Pitfalls

  • Shape alone cannot always tell formats apart (a 32-hex hash is md5 or NTLM; a 40-hex hash is SHA-1 or RIPEMD-160): use where you found it to choose between the candidates it lists.

Run it on real machines

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Sign in with Google or email to start.

Start this lab