password.sh 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. export TERM=xterm-256color
  28. print_centered "$(tput setaf 9)"
  29. print_centered ".________ ._______ .___.__ .______ "
  30. print_centered ":____. \: .___ \ : | \ : \ "
  31. print_centered " __| :/ || : | || : || |"
  32. print_centered "| : || : || . || | |"
  33. print_centered " \__. __/ \_. ___/ |___| ||___| |"
  34. print_centered " :/ :/ |___| |___|"
  35. print_centered " : : "
  36. fi
  37. if [ $John_ = "Yes" ] && [ $Hashcat_ = "Yes" ]
  38. then
  39. echo -n -e "$(tput sgr0)"
  40. print_centered "&"
  41. fi
  42. if [ $Hashcat_ = "Yes" ]
  43. then
  44. print_centered "$(tput setaf 11)"
  45. print_centered ".___.__ .______ .________.___.__ ._______ .______ _____._"
  46. print_centered ": | \ : \ | ___/: | \ :_. ___\: \ \__ _:|"
  47. print_centered "| : || . ||___ \| : || : |/\ | . | | :|"
  48. print_centered "| . || : || /| . || / \| : | | |"
  49. print_centered "|___| ||___| ||__:___/ |___| ||. _____/|___| | | |"
  50. print_centered " |___| |___| : |___| :/ |___| |___|"
  51. print_centered " : "
  52. fi
  53. echo -n -e "$(tput sgr0)"
  54. if [ -f /tmp/tmp_txt ];then rm /tmp/tmp_txt ; fi
  55. if [ $John_ = "Yes" ]; then echo -n "John the Ripper " > /tmp/tmp_txt;fi
  56. if [ $John_ = "Yes" ] && [ $Hashcat_ = "Yes" ]; then echo -n "& " >>/tmp/tmp_txt;fi
  57. if [ $Hashcat_ = "Yes" ]; then echo -n "HaschCat " >> /tmp/tmp_txt;fi
  58. echo -n "installer Version $version" >>/tmp/tmp_txt
  59. value=`cat /tmp/tmp_txt`
  60. print_centered "$value"
  61. if [ $John_ = "Yes" ]
  62. then
  63. echo "John The Ripper install:"
  64. sudo apt-get install libbz2-dev libpcap-dev -y
  65. sudo apt-get -y install ocl-icd-opencl-dev opencl-headers pocl-opencl-icd
  66. cd /home/wareck/
  67. if [ ! -d password ];then mkdir password ;fi
  68. cd /home/wareck/password/
  69. if [ -d john ]; then rm -r -f john ;fi
  70. echo -e ""
  71. git clone https://github.com/openwall/john.git
  72. cd /home/wareck/password/john/src
  73. ./configure
  74. make -j 6
  75. echo ""
  76. fi
  77. if [ $Hashcat_ = "Yes" ]
  78. then
  79. echo "Hashcat install:"
  80. sudo apt-get install libbz2-dev libpcap-dev -y
  81. sudo apt-get -y install ocl-icd-opencl-dev opencl-headers pocl-opencl-icd
  82. cd /home/wareck/
  83. if [ ! -d password ];then mkdir password ;fi
  84. cd /home/wareck/password
  85. if [ ! -d hashcat ]
  86. then
  87. echo -e ""
  88. git clone https://github.com/hashcat/hashcat.git
  89. cd hashcat
  90. else
  91. cd hashcat
  92. git pull
  93. fi
  94. make -j 6
  95. fi
  96. echo ""
  97. echo "Done."