diff --git a/VERSION.md b/VERSION.md index 1253a77..ab863fc 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1,5 +1,10 @@ # Version log +## v3.9 - Custom Brute Force + +* For the heavy lifters, you can now do custom length brute force attacks +* Changed the behavior of `trap` to not only clean temporary files but keep hash-cracker alive when intentionally or unintentionally `CTRL+C` is pressed + ## v3.8 - Keep it static * Even more ability to set static parameters diff --git a/hash-cracker.sh b/hash-cracker.sh index 17616cc..091d22d 100755 --- a/hash-cracker.sh +++ b/hash-cracker.sh @@ -2,7 +2,7 @@ # Author: crypt0rr - https://github.com/crypt0rr/ function hash-cracker () { - echo -e "\nhash-cracker v3.8 Apple Silicon Edition by crypt0rr (https://github.com/crypt0rr)" + echo -e "\nhash-cracker v3.9 Apple Silicon Edition by crypt0rr (https://github.com/crypt0rr)" } function menu () { @@ -26,9 +26,10 @@ function menu () { echo "17. Markov-chain passwords generator" echo "18. CeWL wordlist generator" echo "19. Digit remover" - echo -e "20. Stacker\n" + echo "20. Stacker" + echo -e "21. Custom brute force\n" - read -p "Please enter job number: " START + read -p "Please enter job number or type exit: " START if [[ "$START" = "0" ]] || [[ "$START" = "exit" ]]; then echo "Bye..."; exit 1 elif [[ $START = '1' ]]; then @@ -71,6 +72,8 @@ function menu () { source scripts/processors/19-digitremover.sh elif [[ $START = '20' ]]; then source scripts/processors/20-stacker.sh + elif [[ $START = '21' ]]; then + source scripts/processors/21-custom-brute-force.sh else echo -e "Not valid, try again\n"; menu fi diff --git a/scripts/parameters.sh b/scripts/parameters.sh index 5ae3295..f028694 100644 --- a/scripts/parameters.sh +++ b/scripts/parameters.sh @@ -33,7 +33,8 @@ elif [ "$1" == '--module-info' ]; then echo "17. Markov-chain password generator will generate new password sets based on Time-Space Tradeoff - https://www.cs.cornell.edu/~shmat/shmat_ccs05pwd.pdf" echo "18. Custom Word List Generator - CeWL - Spiders a given URL and creates a custom wordlist." echo "19. Will take the potfile, strip the digits from the cleartexts and perform a hybrid attack accordingly, thereafter some rules to finish the job." - echo "20. Using the stacking58.rule with a rule stacked on top of it to create even more variation on the randomness." + echo "20. Using the stacking58.rule with a rule stacked on top of it to create even more variation on the randomness." + echo "21. You can specify a lenght you want to brute-force, this will use the '?a' setting so the full charspace. Incremental approach is optional." exit 1 elif [ "$1" == '-s' ] || [ "$1" == '--search' ]; then TYPELIST="scripts/extensions/hashtypes" diff --git a/scripts/processors/1-bruteforce.sh b/scripts/processors/1-bruteforce.sh index 6d19e6e..0a1ea7c 100644 --- a/scripts/processors/1-bruteforce.sh +++ b/scripts/processors/1-bruteforce.sh @@ -1,6 +1,13 @@ #!/bin/bash # Author: crypt0rr - https://github.com/crypt0rr/ +# CTRL-C catch +function clean_up { + source hash-cracker.sh +} + +trap clean_up SIGINT SIGTERM + # Requirements if [[ "$STATICCONFIG" = true ]]; then source hash-cracker.conf diff --git a/scripts/processors/10-prefixsuffix.sh b/scripts/processors/10-prefixsuffix.sh index 01e1808..431e278 100644 --- a/scripts/processors/10-prefixsuffix.sh +++ b/scripts/processors/10-prefixsuffix.sh @@ -1,6 +1,14 @@ #!/bin/bash # Author: crypt0rr - https://github.com/crypt0rr/ +# CTRL-C catch + cleanup of temp files +function clean_up { + rm $tmp $tmp2 $tmp3 $tmp4 2>/dev/null + source hash-cracker.sh +} + +trap clean_up SIGINT SIGTERM + # Requirements if [[ "$STATICCONFIG" = true ]]; then source hash-cracker.conf @@ -9,14 +17,6 @@ else source scripts/selectors/hashlist.sh fi -# Cleanup -function clean_up { - rm $tmp $tmp2 $tmp3 $tmp4 2>/dev/null - exit -} - -trap clean_up SIGINT SIGTERM - # Temporary Files tmp=$(mktemp /tmp/hash-cracker-tmp.XXXX) tmp2=$(mktemp /tmp/hash-cracker-tmp.XXXX) diff --git a/scripts/processors/11-commonsubstring.sh b/scripts/processors/11-commonsubstring.sh index 3b232d1..a7d268f 100644 --- a/scripts/processors/11-commonsubstring.sh +++ b/scripts/processors/11-commonsubstring.sh @@ -1,6 +1,14 @@ #!/bin/bash # Author: crypt0rr - https://github.com/crypt0rr/ +# CTRL-C catch + cleanup of temp files +function clean_up { + rm $tmp $tmp2 $tmp3 $tmp4 2>/dev/null + source hash-cracker.sh +} + +trap clean_up SIGINT SIGTERM + # Requirements if [[ "$STATICCONFIG" = true ]]; then source hash-cracker.conf @@ -9,14 +17,6 @@ else source scripts/selectors/hashlist.sh fi -# Cleanup -function clean_up { - rm $tmp $tmp2 $tmp3 $tmp4 2>/dev/null - exit -} - -trap clean_up SIGINT SIGTERM - # Temporary Files tmp=$(mktemp /tmp/hash-cracker-tmp.XXXX) tmp2=$(mktemp /tmp/hash-cracker-tmp.XXXX) diff --git a/scripts/processors/12-pack-rule.sh b/scripts/processors/12-pack-rule.sh index 27cf81e..5d2c564 100644 --- a/scripts/processors/12-pack-rule.sh +++ b/scripts/processors/12-pack-rule.sh @@ -1,6 +1,14 @@ #!/bin/bash # Author: crypt0rr - https://github.com/crypt0rr/ +# CTRL-C catch + cleanup of temp files +function clean_up { + rm $tmp analysis.rule 2>/dev/null + source hash-cracker.sh +} + +trap clean_up SIGINT SIGTERM + # Requirements if [[ "$STATICCONFIG" = true ]]; then source hash-cracker.conf @@ -9,14 +17,6 @@ else source scripts/selectors/hashlist.sh fi -# Cleanup -function clean_up { - rm $tmp analysis.rule 2>/dev/null - exit -} - -trap clean_up SIGINT SIGTERM - # Temporary Files tmp=$(mktemp /tmp/hash-cracker-tmp.XXXX) diff --git a/scripts/processors/13-pack-mask.sh b/scripts/processors/13-pack-mask.sh index 48c518c..c561cb4 100644 --- a/scripts/processors/13-pack-mask.sh +++ b/scripts/processors/13-pack-mask.sh @@ -1,6 +1,14 @@ #!/bin/bash # Author: crypt0rr - https://github.com/crypt0rr/ +# CTRL-C catch + cleanup of temp files +function clean_up { + rm $tmp $tmp2 $tmp3 2>/dev/null + source hash-cracker.sh +} + +trap clean_up SIGINT SIGTERM + # Requirements if [[ "$STATICCONFIG" = true ]]; then source hash-cracker.conf @@ -9,14 +17,6 @@ else source scripts/selectors/hashlist.sh fi -# Cleanup -function clean_up { - rm $tmp $tmp2 $tmp3 2>/dev/null - exit -} - -trap clean_up SIGINT SIGTERM - # Temporary Files tmp=$(mktemp /tmp/hash-cracker-tmp.XXXX) tmp2=$(mktemp /tmp/hash-cracker-tmp.XXXX) diff --git a/scripts/processors/14-fingerprint.sh b/scripts/processors/14-fingerprint.sh index 419b909..053333c 100644 --- a/scripts/processors/14-fingerprint.sh +++ b/scripts/processors/14-fingerprint.sh @@ -1,6 +1,14 @@ #!/bin/bash # Author: crypt0rr - https://github.com/crypt0rr/ +# CTRL-C catch + cleanup of temp files +function clean_up { + rm $tmp $tmp2 2>/dev/null + source hash-cracker.sh +} + +trap clean_up SIGINT SIGTERM + # Requirements if [[ "$STATICCONFIG" = true ]]; then source hash-cracker.conf @@ -9,14 +17,6 @@ else source scripts/selectors/hashlist.sh fi -# Cleanup -function clean_up { - rm $tmp $tmp2 2>/dev/null - exit -} - -trap clean_up SIGINT SIGTERM - # Temporary Files tmp=$(mktemp /tmp/hash-cracker-tmp.XXXX) tmp2=$(mktemp /tmp/hash-cracker-tmp.XXXX) diff --git a/scripts/processors/15-multiple-wordlists.sh b/scripts/processors/15-multiple-wordlists.sh index 8949c53..629b9fa 100644 --- a/scripts/processors/15-multiple-wordlists.sh +++ b/scripts/processors/15-multiple-wordlists.sh @@ -1,6 +1,13 @@ #!/bin/bash # Author: crypt0rr - https://github.com/crypt0rr/ +# CTRL-C catch +function clean_up { + source hash-cracker.sh +} + +trap clean_up SIGINT SIGTERM + # Requirements if [[ "$STATICCONFIG" = true ]]; then source hash-cracker.conf diff --git a/scripts/processors/16-usernameaspassword.sh b/scripts/processors/16-usernameaspassword.sh index c2722de..52a7ef9 100644 --- a/scripts/processors/16-usernameaspassword.sh +++ b/scripts/processors/16-usernameaspassword.sh @@ -1,6 +1,14 @@ #!/bin/bash # Author: crypt0rr - https://github.com/crypt0rr/ +# CTRL-C catch + cleanup of temp files +function clean_up { + rm $tmp 2>/dev/null + source hash-cracker.sh +} + +trap clean_up SIGINT SIGTERM + # Requirements if [[ "$STATICCONFIG" = true ]]; then source hash-cracker.conf @@ -13,14 +21,6 @@ fi source scripts/rules/rules.config RULELIST=($big $fbfull $d3ad0ne $d3adhob0 $digits1 $digits2 $digits3 $dive $fordyv1 $generated2 $generated3 $hob064 $huge $leetspeak $NSAKEYv2 $ORTRTS $OUTD $pantag $passwordpro $rockyou30000 $techtrip2 $tenKrules $toggles1 $toggles2 $toprules2020 $TOXIC10k $TOXICSP $williamsuper) -# Cleanup -function clean_up { - rm $tmp 2>/dev/null - exit -} - -trap clean_up SIGINT SIGTERM - # Temporary Files tmp=$(mktemp /tmp/hash-cracker-tmp.XXXX) diff --git a/scripts/processors/17-markov-generator.sh b/scripts/processors/17-markov-generator.sh index 53d1c14..ae2aa7c 100644 --- a/scripts/processors/17-markov-generator.sh +++ b/scripts/processors/17-markov-generator.sh @@ -1,6 +1,14 @@ #!/bin/bash # Author: crypt0rr - https://github.com/crypt0rr/ +# CTRL-C catch + cleanup of temp files +function clean_up { + rm $tmp $tmp2 2>/dev/null + source hash-cracker.sh +} + +trap clean_up SIGINT SIGTERM + # Requirements if [[ "$STATICCONFIG" = true ]]; then source hash-cracker.conf @@ -13,14 +21,6 @@ fi source scripts/rules/rules.config RULELIST=($rule3 $rockyou30000 $ORTRTS $fbfull $pantag $OUTD $techtrip2 $TOXICSP $passwordpro $d3ad0ne $d3adhob0 $generated2 $toprules2020 $hob064 $leetspeak) -# Cleanup -function clean_up { - rm $tmp $tmp2 2>/dev/null - exit -} - -trap clean_up SIGINT SIGTERM - # Temporary Files tmp=$(mktemp /tmp/hash-cracker-tmp.XXXX) tmp2=$(mktemp /tmp/hash-cracker-tmp.XXXX) diff --git a/scripts/processors/18-cewl.sh b/scripts/processors/18-cewl.sh index 38e8485..c63a951 100644 --- a/scripts/processors/18-cewl.sh +++ b/scripts/processors/18-cewl.sh @@ -1,6 +1,13 @@ #!/bin/bash # Author: crypt0rr - https://github.com/crypt0rr/ +# CTRL-C catch +function clean_up { + source hash-cracker.sh +} + +trap clean_up SIGINT SIGTERM + # Logic read -p "Please enter the full URL to spider (e.g. https://kb.offsec.nl): " URL read -p "Output name for the CeWL wordlist: " CEWLLIST diff --git a/scripts/processors/19-digitremover.sh b/scripts/processors/19-digitremover.sh index 9a2cdbd..dd88e75 100644 --- a/scripts/processors/19-digitremover.sh +++ b/scripts/processors/19-digitremover.sh @@ -1,6 +1,14 @@ #!/bin/bash # Author: crypt0rr - https://github.com/crypt0rr/ +# CTRL-C catch + cleanup of temp files +function clean_up { + rm $tmp 2>/dev/null + source hash-cracker.sh +} + +trap clean_up SIGINT SIGTERM + # Requirements if [[ "$STATICCONFIG" = true ]]; then source hash-cracker.conf @@ -13,14 +21,6 @@ fi source scripts/rules/rules.config RULELIST=($fbfull $ORTRTS $NSAKEYv2 $techtrip2) -# Cleanup -function clean_up { - rm $tmp 2>/dev/null - exit -} - -trap clean_up SIGINT SIGTERM - # Temporary Files tmp=$(mktemp /tmp/hash-cracker-tmp.XXXX) diff --git a/scripts/processors/2-light.sh b/scripts/processors/2-light.sh index 3e30d92..651b338 100644 --- a/scripts/processors/2-light.sh +++ b/scripts/processors/2-light.sh @@ -1,6 +1,13 @@ #!/bin/bash # Author: crypt0rr - https://github.com/crypt0rr/ +# CTRL-C catch +function clean_up { + source hash-cracker.sh +} + +trap clean_up SIGINT SIGTERM + # Requirements if [[ "$STATICCONFIG" = true ]]; then source hash-cracker.conf diff --git a/scripts/processors/20-stacker.sh b/scripts/processors/20-stacker.sh index dc9a3d5..a1ba349 100644 --- a/scripts/processors/20-stacker.sh +++ b/scripts/processors/20-stacker.sh @@ -1,6 +1,13 @@ #!/bin/bash # Author: crypt0rr - https://github.com/crypt0rr/ +# CTRL-C catch +function clean_up { + source hash-cracker.sh +} + +trap clean_up SIGINT SIGTERM + # Requirements if [[ "$STATICCONFIG" = true ]]; then source hash-cracker.conf diff --git a/scripts/processors/21-custom-brute-force.sh b/scripts/processors/21-custom-brute-force.sh new file mode 100644 index 0000000..e0d8401 --- /dev/null +++ b/scripts/processors/21-custom-brute-force.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# Author: crypt0rr - https://github.com/crypt0rr/ + +RESTART="source scripts/processors/21-custom-brute-force.sh" + +# CTRL-C catch +function clean_up { + source hash-cracker.sh +} + +trap clean_up SIGINT SIGTERM + +# Requirements +if [[ "$STATICCONFIG" = true ]]; then + source hash-cracker.conf +else + source scripts/selectors/hashtype.sh + source scripts/selectors/hashlist.sh +fi + +# Logic +read -p "Heavy lifting? How much chars are we going to brute-force? (1-99): " CHARS +TARGET='' +[ -n "$CHARS" ] && [ "$CHARS" -eq "$CHARS" ] 2>/dev/null +if [ $? -ne 0 ]; then + echo $CHARS is not a number.; $RESTART +elif [[ "$CHARS" < 1 ]]; then + echo NO!; $RESTART + else + for i in $(seq 1 $CHARS); do + TARGET+="?a" + done +fi + +read -p "Enable increment? (y/n) " INCREMENT + +if [ "$INCREMENT" == 'y' ]; then + INCREMENT='--increment' +elif [ "$INCREMENT" == 'n' ]; then + INCREMENT='' +else + $RESTART +fi + +$HASHCAT $KERNEL --bitmap-max=24 $HWMON --potfile-path=$POTFILE -m$HASHTYPE $HASHLIST -a3 $TARGET $INCREMENT + +echo -e "\nCustom Brute Force Processing Done\n" \ No newline at end of file diff --git a/scripts/processors/3-heavy.sh b/scripts/processors/3-heavy.sh index 45e8976..34ea4b4 100644 --- a/scripts/processors/3-heavy.sh +++ b/scripts/processors/3-heavy.sh @@ -1,6 +1,13 @@ #!/bin/bash # Author: crypt0rr - https://github.com/crypt0rr/ +# CTRL-C catch +function clean_up { + source hash-cracker.sh +} + +trap clean_up SIGINT SIGTERM + # Requirements if [[ "$STATICCONFIG" = true ]]; then source hash-cracker.conf diff --git a/scripts/processors/4-word.sh b/scripts/processors/4-word.sh index 463bcfa..ffc96fe 100644 --- a/scripts/processors/4-word.sh +++ b/scripts/processors/4-word.sh @@ -1,6 +1,14 @@ #!/bin/bash # Author: crypt0rr - https://github.com/crypt0rr/ +# CTRL-C catch + cleanup of temp files +function clean_up { + rm $tmp 2>/dev/null + source hash-cracker.sh +} + +trap clean_up SIGINT SIGTERM + # Requirements if [[ "$STATICCONFIG" = true ]]; then source hash-cracker.conf @@ -13,14 +21,6 @@ fi source scripts/rules/rules.config RULELIST=($tenKrules $NSAKEYv2 $fordyv1 $pantag $OUTD $techtrip2 $williamsuper $digits3 $dive) -# Cleanup -function clean_up { - rm $tmp 2>/dev/null - exit -} - -trap clean_up SIGINT SIGTERM - # Temporary Files tmp=$(mktemp /tmp/hash-cracker-tmp.XXXX) diff --git a/scripts/processors/5-word-bruteforce.sh b/scripts/processors/5-word-bruteforce.sh index b998386..06de8e9 100644 --- a/scripts/processors/5-word-bruteforce.sh +++ b/scripts/processors/5-word-bruteforce.sh @@ -1,6 +1,14 @@ #!/bin/bash # Author: crypt0rr - https://github.com/crypt0rr/ +# CTRL-C catch + cleanup of temp files +function clean_up { + source hash-cracker.sh + rm $tmp 2>/dev/null +} + +trap clean_up SIGINT SIGTERM + # Requirements if [[ "$STATICCONFIG" = true ]]; then source hash-cracker.conf @@ -9,14 +17,6 @@ else source scripts/selectors/hashlist.sh fi -# Cleanup -function clean_up { - rm $tmp 2>/dev/null - exit -} - -trap clean_up SIGINT SIGTERM - # Temporary Files tmp=$(mktemp /tmp/hash-cracker-tmp.XXXX) diff --git a/scripts/processors/6-hybrid.sh b/scripts/processors/6-hybrid.sh index b0cb3db..03e705e 100644 --- a/scripts/processors/6-hybrid.sh +++ b/scripts/processors/6-hybrid.sh @@ -1,6 +1,13 @@ #!/bin/bash # Author: crypt0rr - https://github.com/crypt0rr/ +# CTRL-C catch +function clean_up { + source hash-cracker.sh +} + +trap clean_up SIGINT SIGTERM + # Requirements if [[ "$STATICCONFIG" = true ]]; then source hash-cracker.conf diff --git a/scripts/processors/7-toggle.sh b/scripts/processors/7-toggle.sh index d53ff72..0192f80 100644 --- a/scripts/processors/7-toggle.sh +++ b/scripts/processors/7-toggle.sh @@ -1,6 +1,13 @@ #!/bin/bash # Author: crypt0rr - https://github.com/crypt0rr/ +# CTRL-C catch +function clean_up { + source hash-cracker.sh +} + +trap clean_up SIGINT SIGTERM + # Requirements if [[ "$STATICCONFIG" = true ]]; then source hash-cracker.conf diff --git a/scripts/processors/8-combinator.sh b/scripts/processors/8-combinator.sh index 1f969f3..2f89f9a 100644 --- a/scripts/processors/8-combinator.sh +++ b/scripts/processors/8-combinator.sh @@ -1,6 +1,13 @@ #!/bin/bash # Author: crypt0rr - https://github.com/crypt0rr/ +# CTRL-C catch +function clean_up { + source hash-cracker.sh +} + +trap clean_up SIGINT SIGTERM + # Requirements if [[ "$STATICCONFIG" = true ]]; then source hash-cracker.conf diff --git a/scripts/processors/9-iterate.sh b/scripts/processors/9-iterate.sh index 9a3ed85..9cda607 100644 --- a/scripts/processors/9-iterate.sh +++ b/scripts/processors/9-iterate.sh @@ -1,6 +1,14 @@ #!/bin/bash # Author: crypt0rr - https://github.com/crypt0rr/ +# CTRL-C catch + cleanup of temp files +function clean_up { + rm $tmp 2>/dev/null + source hash-cracker.sh +} + +trap clean_up SIGINT SIGTERM + # Requirements if [[ "$STATICCONFIG" = true ]]; then source hash-cracker.conf @@ -13,14 +21,6 @@ fi source scripts/rules/rules.config RULELIST=($rule3 $robotmyfavorite $fbfull $tenKrules $NSAKEYv2 $fordyv1 $pantag $OUTD $TOXICSP $techtrip2 $williamsuper $digits3 $dive $TOXIC10k $big $generated3 $huge) -# Cleanup -function clean_up { - rm $tmp 2>/dev/null - exit -} - -trap clean_up SIGINT SIGTERM - # Temporary Files tmp=$(mktemp /tmp/hash-cracker-tmp.XXXX)