-
-
Save caseyrichins/8043ac33df83e296822fc79ace5dbc35 to your computer and use it in GitHub Desktop.
GRC's Perfect Passwords Generator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# GRC's Perfect Passwords Generator | |
WGET="wget" | |
FILE=`mktemp` | |
trap "shred -ufz $FILE" EXIT | |
$WGET -q --tries=10 --timeout=5 http://www.google.com -O $FILE &> /dev/null | |
[ -z "$1" ] && echo -e "\E[31mGRC's\E[37m Ultra High Security Password Generator v0.1\r\033[0m" && echo -e '--------------------------------------------------\n' && | |
echo -e '\E[37mUsage: ppassword [\E[31m-an alphanumeric\E[37m ] [\E[32m-as ascii\E[37m ] [ -hex hexadecimal ]' && exit 100 | |
case "$1" in | |
-an) | |
if [ ! -s $FILE ];then | |
echo "ERROR: Please check you internet connectivity." | |
else | |
curl -s https://www.grc.com/passwords.htm | grep alpha | head -n1 | perl -wlne 'm/font>(.*)<\/font/i && print $1' | sed -e "s/°//g" | cut -d" " -f14 | sed 's/size=2>//g' | |
fi | |
;; | |
-as) | |
if [ ! -s $FILE ];then | |
echo "ERROR: Please check you internet connectivity." | |
else | |
curl -s https://www.grc.com/passwords.htm | grep ASCII | head -n1 | perl -wlne 'm/font>(.*)<\/font/i && print $1' | sed -e "s/°//g" | cut -d" " -f14 | sed 's/size=2>//g' | |
fi | |
;; | |
-hex) | |
if [ ! -s $FILE ];then | |
echo "ERROR: Please check you internet connectivity." | |
else | |
curl -s https://www.grc.com/passwords.htm | grep hexadecimal | head -n1 | perl -wlne 'm/font>(.*)<\/font/i && print $1' | sed -e "s/°//g" | cut -d" " -f14 | sed 's/size=2>//g' | |
fi | |
;; | |
*) | |
echo -e '\E[37mUsage: ppassword [\E[31m-an alphanumeric\E[37m ] [\E[32m-as ascii\E[37m ] [\E[37m -hex hexadecimal ]' | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@jahil Here is my fork for updates to your script.