From 925c089035a764e63873e6012c1c6bffaf807f38 Mon Sep 17 00:00:00 2001 From: jsteube Date: Fri, 28 Dec 2018 17:30:52 +0100 Subject: [PATCH] test.sh -a 6 fixes --- tools/test.sh | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/tools/test.sh b/tools/test.sh index f307c2054..c235d073e 100755 --- a/tools/test.sh +++ b/tools/test.sh @@ -1421,23 +1421,35 @@ function attack_6() fi - mask=${mask_6[${i}]} - dict1=${OUTD}/${hash_type}_dict1 dict2=${OUTD}/${hash_type}_dict2 - if [ "${min}" -eq 0 ]; then - mask=${mask_custom} + dict1_a6=${OUTD}/${hash_type}_dict1_a6 - dict1=${OUTD}/${hash_type}_dict1_custom - dict2=${OUTD}/${hash_type}_dict2_custom + cp ${dict1} ${dict1_a6} + + pass=$(sed -n ${i}p ${OUTD}/${hash_type}_passwords.txt) + + if [ ${#pass} -le ${i} ]; then + ((i++)) + continue fi - CMD="./${BIN} ${OPTS} -a 6 -m ${hash_type} '${hash}' ${dict1} ${mask}" + echo ${pass} | cut -b -$((${#pass} - ${i})) >> ${dict1_a6} + sort -R ${dict1_a6} > ${dict1_a6}.txt + mv ${dict1_a6}.txt ${dict1_a6} + + mask="" + + for j in $(seq 1 ${i}); do + mask="${mask}?d" + done + + CMD="./${BIN} ${OPTS} -a 6 -m ${hash_type} '${hash}' ${dict1_a6} ${mask}" echo -n "[ len $i ] " &>> ${OUTD}/logfull.txt - output=$(./${BIN} ${OPTS} -a 6 -m ${hash_type} "${hash}" ${dict1} ${mask} 2>&1) + output=$(./${BIN} ${OPTS} -a 6 -m ${hash_type} "${hash}" ${dict1_a6} ${mask} 2>&1) ret=${?}