I have viewed the other questions which, were helpful, but do not answer my problem. I am trying to write a script that can assist me with college work*. I have a file containing a hash which through, "trial and error" needs to be cracked to get the final answer. The instructions specifically require jtr jumbo edition, so the list of possible formats is large. I passed all the available formats to a file called "johnformats" that contain the formats 1 per line. I want this script to run like:
$ john hash.txt --format=[cat line 1 from johnformats] > johnout
then repeat through last format value
$ john hash.txt --format=[cat line 204 from johnformats] > johnout
My script looks like this:
#!/bin/bash johnformats=$1 johnout=$2 exec 4> "$johnout" while read -ru 3 LINE; do john "$(cat hash.txt)" --format="$LINE" >&4 done 3< "$johnformats"
When run using script the hash does not load:
stat: cat hash: No such file or directory
I have tried the following removing the $hash altogether to see if any of it works:
Password files required, but none specified
repeat 204 times telling me the other part works, but
john the ripper syntax requires the hash(s) from a file.
I just need to figure out how to get it to use the contents of "hash," for each $LINE.
*note my question is not how to crack it, it is how to write a script for the tool I am using to crack it. Scripting is encouraged, but not required,and has nothing to do with the assignment. I have not memorized every possible hash prefix, and this will save me from carpel tunnel.