Hello, aspiring Ethical Hackers. In our previous blogpost, you learnt about hash cracking. In this article, you will learn about a tool named “Name That Hash”. In cybersecurity, not all password hashes are created equal. Some are fast, outdated and easy to crack. Others are slow, salted and intentionally resistant to attacks. Before any legitimate password audit, forensic investigation or lab exercise can begin, one crucial question must be answered:
What type of hash is this?
This is where Name That Hash becomes extremely useful. It is a lightweight hash identification tool designed to analyze a hash string and predict which hashing algorithm was used to create it.
What is “Name That Hash”?
Name That Hash is a hash identification tool that examines the structure, length and character patterns of a given hash and compares them against known hashing formats. Instead of blindly guessing or manually searching online, the tool provides a shortlist of likely algorithms. It can identify over 300 types of hashes including MD5 and SHA256. The other features of this tool include displaying summaries for the hashes identified, colored output and displaying in the order of their popularity etc.
For example, we have a hash shown below:
5f4dcc3b5aa765d61d8327deb882cf99
The above hash could be:
- MD5
- NTLM
- LM (in some cases)
- Or another legacy format
Name That Hash helps narrow this down before any further analysis is attempted.
How Name That Hash works?
At a higher level, Name That Hash relies on pattern recognition rather than brute force. It evaluates:
- Hash length (32, 40, 64 characters, etc.)
- Character set (hexadecimal, base64, mixed symbols)
- Prefixes or markers (such as
$2b$ for bcrypt)
- Known format signatures
Based on this information, the tool produces:
- A ranked list of possible hash types
- Confidence indicators (depending on ambiguity)
- Contextual notes in some cases
Importantly, it does not crack hashes. It only identifies them.
Practical Walkthrough
Now, let’s see this tool’s working practically. For this, we will be using Kali Linux. It can be installed from the repository of Kali using command shown below.
sudo apt install name-that-hash
Once this tool is installed, it can be started using command “nth”. To test a single hash, we can use “nth” with option “-t” as shown below. Let’s first give it a MD5 hash and see if it can identify it.
As you can see in the above image, this tool got it right and it is also giving us some additional information like where the hash is actually used. For example, Md5 is used in Linux shadow files. What about SHA-1 hash?
It got this right too. Next, let’s give it a LM hash.
It put this in the Least likely section. Next, let’s give it a NTLM hash.
It failed to get spot on NTLM too. However, it correctly detected the SHA-512 and SHA-256 hashes.
The good thing about name-that-hash is that instead of being bland, it gives us more information about actually where the hash is used. This can be useful when you grab a collection of hashes from a target network. You can easily decide which hashes to crack and which not to crack.
If you have multiple hashes, giving it one by one can be cumbersome. Luckily, you can give them all at once by saving these hashes in a text file as shown below.
and using “-f” option to specify the text file containing hashes.
nth -f <path to the file that contains hashes>
The output which is not shown here is same as above. Name-That-Hash is only designed to identify hashes but if you have a base64 encoded string, it can be decoded by nth using the “-b64” option as shown below.
nth -b64 -t <base64 encoded string>
It correctly decoded the string. All the above hashes are also encrypted hashes of the text “hackercool”. Suppose you want the result to only display the most likely result, you can get this by using the “-a” option as shown below.
If you observe the above images, you can see the banner of name-that-hash occupying lot of space. Just like me, if this is putting you off, you canalso view results without banner using the “–no-banner” option as shown below.
Once go to the image above the above image, the one where we used the “-a” option. Once, carefully observe the result. It correctly detected the hash as SHA-512. Next to it, you can see the text “HC 1700 JtR: raw-sha512”. This is HashCat (HC stands for HashCat) and John (JtR stands for John The Ripper) information being displayed by the tool because the next thing you will do after identifying the hash is to crack it using Hashcat or John. This requires what you need to put into these tools to crack it. For example, let’s take a simpler hash.
John The Ripper says its raw-md5. We need to just supply this format as shown below in JTR to crack this.
Similarly, the HC number given is “0”. Let’s supply it as shown below in HashCat.
However, if you are an experienced ethical hacker with too much details hurting your ego, you can just view the result without the information about John The Ripper using “–no-john” option as shown below.
This is the difference.
You can do the same with HashCat information using “–no-hashcat” command as shown below.
nth --no-hashcat -t <hash>
The difference can be seen below.
Where Name That Hash is Useful?
Name That Hash plays an important role in various situations. They are,
1. Ethical Hacking and Red Team Exercises:
Helps Red teams quickly categorize password storage weaknesses without unnecessary noise.
2. Digital Forensics:
Used to identify unknown hash artifacts found during investigations.
3. CTFs and Practice Environments:
A staple tool for early-stage challenge analysis.
Conclusion
Name That Hash may seem simple, but it plays a critical role in building correct cybersecurity fundamentals. It encourages analysts to understand before acting, reduces mistakes and reinforces why secure password storage matters. In security, knowing what you’re looking at is often more important than knowing how fast you can attack it.