Sunday, December 27, 2015

BASH script for creating lookup cards

So I came up with this idea to create lookup cards. This is my own idea for premcoputed hash password lookups. Basically you read through your wordlist and create a file named for each hash. Then if you want to look up the hash you just you use cat <hash> and it will cat out the file. Once you start to have a lot of these files it will take linux a while to find them or count and index them. When you have like a million files in a folder and you ls through them it takes for ever. So probably the best way to go about this to index the files in other files. Sort them into some kind of order. Maybe loop through and sort them by the their first few characters into files then create a directory.

Anyhow this is a fast way to lookup the hashes. You can create a folder for each wordlist for each hash type. So looking up a hash is as easy as this.

cat /root/wordlists/rockyou/md5/d6a6bc0db10694a2d90e3a69648f3a03

Cat will return the plaintext hacker because the plaintext is the only thing stored in the file d6a6bc0db10694a2d90e3a69648f3a03 if that makes sense.

This look up method is as fast or faster than any other precomputed lookup method I have tried and it doesn't require any special programs to lookup the hashes.

Example:
#!/bin/bash
cat all.txt | while read line
do

echo $line | openssl sha1 |sed -e "s/(stdin)= //g" > temp1.txt
echo $line > temp2.txt
cat temp1.txt temp2.txt > temp3.txt
donkey=$(head -n 1 temp3.txt)
cat temp3.txt > "${donkey}.txt"
rm temp1.txt temp2.txt temp3.txt
done

No comments:

Post a Comment