password.sh 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. #!/bin/bash
  2. version=2.0
  3. John_="Yes"
  4. Hashcat_="Yes"
  5. set -e
  6. function print_centered {
  7. [[ $# == 0 ]] && return 1
  8. declare -i TERM_COLS="$(tput cols)"
  9. declare -i str_len="${#1}"
  10. [[ $str_len -ge $TERM_COLS ]] && {
  11. echo "$1";
  12. return 0;
  13. }
  14. declare -i filler_len="$(( (TERM_COLS - str_len) / 2 ))"
  15. [[ $# -ge 2 ]] && ch="${2:0:1}" || ch=" "
  16. filler=""
  17. for (( i = 0; i < filler_len; i++ )); do
  18. filler="${filler}${ch}"
  19. done
  20. printf "%s%s%s" "$filler" "$1" "$filler"
  21. [[ $(( (TERM_COLS - str_len) % 2 )) -ne 0 ]] && printf "%s" "${ch}"
  22. printf "\n"
  23. return 0
  24. }
  25. if [ $John_ = "Yes" ]
  26. then
  27. print_centered "$(tput setaf 9)"
  28. print_centered ".________ ._______ .___.__ .______ "
  29. print_centered ":____. \: .___ \ : | \ : \ "
  30. print_centered " __| :/ || : | || : || |"
  31. print_centered "| : || : || . || | |"
  32. print_centered " \__. __/ \_. ___/ |___| ||___| |"
  33. print_centered " :/ :/ |___| |___|"
  34. print_centered " : : "
  35. fi
  36. if [ $John_ = "Yes" ] && [ $Hashcat_ = "Yes" ]
  37. then
  38. echo -n -e "$(tput sgr0)"
  39. print_centered "&"
  40. fi
  41. if [ $Hashcat_ = "Yes" ]
  42. then
  43. print_centered "$(tput setaf 11)"
  44. print_centered ".___.__ .______ .________.___.__ ._______ .______ _____._"
  45. print_centered ": | \ : \ | ___/: | \ :_. ___\: \ \__ _:|"
  46. print_centered "| : || . ||___ \| : || : |/\ | . | | :|"
  47. print_centered "| . || : || /| . || / \| : | | |"
  48. print_centered "|___| ||___| ||__:___/ |___| ||. _____/|___| | | |"
  49. print_centered " |___| |___| : |___| :/ |___| |___|"
  50. print_centered " : "
  51. fi
  52. echo -n -e "$(tput sgr0)"
  53. if [ -f /tmp/tmp_txt ];then rm /tmp/tmp_txt ; fi
  54. if [ $John_ = "Yes" ]; then echo -n "John the Ripper " > /tmp/tmp_txt;fi
  55. if [ $John_ = "Yes" ] && [ $Hashcat_ = "Yes" ]; then echo -n "& " >>/tmp/tmp_txt;fi
  56. if [ $Hashcat_ = "Yes" ]; then echo -n "HaschCat " >> /tmp/tmp_txt;fi
  57. echo -n "installer Version $version" >>/tmp/tmp_txt
  58. value=`cat /tmp/tmp_txt`
  59. print_centered "$value"
  60. if [ $John_ = "Yes" ]
  61. then
  62. echo "John The Ripper install:"
  63. sudo apt-get install libbz2-dev libpcap-dev -y
  64. sudo apt-get -y install ocl-icd-opencl-dev opencl-headers pocl-opencl-icd
  65. cd /home/wareck/
  66. if [ ! -d password ];then mkdir password ;fi
  67. cd /home/wareck/password/
  68. if [ -d john ]; then rm -r -f john ;fi
  69. echo -e ""
  70. git clone https://github.com/openwall/john.git
  71. cd /home/wareck/password/john/src
  72. ./configure
  73. make -j 6
  74. echo ""
  75. fi
  76. if [ $Hashcat_ = "Yes" ]
  77. then
  78. echo "Hashcat install:"
  79. sudo apt-get install libbz2-dev libpcap-dev -y
  80. sudo apt-get -y install ocl-icd-opencl-dev opencl-headers pocl-opencl-icd
  81. cd /home/wareck/
  82. if [ ! -d password ];then mkdir password ;fi
  83. cd /home/wareck/password
  84. if [ ! -d hashcat ]
  85. then
  86. echo -e ""
  87. git clone https://github.com/hashcat/hashcat.git
  88. cd hashcat
  89. else
  90. cd hashcat
  91. git pull
  92. fi
  93. make -j 6
  94. fi
  95. echo ""
  96. echo "Done."