Guest User

Untitled

a guest
Apr 11th, 2019
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.11 KB | None | 0 0
  1. printf "                                                    \n"
  2. printf "                                                     \n"
  3. printf " _____ _                 _            _               \n"
  4. printf "/__  /(_)_ __ ___  _ __ | | ___      / \   ___ ___ ___ \n"
  5. printf "\___ \| | '_   _ \| '_ \| |/ _ \    / _ \ / __/ __/ __| \n"
  6. printf " ___) | | | | | | | |_) | |  __/   / ___ \ (_| (__\__ |  \n"
  7. printf "|____/|_|_| |_| |_| .__/|_|\___/  / /   \_\___\___|___/   \n"
  8. printf "                  | |                                      \n"
  9. printf "                  |_|    Author: @ihatemodels (Github)      \n"
  10. printf "                                  Gergin Darakov             \n"
  11. printf "                                                              \n"
  12. printf "[*] Simple password generator with username and location assign\n"
  13. printf "                                                                \n"
  14. printf "[+] Hint: encrypt the output if you plan to store virtual  ;)    \n"
  15. printf "                                                                  \n"
  16. printf "                                                                   \n"
  17.  
  18.  
  19. read -p $'[+] Please enter how many accounts you want to assign with a passwords:\n' ACCOUNTS
  20. read -p  $'[+] Do you want to store the log-in location of your Accounts [y/n]:\n'  CHECK_LOCATION
  21.  
  22. declare -i y=ACCOUNTS
  23. counter=1
  24.  
  25. function generate () {
  26.     PASS=$(pwgen -n -y -c $PASSLENGHT 1)
  27.     echo $PASS
  28. }
  29.  
  30.  
  31.  
  32.  
  33. if  test $y == 1
  34. then
  35.     read -p $'[+]Please enter the password length:\n'  PASSLENGHT
  36.     read -p $'[+]Please enter email or username to assign the generated password:\n ' USERNAME
  37.     PASSWORD=$(generate)
  38.     if [ "$CHECK_LOCATION" == "y" ]
  39.     then
  40.         read -p $'[+]Please enter the url for the generated pair: \n ' LOCATION
  41.         echo   "[+]The password $PASSWORD is assign to $USERNAME for $LOCATION "
  42.         echo  "Location: $LOCATION      Username: $USERNAME         Password: $PASSWORD" >> Accounts.txt
  43.     else
  44.    
  45.         echo  "[+]The password $PASSWORD is assign to $USERNAME "
  46.         echo  "Username: $USERNAME      Password: $PASSWORD" >> Accounts.txt  
  47.     fi
  48.  
  49. elif  test $y > 1
  50. then
  51.     while [[ $y > 0 ]]; do
  52.        
  53.         printf "[*][*] Setting account $counter [*][*]\n *...........................*\n"  
  54.          
  55.         if [ "$CHECK_LOCATION" == "y" ]
  56.         then
  57.         read -p $'[+]Please enter the password length: \n '  PASSLENGHT ;
  58.         PASSWORD_MORE=$(generate)
  59.         read -p $'[+]Please enter email or username to assign the generated password:\n ' USERNAME
  60.         read -p $'[+]Please enter the url for the generated pair:\n ' LOCATION
  61.         echo  "[+]The password $PASSWORD_MORE is assign to $USERNAME for $LOCATION"
  62.         echo  "Location: $LOCATION      Username: $USERNAME         Password: $PASSWORD_MORE" >> Accounts.txt
  63.         else
  64.         read -p $'[+]Please enter the password length: \n '  PASSLENGHT ;
  65.         PASSWORD_MORE=$(generate)
  66.         read -p $'[+]Please enter email or username to assign the generated password: \n' USERNAME
  67.         echo  "[+]The password $PASSWORD_MORE is assign to $USERNAME "
  68.         echo  "Username: $USERNAME      Password: $PASSWORD_MORE" >> Accounts.txt  
  69.         fi
  70.         ((y--))
  71.         ((counter++))
  72.      done
  73.  
  74. else
  75.     exit
  76. fi
Add Comment
Please, Sign In to add comment