john.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/bin/bash
  2. version=1.3
  3. set -e
  4. function print_centered {
  5. [[ $# == 0 ]] && return 1
  6. declare -i TERM_COLS="$(tput cols)"
  7. declare -i str_len="${#1}"
  8. [[ $str_len -ge $TERM_COLS ]] && {
  9. echo "$1";
  10. return 0;
  11. }
  12. declare -i filler_len="$(( (TERM_COLS - str_len) / 2 ))"
  13. [[ $# -ge 2 ]] && ch="${2:0:1}" || ch=" "
  14. filler=""
  15. for (( i = 0; i < filler_len; i++ )); do
  16. filler="${filler}${ch}"
  17. done
  18. printf "%s%s%s" "$filler" "$1" "$filler"
  19. [[ $(( (TERM_COLS - str_len) % 2 )) -ne 0 ]] && printf "%s" "${ch}"
  20. printf "\n"
  21. return 0
  22. }
  23. print_centered "$(tput setaf 9)"
  24. print_centered ".________ ._______ .___.__ .______ "
  25. print_centered ":____. \: .___ \ : | \ : \ "
  26. print_centered " __| :/ || : | || : || |"
  27. print_centered "| : || : || . || | |"
  28. print_centered " \__. __/ \_. ___/ |___| ||___| |"
  29. print_centered " :/ :/ |___| |___|"
  30. print_centered " : : "
  31. print_centered "$(tput setaf 7)"
  32. print_centered "Version $version"
  33. sudo apt-get install libbz2-dev libpcap-dev -y
  34. sudo apt-get -y install ocl-icd-opencl-dev opencl-headers pocl-opencl-icd
  35. cd /home/wareck/
  36. if [ ! -d password ];then mkdir password ;fi
  37. cd /home/wareck/password/
  38. git clone https://github.com/openwall/john.git
  39. cd /home/wareck/password/john/src
  40. ./configure
  41. make -j4