-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmake_brute_wordlist.sh
More file actions
executable file
·34 lines (30 loc) · 924 Bytes
/
make_brute_wordlist.sh
File metadata and controls
executable file
·34 lines (30 loc) · 924 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
#attempts to trap signints and stop the script
trap '
trap - INT # restore default INT handler
kill -s INT "$$"
' INT
#if osx coreutils tools are found use them for compatibility
#this replaces sort with gsort, date with gdate and so on...
for c in "sort" "date" "du" "tee" "cut" "wc" "uniq"
do if command -v g$c &> /dev/null
then
eval $(echo $c | tr '[:lower:]' '[:upper:]')=g$c
else
eval $(echo $c | tr '[:lower:]' '[:upper:]')=$c
fi
done
out=brute_wordlist.txt
echo "" > $out
find data -type f -not -path '*/\.*' | $SORT | while read path;
do
if [ -f "$path" ]; then
echo "Parsing: $path" | $TEE -a debug.log
cat $path | $CUT -s -f2- -d":" >> $out
fi;
done
echo "Sorting passwords by usage..." | $TEE -a debug.log
$SORT $out | $UNIQ -c | $SORT -nr > temp
echo "Cleaning up..." | $TEE -a debug.log
cat temp | sed -e 's/^[[:space:]]*//' | $CUT -s -f2- -d" " > $out
rm temp