Advertisement
UbuntuSaurio

Crunch_Size

Dec 3rd, 2011
537
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.64 KB | None | 0 0
  1. #!/bin/bash
  2. #crunch wordlist size checker v0.2
  3. #by TAPE September 2010
  4. #
  5. #Colours
  6. #=======
  7. green=$(tput setaf 2 && tput bold)
  8. red=$(tput setaf 1 && tput bold)
  9. stand=$(tput sgr 0)
  10. #
  11. clear
  12. #
  13. echo
  14. echo $green"WILL YOU HAVE ENOUGH SPACE FOR YOUR CRUNCH WORDLIST ?!"
  15. echo "======================================================"
  16. echo "Calculation: (x^y)*(y+1) = size in bytes"
  17. echo "x= number of characters"
  18. echo "y= length of the word"
  19. echo
  20. echo $stand"Choose the number of characters that will be used making the wordlist"
  21. echo "====================================================================="
  22. echo "Example ;"
  23. echo $red"10 $stand = Numeric only"
  24. echo $red"16 $stand = Hexadecimal"
  25. echo $red"26 $stand = Alpha only"
  26. echo $red"33 $stand = Special characters including space"
  27. echo $red"36 $stand = Alpha + Numeric"
  28. echo $red"52 $stand = Lowercase+Uppercase alpha"
  29. echo $red"62 $stand = Lower+Uppercase alpha + Numeric"
  30. echo $red"95 $stand = Lower+Uppercase alpha +Numeric+SpecialCharacters including space"
  31. echo
  32. echo -ne "Enter number of characters to be used:$red \c"
  33. read X
  34. echo -ne $stand"Enter length of words/passphrases: $red\c"
  35. read Y
  36. clear
  37. (tput sgr 0)
  38. echo
  39. echo $stand"Number of characters with which wordlist will be created: $red$X"
  40. echo $stand"Length of the words/passphrases in wordlist: $red$Y"
  41. echo $stand"-------------------------------------------------------------"
  42. #
  43. # Calculations based on binary sizes ;
  44. # For comma seperated values for groups of 3 digits pipe the below calculation out through sed ;
  45. # sed -r ':L;s=\b([0-9]+)([0-9]{3})\b=\1,\2=g;t L'
  46. B=$( echo "scale=3;($X^$Y)*($Y+1)" | bc )
  47. KB=$( echo "scale=3;($X^$Y)*($Y+1) / 1024" | bc )
  48. MB=$( echo "scale=3;(($X^$Y)*($Y+1)/1024)/1024" | bc )
  49. GB=$( echo "scale=3;((($X^$Y)*($Y+1)/1024)/1024)/1024" | bc )
  50. TB=$( echo "scale=3;(((($X^$Y)*($Y+1)/1024)/1024)/1024)/1024" | bc )
  51. PB=$( echo "scale=3;((((($X^$Y)*($Y+1)/1024)/1024)/1024)/1024)/1024" | bc )
  52. #
  53. # Calculation for number of results ;
  54. # For comma seperated values for groups of 3 digits pipe the below calculation out through sed ;
  55. # sed -r ':L;s=\b([0-9]+)([0-9]{3})\b=\1,\2=g;t L'
  56. NMBR=$( echo "($X^$Y)" | bc )
  57. echo
  58. #
  59. # Outcome of calculations ;
  60. echo $stand"Number of words/passphrases in wordlist: $green$NMBR"
  61. (tput sgr 0)
  62. echo
  63. echo $stand"Estimated wordlist size ; "
  64. echo $green"B  $stand(Bytes)     = $green$B"
  65. echo $green"KB $stand(Kilobytes) = $green$KB"
  66. echo $green"MB $stand(Megabytes) = $green$MB"
  67. echo $green"GB $stand(Gigabytes) = $green$GB"
  68. echo $green"TB $stand(Terabytes) = $green$TB"
  69. echo $green"PB $stand(Petabytes) = $green$PB"
  70. (tput sgr 0)
  71. echo
  72. exit
  73. #
  74. #Last edit 27-09-2010
  75.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement