├── README.md ├── passgen.cfg └── passgen.sh /README.md: -------------------------------------------------------------------------------- 1 | ### README 2 | 3 | 4 | Password generator through a simple wordlist. 5 | You can use this tool to create a **new wordlist** with **numbers** and **special characters**. 6 | 7 | ### FORMAT TYPE 8 |
 9 | wns -> Word + Number + Special Char -> password0!
10 | wsn -> Word + Special Char + Number -> password!0
11 | nws -> Number + Word + Special Char -> 0password!
12 | nsw -> Number + Special Char + Word -> 0!password
13 | snw -> Special Char + Number + Word -> !0password
14 | swn -> Special Char + Word + Number -> !password0
15 | 
16 | 17 | ### USAGE 18 | 19 | You must to configure the parameters of the file passgen.cfg
20 | Start passgen with: 21 |
22 | ./passgen.sh
23 | 
24 | or 25 |
26 | ./passgen.sh -i [file input] -o [file output]
27 | 
28 |
29 | [+] Ready for 367920 passwords
30 | [+] Password format: wns
31 | [+] Password Type: Adamo0!
32 | [+] File output: output.txt
33 | 
34 | Press [Enter] key to start or [Ctrl+C] key to stop...
35 | 
36 | Started: gio 14 mar 2013, 20.14.19, CET
37 | Stopped: gio 14 mar 2013, 20.14.52, CET
38 | 
39 | It took a few seconds to generate 367.920 password. Now you can verify the file with the password you just created. 40 |
41 | cat output.txt
42 | 
43 |
44 | Adamo1970!
45 | Adamo1970@
46 | Adamo1970$
47 | Adamo1970%
48 | ::
49 | Adamo2013!
50 | Adamo2013@
51 | Adamo2013$
52 | Adamo2013%
53 | ::
54 | Zuckerberg1970!
55 | Zuckerberg1970@
56 | Zuckerberg1970$
57 | Zuckerberg1970%
58 | ::
59 | Zuckerberg2013!
60 | Zuckerberg2013@
61 | Zuckerberg2013$
62 | Zuckerberg2013%
63 | 
64 | 65 | ### MD5 WORDLIST 66 | 67 |
68 | cat output.txt | while read word; do echo $word | md5sum | sed "s/  -/:$word/"; done
69 | 
70 |
71 | c60c5d16ea78a5bffdb6de806a1691a7:Adamo1970!
72 | c3f756875a106300873961571a8f4810:Adamo1970@
73 | 13f296e5f7427bc9d9f564fd66cba93b:Adamo1970$
74 | 00bc8d1a13859e8d5c0141555f99867e:Adamo1970.
75 | ::
76 | 
77 | 78 | ### OTHER 79 | 80 | This script is currently maintained by Gianni 'guelfoweb' Amato, who can be contacted at guelfoweb@gmail.com. Suggestions and criticism are welcome. 81 | 82 | Enjoy! 83 | -------------------------------------------------------------------------------- /passgen.cfg: -------------------------------------------------------------------------------- 1 | ################## PASSGEN CONFIGURATION FILE ################### 2 | 3 | ## PATH TO WORDLIST IN INPUT: 4 | wordlist=/usr/share/dict/italian 5 | 6 | ##---------------------------------------------------------------- 7 | 8 | ## PATH TO NEW WORDLIST IN OUTPUT: 9 | newwordlist=output.txt 10 | 11 | ##---------------------------------------------------------------- 12 | 13 | ## DECLARE NUMBER OF CHARACTERS "min,max": 14 | ## if you set chars=4,6 then passgen select from wordlist words 15 | ## that have a minimum of 4 characters and a maximum of 6. 16 | ## adam | 4 chars : ok 17 | ## albert | 6 chars : ok 18 | ## red | 3 chars : no 19 | ## richard | 7 chars : no 20 | ## range | 5 chars : ok 21 | chars=4,6 22 | 23 | ##---------------------------------------------------------------- 24 | 25 | ## UPPER CASE FOR FIRST CHAR "true or false": 26 | ## if you want the first character uppercase. 27 | ## u=true -> Password 28 | ## u=false -> password 29 | u=true 30 | #u=false 31 | 32 | ##---------------------------------------------------------------- 33 | 34 | ## INTEGER VALUE IN SEQUENCE "from -> to": 35 | ## password0 36 | ## password1 37 | ## :: 38 | ## password9 39 | nstart=0 40 | nend=9 41 | 42 | ##---------------------------------------------------------------- 43 | 44 | ## DECLARE SPECIAL CHAR LIST: 45 | ## password! 46 | specialchar[0]=! 47 | specialchar[1]=@ 48 | specialchar[2]=$ 49 | specialchar[3]=. 50 | #specialchar[4]=% 51 | #specialchar[5]=& 52 | 53 | ##---------------------------------------------------------------- 54 | 55 | ## PASSWORD FORMAT TYPE: 56 | ## Legenda: 57 | ## w = word 58 | ## n = number 59 | ## s = special char 60 | 61 | ## wns -> password1! 62 | ## wsn -> password!1 63 | ## nws -> 1password! 64 | ## swn -> !password1 65 | ## nsw -> 1!password 66 | ## snw -> !1password 67 | 68 | format=wns 69 | #format=wsn 70 | #format=nws 71 | #format=swn 72 | #format=nsw 73 | #format=snw 74 | 75 | ################## END CONFIGURATION ################### 76 | -------------------------------------------------------------------------------- /passgen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Password generator with wordlist 4 | name="Passgen.sh" 5 | ver="0.2.1" 6 | author="Gianni 'guelfoweb' Amato" 7 | 8 | # 9 | # ---------------------------------------------------------------------------- 10 | # "THE BEER-WARE LICENSE" (Revision 42): 11 | # guelfoweb@gmail.com wrote this file. As long as you retain this notice you 12 | # can do whatever you want with this stuff. If we meet some day, and you think 13 | # this stuff is worth it, you can buy me a beer in return Gianni 'guelfoweb' Amato 14 | # ---------------------------------------------------------------------------- 15 | # 16 | 17 | CONFIG="passgen.cfg" 18 | 19 | wordlist=`grep "^wordlist=" $CONFIG | cut -d"=" -f2` 20 | newwordlist=`grep "^newwordlist=" $CONFIG | cut -d"=" -f2` 21 | 22 | usage(){ 23 | echo "$name v.$ver by $author" 24 | echo "https://github.com/guelfoweb/passgen/" 25 | echo 26 | echo "Password generator through a simple wordlist. You can use this tool to create a new wordlist with numbers and special characters." 27 | echo 28 | echo "You must to configure the parameters of the file [passgen.cfg]" 29 | echo 30 | echo "USAGE" 31 | echo " $0" 32 | echo " $0 -i -o " 33 | echo 34 | echo "OPTION" 35 | echo " -h this help" 36 | echo " -i file input" 37 | echo " -o file output" 38 | exit 39 | } 40 | 41 | ARGC=$# 42 | if [ "$ARGC" -eq 1 ] || [ "$ARGC" -gt 4 ]; then 43 | usage 44 | fi 45 | if [ "$ARGC" -eq 2 ] && [ "$1" == "-i" ]; then 46 | wordlist="$2" 47 | fi 48 | if [ "$ARGC" -eq 2 ] && [ "$1" == "-o" ]; then 49 | newwordlist="$2" 50 | fi 51 | if [ "$ARGC" -eq 4 ] && [ "$1" == "-i" ] && [ "$3" == "-o" ]; then 52 | wordlist="$2" 53 | newwordlist="$4" 54 | fi 55 | if [ "$ARGC" -eq 4 ] && [ "$1" == "-o" ] && [ "$3" == "-i" ]; then 56 | wordlist="$4" 57 | newwordlist="$2" 58 | fi 59 | if [ ! -f "$wordlist" ]; then 60 | echo "File not exist: $wordlist" 61 | exit 62 | fi 63 | 64 | chars=`grep "^chars=" $CONFIG | cut -d"=" -f2` 65 | u=`grep "^u=" $CONFIG | cut -d"=" -f2` 66 | nstart=`grep "^nstart=" $CONFIG | cut -d"=" -f2` 67 | nend=`grep "^nend=" $CONFIG | cut -d"=" -f2` 68 | specialchar=(`grep "^specialchar\[[0-9]*\]=" $CONFIG | cut -d"=" -f2`) 69 | format=`grep "^format=" $CONFIG | cut -d"=" -f2` 70 | 71 | nelements=`grep "^.\{$chars\}$" "$wordlist" | grep -v "à\|è\|é\|ì\|ò\|ù\|'" | wc -l | cut -d " " -f1 | sed 's/ //'` 72 | nspecials=`grep -c "^specialchar\[[0-9]*\]=" $CONFIG` 73 | 74 | echo "[+] Ready for $(( $nelements * $nspecials * ($nend - $nstart + 1) )) passwords" 75 | 76 | if $u; then u="."; else u="^"; fi 77 | echo "[+] Password format: $format" 78 | echo -n "[+] Password Type: " 79 | case $format in 80 | wns) head -n1 "$wordlist" | sed "s/\b\($u\)/\u\1/" | sed "s/$/$nstart/" | sed "s/$/$specialchar/" ;; 81 | wsn) head -n1 "$wordlist" | sed "s/\b\($u\)/\u\1/" | sed "s/$/$specialchar/" | sed "s/$/$nstart/" ;; 82 | nws) head -n1 "$wordlist" | sed "s/\b\($u\)/\u\1/" | sed "s/^/$nstart/" | sed "s/$/$specialchar/" ;; 83 | swn) head -n1 "$wordlist" | sed "s/\b\($u\)/\u\1/" | sed "s/$/$nstart/" | sed "s/^/$specialchar/" ;; 84 | nsw) head -n1 "$wordlist" | sed "s/\b\($u\)/\u\1/" | sed "s/^/$specialchar/" | sed "s/^/$nstart/" ;; 85 | snw) head -n1 "$wordlist" | sed "s/\b\($u\)/\u\1/" | sed "s/^/$nstart/" | sed "s/^/$specialchar/" ;; 86 | *) echo "error.." 87 | exit 88 | esac 89 | 90 | echo "[+] File output: $newwordlist" 91 | 92 | echo 93 | read -p "Press [Enter] key to start or [Ctrl+C] key to stop..." 94 | echo 95 | 96 | # Initialize new wordlist 97 | cat /dev/null > $newwordlist 98 | 99 | wns(){ 100 | grep "^.\{$chars\}$" "$wordlist" | grep -v "à\|è\|é\|ì\|ò\|ù\|'" | sed "s/\b\($u\)/\u\1/" | sort | while read word; 101 | do { 102 | for n in $(seq $nstart $nend) 103 | do 104 | for s in "${specialchar[@]}" 105 | do 106 | echo $word$n$s >> $newwordlist 107 | done 108 | done 109 | } 110 | done 111 | } 112 | 113 | wsn(){ 114 | grep "^.\{$chars\}$" "$wordlist" | grep -v "à\|è\|é\|ì\|ò\|ù\|'" | sed "s/\b\($u\)/\u\1/" | sort | while read word; 115 | do { 116 | for n in $(seq $nstart $nend) 117 | do 118 | for s in "${specialchar[@]}" 119 | do 120 | echo $word$s$n >> $newwordlist 121 | done 122 | done 123 | } 124 | done 125 | } 126 | 127 | nws(){ 128 | grep "^.\{$chars\}$" "$wordlist" | grep -v "à\|è\|é\|ì\|ò\|ù\|'" | sed "s/\b\($u\)/\u\1/" | sort | while read word; 129 | do { 130 | for n in $(seq $nstart $nend) 131 | do 132 | for s in "${specialchar[@]}" 133 | do 134 | echo $n$word$s >> $newwordlist 135 | done 136 | done 137 | } 138 | done 139 | } 140 | 141 | swn(){ 142 | grep "^.\{$chars\}$" "$wordlist" | grep -v "à\|è\|é\|ì\|ò\|ù\|'" | sed "s/\b\($u\)/\u\1/" | sort | while read word; 143 | do { 144 | for n in $(seq $nstart $nend) 145 | do 146 | for s in "${specialchar[@]}" 147 | do 148 | echo $s$word$n >> $newwordlist 149 | done 150 | done 151 | } 152 | done 153 | } 154 | 155 | nsw(){ 156 | grep "^.\{$chars\}$" "$wordlist" | grep -v "à\|è\|é\|ì\|ò\|ù\|'" | sed "s/\b\($u\)/\u\1/" | sort | while read word; 157 | do { 158 | for n in $(seq $nstart $nend) 159 | do 160 | for s in "${specialchar[@]}" 161 | do 162 | echo $n$s$word >> $newwordlist 163 | done 164 | done 165 | } 166 | done 167 | } 168 | 169 | snw(){ 170 | grep "^.\{$chars\}$" "$wordlist" | grep -v "à\|è\|é\|ì\|ò\|ù\|'" | sed "s/\b\($u\)/\u\1/" | sort | while read word; 171 | do { 172 | for n in $(seq $nstart $nend) 173 | do 174 | for s in "${specialchar[@]}" 175 | do 176 | echo $s$n$word >> $newwordlist 177 | done 178 | done 179 | } 180 | done 181 | } 182 | 183 | started=`date` 184 | echo "Started: $started" 185 | case $format in 186 | wns) wns ;; 187 | wsn) wsn ;; 188 | nws) nws ;; 189 | swn) swn ;; 190 | nsw) nsw ;; 191 | snw) snw ;; 192 | *) echo "error.." 193 | exit 194 | esac 195 | stopped=`date` 196 | 197 | echo "Stopped: $stopped" 198 | --------------------------------------------------------------------------------