This tutorial explains how to find files by hash in Windows. Here I will talk about 2 different tools for Windows to find files via their SHA1, MD5, or SHA256 hash. These tools take a folder in which you want to look for a specific file and the corresponding unique hash. After that, these software look for the file and show you the result. However, these cannot do this operation in bulk. You can only find a single file at a time by providing the hash. And not only the hash, but you can search your files via other criteria as well. You can opt to search files by content, publisher, name or a mask.
There are a lot of file search software out there which use traditional methods for searching files. But if you want to search for a specific file by its hash, then you can’t do that with those software. And that’s where the tools I have mentioned below come in handy. You just have to specify a hash value and path to the folder to start search. And then these software will show you the matching file.
How to Find Files by Hash in Windows?
To find files by hash, I have listed a free software and a small script that you can run on your PC easily. Both the tools can easily find files by their MD5 hash and yield the result. I have explained about both the tools in different sections of this article.
Find Files by Hash in Windows using Smart File Finder
Smart File Finder is a very powerful file finder software to find files in Windows using various criterias. And one of those criteria is by searching files using the hash value. It supports MD5, SHA1, SHA256, SHA512, TIGER192 and some other hash types. Just specify the hash value in the search field and the path to start the search. After that, it will show you what file matches the criteria. In the result, it shows the path and name of the file. And the result that it shows can be exported to a file.
This file search software allows you to opt for certain other options to assist the search. You can opt to include, exclude some files and folder to appear in the result. Also, you can opt to leave hidden files and subdirectories if you want. And the best part is that it supports wild card feature that you can use to narrow down the search.
Using this software to search for files by their hash is very simple. If you have a generated hash value, then you can enter that in the software. For that, run the software right after downloading it and then in Search type drop down specify the hash type that you have. After that, enter the hash value in search string box, folder to start file search, and hit the Search button. Also, before starting the search, you can opt to specify some other parameters to assist the search. It will start looking for files in the specified folder and if it finds the matching file, it will show that to you.
Find Files by Hash in Windows using a PowerShell Script
Apart from using a software to search files by hash, you can use a simple script to do the same. I found a script on GitHub that opens a window form and lets you specify a MD5 hash and a folder to search file in that. It is a simple script that you can easily execute on your Windows PC. After finding the file, matching the hash you have specified, it will show its name and path to you. However, you cannot copy that or select it.
It is very simple to use this script to search files by hash. The following steps will help you in learning how to use this script.
Step 1: Open PowerShell ISE. To open that, you can type “PowerShell” in Start and it will show up. The interface of PowerShell ISE looks like this screenshot.
Step 2: Go to this link and copy all the code. Next, paste the code on the interface of the PowerShell ISE.
Step 3: Now, to run the script, simply click on the ‘play’ button and a window will appear. You can specify the MD5 hash and path to the folder in which you want to look up for the file. Finally, hit the Search button and it will start looking for the target file. When it finds the file, it will show its name and path on its interface. See the screenshot below.
In this way, you can use this simple PowerShell script to find files by its MD5 hash. The speed of the search completely depends on the number of files inside the folder that you have specified. So, it is taking a long time to find your file, then it is okay. However, I really wish that it would have come with the option to specify filters.
Normally, file search software use the file name or any other piece of text to find files. But the software I have mentioned above uses a whole different approach to locate a file. Hash is a unique value and if you don’t know the name, or any other information except hash about a file, then you can use these software. Both the tools will easily find the target file by simply providing the hash value.