forked from odd-meta/bashcat
-
Notifications
You must be signed in to change notification settings - Fork 1
/
bashcat.sh
264 lines (212 loc) · 4.6 KB
/
bashcat.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
#!/bin/bash
##################################################
#
# DEFAULT CONFIGURATION VARIABLES
# also, your mom
#
##################################################
hashcatbin=/opt/hashcat/oclHashcat-1.20/oclHashcat32.bin
rulesfolder=/opt/hashcat/oclHashcat-1.20/rules/
mywordlist=/opt/wordlists/sorted.txt
myhashfile=
mymaxmasklength=7
mymaskcharset="ulds"
##################################################
#
# MISCELLANEOUS FUNCTIONS
# also, your mom
#
##################################################
f_Quit(){
echo -e "\n\n\e[1;31mHave a nice day\e[0m\n"
sleep 0
exit 2> /dev/null
}
##################################################
f_Banner(){
echo "bashcat. oclHashcat for huams."
echo
}
##################################################
f_sethashcatbin(){
clear
echo "Current binary set to:"
echo $hashcatbin
read -p "New location: " newhashcatbin
hashcatbin=$newhashcatbin
clear
f_prereqs
}
##################################################
f_sethashfile(){
clear
echo "Current hash file set to:"
echo $myhashfile
read -p "New location: " newmyhashfile
myhashfile=$newmyhashfile
clear
f_prereqs
}
##################################################
# DAT MULTI RULE TAK
##################################################
f_multirulesetup(){
clear
echo "Multi Rules Setup"
echo
echo "1. Set rules folder"
echo " [$rulesfolder]"
echo
echo "2. Set word list"
echo " [$mywordlist]"
echo
echo "3. GO GO GADGET CRACK-A-LACK"
echo
echo "4. Previous Menu"
echo
read -p "Choice: " multirulesetupchoice
case $multirulesetupchoice in
1) f_setrulesfolder ;;
2) f_setwordlist ;;
3) f_multiruleattack ;;
4) f_mainmenu ;;
*) f_multirulesetup ;;
esac
}
##################################################
f_setrulesfolder(){
clear
echo "Current rules folder set to:"
echo $rulesfolder
read -p "New location: " newrulesfolder
rulesfolder=$newrulesfolder
clear
f_prereqs
}
##################################################
f_setwordlist(){
clear
echo "Current wordlist set to:"
echo $mywordlist
read -p "New wordlist: " newmywordlist
mywordlist=$newmywordlist
clear
f_prereqs
}
f_multiruleattack(){
RULES=$rulesfolder*.rule
for f in $RULES
do
echo "Running rule $f..."
$hashcatbin -a0 -m0 -r $f $myhashfile $mywordlist
done
}
##################################################
# DAT MASK TAK
##################################################
f_maskattacksetup(){
clear
echo "Mask Attack Setup"
echo
echo "1. Set max password attempt length"
echo " [$mymaxmasklength]"
echo
echo "2. Setup characterset"
echo " [$mymaskcharset]"
echo
echo "3. GO GO GADGET CRACK-A-LACK"
echo
echo "4. Previous Menu"
echo
read -p "Choice: " maskattacksetupchoice
case $maskattacksetupchoice in
1) f_setmaxmasklength ;;
2) f_setmaskcharset ;;
3) f_maskattack ;;
4) f_mainmenu ;;
*) f_maskattacksetup ;;
esac
}
f_setmaxmasklength(){
clear
echo "Current password mask length:"
echo $mymaxmasklength
read -p "New length(1-55): " newmymaxmasklength
mymaxmasklength=$newmymaxmasklength
clear
f_maskattacksetup
}
f_setmaskcharset(){
clear
echo "Current password mask character set:"
echo $mymaskcharset
echo "Valid options are"
echo "(u)pper case"
echo "(l)ower case"
echo "(d)igits"
echo "(s)pecial"
echo "Options can be combined (lusd) one of each"
read -p "New character set: " newmymaskcharset
mymaskcharset=$newmymaskcharset
clear
f_maskattacksetup
}
f_maskattack(){
echo
}
##################################################
f_halp(){
clear
echo "<insert muscletwins intro here>"
read -p "Press enter to return to main menu." lolnull
clear
f_mainmenu
}
##################################################
f_prereqs(){
clear
echo "CHECK YO CONFIGURATIONS"
echo
echo "1. Set oclHashcat binary"
echo " [$hashcatbin]"
echo
echo "2. Set hash file"
echo " [$myhashfile]"
echo
echo "3. Previous Menu"
echo
read -p "Choice: " prereqschoice
case $prereqschoice in
1) f_sethashcatbin ;;
2) f_sethashfile ;;
3) f_mainmenu ;;
*) f_prereqs ;;
esac
}
##################################################
f_mainmenu(){
clear
f_Banner
echo
echo "Hashcat binary: $hashcatbin"
echo "Hashcat rules: $rulesfolder"
echo "Word list: $mywordlist"
echo "Hash file: $myhashfile"
echo
echo "1. Prerequisites & Configurations"
echo "2. Multi-Rule attack"
echo "3. Simple Mask Attack (bruteforce++)"
echo "4. Halp"
echo "Q. Quit bashcat session"
echo
read -p "Choice: " mainchoice
case $mainchoice in
1) f_prereqs ;;
2) f_multirulesetup ;;
3) f_maskattacksetup ;;
4) f_halp ;;
Q|q) f_Quit ;;
*) f_mainmenu ;;
esac
}
f_mainmenu