echo
while [ ! -f $rsortin ]
do
echo
echo "File cannot be found or does not exist"
echo
echo -en "\nEnter the full path to the password file: (ex. /home/loser/password.txt):"
read rsortin
done
echo
echo -en "\nEnter the name of the output file: "
read rsortout
echo
echo -en "\nHit return to proccess the file: "
read return
if [ "$return" == "" ]; then
echo
/bin/cat $rsortin |sort -r > $rsortout
fi
cat $rsortout | while read line
do
count=$[ $count + 1 ]
done
echo -e "\n$rsortout should be located in the current directory"
echo
echo "Returning to main menu ......"
sleep 2
echo
}
##Remove all duplicate lines##
f_removedups () {
echo
echo -en "\nEnter the full path to the password file: (ex. /home/loser/password.txt): "
read indups
echo
while [ ! -f $indups ]
do
echo
echo "File cannot be found or does not exist"
echo
echo -en "\nEnter the full path to the password file: (ex. /home/loser/password.txt):"
read indups
done
echo
echo -en "\nEnter the name of the output file: "
read outdups
echo
echo -en "\nHit return to proccess the file: "
read return
if [ "$return" == "" ]; then
echo
sed -n 'G; s/\n/&&/; /^\([ -~]*\n\).*\n\1/d; s/\n//; h; P' $indups > $outdups
fi
cat $outdups | while read line
do
count=$[ $count + 1 ]
done
echo -e "\n$outdups should be located in the current directory"
echo
echo "Returning to main menu ......"
sleep 2
echo
}
##l33ting Section##
f_leet () {
echo
echo -en "\nEnter the full path to the password file: (ex. /home/loser/password.txt): "
read leetin
echo
while [ ! -f $leetin ]
do
echo
echo "File cannot be found or does not exist"
echo
echo -en "\nEnter the full path to the password file: (ex. /home/loser/password.txt):"
read leetin
done
echo
echo -en "\nEnter the name of the output file: "
read leetout
echo
echo -e "\nPlease note that this will create a very large file"
echo
echo -en "\nHit return to leetify the file: "
read return
if [ "$return" == "" ]; then
echo
/bin/cat $leetin | /bin/egrep -v .\{20\} | awk '{c=0;for(i=1;i<=length;i++)if(substr($0,i,1)~/[AaBbEeGgIiLlOoSsTtZz]/)c++;if(c<6)print}' | leeting A 4 | leeting a 4 |leeting B 8 | leeting b 8 | leeting E 3 | leeting e 3 | leeting G 9 | leeting g 9 | leeting I 1 | leeting i 1 | leeting L 1 |leeting l 1 | leeting O 0 | leeting o 0 | leeting S 5 | leeting s 5 | leeting T 7 | leeting t 7 | leeting Z 2 | leeting z 2 > $leetout
fi
cat $leetout | while read line
do
count=$[ $count + 1 ]
done
echo -e "\n$leetout should be located in the current directory"
echo
echo "Returning to main menu ......"
sleep 2
echo
}
##John rules Section##
f_rules () {
echo
echo -en "\nEnter the full path to the password file: (ex. /home/loser/password.txt): "
read manglefile
echo
while [ ! -f $manglefile ]
do
echo
echo "File cannot be found or does not exist"
echo
echo -en "\nEnter the full path to the password file: (ex. /home/loser/password.txt):"
read manglefile
done
echo
echo -en "\nEnter the name of the output file: "
read mangleout
echo
echo -e "\nPlease note that this will create a very large file"
echo
echo -e "\nThe rules option will mangle each word about 50 times"
echo
echo -en "\nHit return to mangle the file: "
read return
if [ "$return" == "" ]; then
echo
/usr/sbin/john --rules -w:$manglefile -stdout:63 > $mangleout
fi
cat $mangleout | while read line
do
count=$[ $count + 1 ]
done
echo -e "\n$mangleout should be located in the current directory"
echo
echo "Returning to main menu ......"
sleep 2
echo
}
##Remove begining white space##
f_beginwhite () {
echo
echo -en "\nEnter the full path to the password file: (ex. /home/loser/password.txt): "
read inbeginwhite
echo
while [ ! -f $inbeginwhite ]
do
echo
echo "File cannot be found or does not exist"
echo
echo -en "\nEnter the full path to the password file: (ex. /home/loser/password.txt):"
read inbeginwhite
done
echo
echo -en "\nEnter the name of the output file: "
read outbeginwhite
echo
echo -en "\nHit return to proccess the file: "
read return
if [ "$return" == "" ]; then
echo
sed -e 's/^[ \t]*//' $inbeginwhite > $outbeginwhite
fi
cat $outbeginwhite | while read line
do
count=$[ $count + 1 ]
done
echo -e "\n$outbeginwhite should be located in the current directory"
echo
echo "Returning to main menu ......"
sleep 2
echo
}
##strip all non ascii chars##
f_removenonascii () {
echo
echo -en "\nEnter the full path to the password file: (ex. /home/loser/password.txt): "
read innonascii
echo
while [ ! -f $incontrolm ]
do
echo
echo "File cannot be found or does not exist"
echo
echo -en "\nEnter the full path to the password file: (ex. /home/loser/password.txt):"
read innonascii
done
echo
echo -en "\nEnter the name of the output file: "
read outnonascii
echo
echo -en "\nHit return to proccess the file: "
read return
if [ "$return" == "" ]; then
echo
/usr/bin/tr -cd '\11\12\40-\176' < $innonascii > $outnonascii
fi
cat $outnonascii | while read line
do
count=$[ $count + 1 ]
done
echo -e "\n$outnonascii should be located in the current directory"
echo
echo "Returning to main menu ......"
sleep 2
echo
}
##Delete all lines that match a pattern##
f_deletepattern () {
echo
echo -en "\nEnter the full path to the password file: (ex. /home/loser/password.txt): "
read inpattern
echo
while [ ! -f $inpattern ]
do
echo
echo "File cannot be found or does not exist"
echo
echo -en "\nEnter the full path to the password file: (ex. /home/loser/password.txt):"
read inpattern
done
echo
echo -en "\nEnter the name of the output file: "
read outpattern
echo
echo -en "\nEnter the pattern: "
read pattern
echo
echo -en "\nHit return to proccess the file: "
read return
if [ "$return" == "" ]; then
echo
/bin/sed "/$pattern/d" $inpattern > $outpattern
fi
cat $outpattern | while read line
do
count=$[ $count + 1 ]
done
echo -e "\n$outpattern should be located in the current directory"
echo
echo "Returning to main menu ......"
sleep 2
echo
}
##phone number crunch section##
function f_phonelist () {
echo
echo -e "\nLets set up some options:"
echo
echo -en "\nEnter the areacode to use: "
read areacode
echo
echo -en "\nEnter a name for your output file: "
read phonefile
echo
echo -e "\n\t1. 2125551234"
echo -e "\n\t2. (212)5551234"
echo -e "\n\t3. 212-555-1234"
echo -e "\n\t4. (212)555-1234"
echo -en "\n\tSelect an areacode format: "
read phone
echo
echo -en "\nHit return to create the list: "
read return
if [ "$return" == "" ]; then
echo -e "\nPlease wait while the list is being generated"
if [ "$phone" = "1" ]; then
/pentest/passwords/crunch/crunch 10 10 1234567890 -t $areacode@@@@@@@ -o $phonefile
elif [ "$phone" = "2" ]; then
/pentest/passwords/crunch/crunch 12 12 1234567890 -t "($areacode)@@@@@@@" -o $phonefile
elif [ "$phone" = "3" ]; then
/pentest/passwords/crunch/crunch 12 12 1234567890 -t $areacode-@@@-@@@@ -o $phonefile
elif [ "$phone" = "4" ]; then
/pentest/passwords/crunch/crunch 13 13 1234567890 -t "($areacode)@@@-@@@@" -o $phonefile
fi
cat "$phonefile" | while read line
do
count=$[ $count + 1 ]
done
echo -e "\nFinished processing $phonefile"
fi
}
##Delete comments##
f_removecomments () {
echo
echo -en "\nEnter the full path to the password file: (ex. /home/loser/password.txt): "
read incomments
echo
while [ ! -f $incomments ]
do
echo
echo "File cannot be found or does not exist"
echo
echo -en "\nEnter the full path to the password file: (ex. /home/loser/password.txt):"
read incomments
done
echo
echo -en "\nEnter the name of the output file: "
read outcomments
echo
echo -en "\nHit return to proccess the file: "
read return
if [ "$return" == "" ]; then
echo
/bin/sed '1p; /^[[:blank:]]*#/d; s/[[:blank:]][[:blank:]]*#.*//' $incomments > $outcomments
fi
cat $outcomments | while read line
do
count=$[ $count + 1 ]
done
echo -e "\n$outcomments should be located in the current directory"
echo
echo "Returning to main menu ......"
sleep 2
echo
}
##Specify a min and max password length##
f_minmax () {
echo
echo -en "\nEnter the full path to the password file: (ex. /home/loser/password.txt): "
read minmaxin
echo
while [ ! -f $minmaxin ]
do
echo
echo "File cannot be found or does not exist"
echo
echo -en "\nEnter the full path to the password file: (ex. /home/loser/password.txt):"
read minmaxin
Traduzido e Adaptado por firebits
http://www.backtrack-linux.org/forum.../firebits.html


