First, you need to know what kind of hash it is.
Read more:
Assuming it's 512-bit SHA unsalted hash, then it'll be a bit tricky and it can take a lot of time, because it's not possible to decrypt the hashes - you've to crack them.
You may use dictionary attack or brutal force method to recover the original text from the Hash code.
Because the attack is very time consuming, you may consider to restrict as many possibilities you can by using dictionary attack.
By using a targeted technique (dictionary attack), you need to investigate or guess the expected output. Assuming it's in .onion format, you would expect the 16-character alpha-semi-numeric hash + a pseudo-top-level .onion domain. Read more: Where I can find, export or download the biggest list of all .onion addresses?.
Read the example:
Further more you can restrict the list by creating list of every page that has been online (e.g. some search engines, etc.). E.g. Ahmia.fi is gathering .onion addresses using various methods by crawling the hidden services, downloading visited page data from the Tor2web nodes, and users can use an HTML form to add new addresses.
So you can create a kind of script that reads a list of .onions, saves those into the text file. Then write the script to use the dictionary attack to crack the hash.
To increase the time, you may consider to run the attach in parallel (e.g. ask your friends or use the cloud computing).
Example of random attack in shell using Python (change 1234 to your hash):
while true; do python -c "import random,base64,codecs; print base64.b32encode(codecs.decode(codecs.encode('{0:020x}'.format(random.getrandbits(80))),'hex_codec')).lower() + '.onion';" | sha512sum; done | grep 1234
More examples, see: How to define 80-bit long variable in Python to generate random .onion addresses?
Example of dictionary attack in bash:
time cat sites.txt | xargs -L1 -I% -P4 sh -c "printf % | sha512sum" | grep 123
Where sites.txt
is your file containing list of all onion addresses.
36367763ab73783c7af284446c59466b4cd653239a311cb7116d4618dee09a8425893dc7500b464fdaf1672d7bef5e891c6e2274568926a49fb4f45132c2a8b4