Create a fast WORD->HASH lookup
#1
Hi everyone!

I'm running hashcat to recover a password using a wordlist+rules. The speed is quite slow, and I would like to somehow save the results of hash-evaluation. I mean - for every hash that hashcat evaluates from every word( and rule) from the wordlist - I would like to save it to mysql. So that I get a table with 2 colunms in the end: WORD and HASH, which I can then index. 
So that for the future password recoveries I would simply run an indexed search on my table, and wouldn't have to reevaluate all the hashes from my wordlist.

Question - how can I configure hashcat so that it pipes ALL the hash evaluation results to mysql (or whereever)? Is there such a mechanism?

Thanks!
#2
That's not possible with hashcat. What you are trying to create is a stupid version of a rainbow table. For fast hashes such as plain MD5 it's going to be faster to re-calculate the hashes than to store them and look them up. You'd end up with terabytes of occupied space.

edit: to back this up with some numbers:
an md5 hash has 16 bytes, lets say your average password has 10 characters/bytes and give four additional bytes for DBMS overhead per entry.

That would mean you can save 1000*1000*1000*1000/(16+10+4) = 33333333333 passwords per terabyte of space.

For MD5 a GTX1050Ti can calculate ~6037Mh/s
33333333333/(6037*1000*1000) = 5.5

That means for md5 one terabyte of space is equivalent to running hashcat for 5.5 seconds on a mid-range GPU. That only takes into consideration space, not the time you need to populate the database or to query it.

Slow hashes are usually using a salt which makes the whole thing even more useless.