Skip to content

Instantly share code, notes, and snippets.

@jamietanna
Last active February 10, 2016 15:37
Show Gist options
  • Save jamietanna/ee2db49f16cabd3c9bf3 to your computer and use it in GitHub Desktop.
Save jamietanna/ee2db49f16cabd3c9bf3 to your computer and use it in GitHub Desktop.
G53SEC Lab2 status script - amended to provide accurate counts for hashes if the user opts to `hashcat ... --remove ...` from the `hashcat.pot` file
--- status.bak 2016-02-10 15:23:54.127656283 +0000
+++ status 2016-02-10 15:24:31.235654380 +0000
@@ -1,10 +1,11 @@
-hashcount=`wc -l ./hashes/hashdb | awk '{print $1;}'`
+hashcount=`wc -l ./hashes/hashdb.bak | awk '{print $1;}'`
if [ -f hashcat.pot ]
then
potcount=`wc -l hashcat.pot | awk '{print $1;}'`
percent=$(awk "BEGIN { pc=100*${potcount}/${hashcount}; printf(\"%.2f%%\",pc) }" )
- echo $potcount "hashes cracked," $hashcount "remaining (" $percent ")"
+ remaining=$(($hashcount - $potcount))
+ echo $potcount "hashes cracked," $remaining "remaining (" $percent ")"
else
echo "0 hashes cracked," $hashcount "remaining ( 0.0% )"
hashcount=`wc -l ./hashes/hashdb.bak | awk '{print $1;}'`
if [ -f hashcat.pot ]
then
potcount=`wc -l hashcat.pot | awk '{print $1;}'`
percent=$(awk "BEGIN { pc=100*${potcount}/${hashcount}; printf(\"%.2f%%\",pc) }" )
remaining=$(($hashcount - $potcount))
echo $potcount "hashes cracked," $remaining "remaining (" $percent ")"
else
echo "0 hashes cracked," $hashcount "remaining ( 0.0% )"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment