here are two bash scripts to generate a list of all possible four letter combinations. the first gives only lowercase combinations (create_wordlist_case_insensitive.sh
), while the second gives all combinations of upper and lowercase letters (create_wordlist_case_sensitive.sh
).
$ cat create_wordlist_case_insensitive.sh
#!/usr/bin/bash
for a in {a..z}
do
for b in {a..z}
do
for c in {a..z}
do
for d in {a..z}
do
echo "$a$b$c$d"
done
done
done
done
$ cat create_wordlist_case_sensitive.sh
#!/usr/bin/bash
run1=( `echo $(echo {A..z}) | sed 's/\[ \] \^ \_ \` //'` )
run2=( `echo $(echo {A..z}) | sed 's/\[ \] \^ \_ \` //'` )
run3=( `echo $(echo {A..z}) | sed 's/\[ \] \^ \_ \` //'` )
run4=( `echo $(echo {A..z}) | sed 's/\[ \] \^ \_ \` //'` )
for a in "${run1[@]}"
do
for b in "${run2[@]}"
do
for c in "${run3[@]}"
do
for d in "${run4[@]}"
do
echo "$a$b$c$d"
done
done
done
done
use them to create your wordlist files like this:
$ create_wordlist_case_insensitive.sh >word_list_short.txt
$ create_wordlist_case_sensitive.sh >word_list_long.txt
then your script can loop through whichever file you need like this:
$ cat forceit.sh
#!/usr/bin/bash
while read line
do
echo "Trying: $line"
echo ssh intaudftp@file --password "$line" ## NOT REAL CODE
done < word_list_short.txt
except that this code won't really work, bc ssh doesn't accept a password as an argument.
you'd have to automate that segment of the code with expect
, but i won't go into how to do that here. alternatively, i suppose you could use a different command that does accept a password as an argument, like telnet
.