-
Notifications
You must be signed in to change notification settings - Fork 1
/
getPatterns.sh
executable file
·49 lines (46 loc) · 1.34 KB
/
getPatterns.sh
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
END=3
>brute-force-patterns.txt
# generate the 81 possible combinations of hashcat brute force pattern for IP address
oneDigit="?d"
twoDigit="?d?d"
treDigit="?d?d?d"
for i in $(seq 1 $END); do
for j in $(seq 1 $END); do
for r in $(seq 1 $END); do
for s in $(seq 1 $END); do
echo $i $j $r $s
if [ "$i" -eq "1" ]; then
address="${oneDigit}"
elif [ "$i" -eq "2" ]; then
address="${twoDigit}"
elif [ "$i" -eq "3" ]; then
address="${treDigit}"
fi
if [ "$j" -eq "1" ]; then
address="${address}.${oneDigit}"
elif [ "$j" -eq "2" ]; then
address="${address}.${twoDigit}"
elif [ "$j" -eq "3" ]; then
address="${address}.${treDigit}"
fi
if [ "$r" -eq "1" ]; then
address="${address}.${oneDigit}"
elif [ "$r" -eq "2" ]; then
address="${address}.${twoDigit}"
elif [ "$r" -eq "3" ]; then
address="${address}.${treDigit}"
fi
if [ "$s" -eq "1" ]; then
address="${address}.${oneDigit}"
elif [ "$s" -eq "2" ]; then
address="${address}.${twoDigit}"
elif [ "$s" -eq "3" ]; then
address="${address}.${treDigit}"
fi
echo $address >>brute-force-patterns.txt
done
done
done
done
echo "Done"