Skip to content

Instantly share code, notes, and snippets.

@roycewilliams
Last active August 26, 2022 13:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save roycewilliams/a343489ed73a3b4e96d2df7e5201dbb4 to your computer and use it in GitHub Desktop.
Save roycewilliams/a343489ed73a3b4e96d2df7e5201dbb4 to your computer and use it in GitHub Desktop.
allbench.sh - run hashcat benchmarks one at a time
#!/bin/bash
#-----------------------------------------------------------------------
# Created: 2017-10-17
# License: MIT
# Author: tychotithonus
#-----------------------------------------------------------------------
# Get list of algorithms.
# Option 1: Harvest algorithms from interface.c
# Adjust HASHCAT_SRCDIR as needed.
HASHCAT_SRCDIR=/usr/local/src/sec/crack/hashcat/github/hashcat/src/
#ALGO_LIST=`grep case ${HASHCAT_SRCDIR}/interface.c | grep return | grep HT | cut -b10-14`
# Option 2: Use a hard-coded list of algorithms
ALGO_LIST="10 11 12 20 21 22 23 30 40 50 60 100 101 110 111 112 120 121 122 124 125 130 131 132 133 140 141 150 160 200 300 400 500 501 600 900 1000 1100 1300 1400 1410 1411 1420 1421 1430 1440 1441 1450 1460 1500 1600 1700 1710 1711 1720 1722 1730 1731 1740 1750 1760 1800 2100 2400 2410 2500 2501 2600 2611 2612 2711 2811 3000 3100 3200 3710 3711 3800 3910 4010 4110 4300 4400 4500 4520 4521 4522 4700 4800 4900 5000 5100 5200 5300 5400 5500 5600 5700 5800 6000 6100 6211 6212 6213 6221 6222 6223 6231 6232 6233 6241 6242 6243 6300 6400 6500 6600 6700 6800 6900 7000 7100 7200 7300 7400 7500 7700 7800 7900 8000 8100 8200 8300 8400 8500 8600 8700 8800 8900 9000 9100 9200 9300 9400 9500 9600 9700 9710 9720 9800 9810 9820 9900 10000 10100 10200 10300 10400 10410 10420 10500 10600 10700 10800 10900 11000 11100 11200 11300 11400 11500 11600 11700 11800 11900 12000 12001 12100 12200 12300 12400 12500 12600 12700 12800 12900 13000 13100 13200 13300 13400 13500 13600 13711 13712 13713 13721 13722 13723 13731 13732 13733 13741 13742 13743 13751 13752 13753 13761 13762 13763 13800 13900 14000 14100 14400 14600 14700 14800 14900 15000 15100 15200 15300 15400 15500 15600 15700 15900 99999"
# Adjust device list as needed.
#DEVICE_SPEC="-d 1"
#-----------------------------------------------------------------------
# Traps
trap ctrl_c INT
function ctrl_c() {
echo ""
echo "Detected Ctrl-C"
if [ -f "${OUTFILE}" ]; then
echo "Found interrupted ${OUTFILE}, removing."
rm ${OUTFILE}
fi
exit
}
#-----------------------------------------------------------------------
# Main
for algo in ${ALGO_LIST}; do
echo -en "Mode ${algo}: "
OUTFILE=hashcat_bench.m${algo}.txt
if [ ! -f "${OUTFILE}" ]; then
echo -n "running ... "
hashcat -b -O -m ${algo} --quiet ${DEVICE_SPEC} 2>&1 >${OUTFILE}
else
echo -n "found, "
fi
grep Stopped ${OUTFILE} >/dev/null
if [ $? -eq 0 ]; then
echo "OK"
else
echo "incomplete"
fi
done
#-----------------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment