Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 51 lines (39 sloc) 1.17 KB
#!/bin/bash
# n=0;for url in $(cat urls.txt);do cewl -w cewl$n.txt $url;n=$((n+1));done
if [ -z ${1+x} ]; then
echo "cewl-loop - Loop cewl through a list of URLs"
echo ""
echo "Usage: $0 <filename> [<prefix>]"
echo ""
echo " filename [required]: path to text file with one url on each line"
echo " prefix [optional]: prefix to use for the files generated by this script."
echo " If no prefix is specified, 'cewl' will be used by default."
exit
fi
if [ -z ${2+x} ]; then
prefix="cewl"
else
prefix=$2
fi
n=0
echo "[ ] running cewl..."
i=1
sp="/-\|"
echo -n " "
for url in $(cat $1);
do
n=$((n+1))
printf "\b${sp:i++%${#sp}:1}"
cewl -w $prefix$n.txt $url > /dev/null
printf "\b${sp:i++%${#sp}:1}"
done
echo -e "\b[ ] sorting file..."
eval "cat $prefix{1..$n}.txt |sort -u > $prefix-sorted.txt"
echo "[ ] cleaning up..."
eval "rm $prefix{1..$n}.txt"
echo "[ ] applying mangle rules..."
john --wordlist="$prefix-sorted.txt" --rules --stdout > $prefix-mangled.txt 2> /dev/null
echo "[ ] done"
echo " "
echo " $prefix-sorted.txt has $(cat $prefix-sorted.txt |wc -l) words"
echo " $prefix-mangled.txt has $(cat $prefix-mangled.txt |wc -l) words"