-
Notifications
You must be signed in to change notification settings - Fork 10
/
wifi-hacker.sh
7061 lines (4886 loc) · 134 KB
/
wifi-hacker.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
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
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/bash
############################################################################
# CREDITS BEGIN ########################################################
############################################################################
# WiFi Hacker v2.0
# esc0rtd3w 2019
# https://github.com/TermuxHackz/wifi-hacker/
# Uses parts of the aircrack-ng suite, reaver, wifite, and many other tools
############################################################################
# CREDITS END ##########################################################
############################################################################
############################################################################
# VERSION HISTORY BEGIN ################################################
############################################################################
# v2.0
# - Added support for new Gnome terminal options. Tested in Kali 2018.4
# v1.9
# - Added support for Wash. Currently used for dumping scan info out to text.
# - Added "Bruteforce Hidden SSID Options" To Extras Menu and updated bruteforceHiddenSSID() Function.
# - Updated Menu Navigation to restrict from entering Extras Menu until after a wireless adapter has been selected.
# - Configured updates with new coloring, and now will only update if remote version is higher than local version.
# - Cleaned up code for doSleepMessage() Function. Now takes 3 arguments, "message", "time", and "color".
# - Updated Extras Menu. Added wpa_supplicant enable and disable options. Updated wpa_cli options.
# - Updated Reaver save session to only save a backup if current session file exists.
# - Fixed and updated Reaver output post screen that was broken in the last release version.
# v1.8
# - Cleaned up scripting and moved all global hotkey triggers to a loadMenuHotkeys Function.
# - Added a bruteforceHiddenSSID() Function to handle hidden SSID name reveals.
# - Added logging to XML file from airodump-ng when scanning Access Points for all encryption types.
# - Added automatic 10 second timeout for Update Menu to continue to main menu for attacking.
# - Fixed Update Menu. "Check For Update" and "Apply New Update" are now functional.
# - Update Menu now loads automatically after accepting license agreement.
# - Added support for parsing network adapter names for displaying when selecting adapter to use.
# - Added a check for PixieWPS attacks. If failed, will now default to normal Reaver attack.
# v1.7
# - Currently supports up to 10 wifi adapters.
# - Changed hotkey for "Manual Adapter Entry" from "M" to "C", because of conflicting with main menu hotkey
# - Added adapter check after disclaimer is agreed, so the main menu will show the correct number of adapters.
# - Updated "killCounterMax" to use "interfacesFound" value for "stopMonitorMode()" function
# - Added "checkMultipleAdapters" Function
# - Added number of interfaces displayed on stats banner.
# - Fixed "Interface Name" on stats banner.
# - Updated airodump-ng scripting for several functions.
# - Fixed PixieDust toggles. They were reversed, disable turned on and vice/versa.
# - Updated airodump-ng windows to only scan for the encryption type that is currently being targeted.
# v1.6
# - Added a "forceDisconnectWiFi" function to help fix active internet connection issues.
# - Changed the handling of "WiFi Force Disconnect". Now, after accepting the agreement, the main menu will only load if the connection status is "0". If the status is "1", meaning the WiFi is connected to an access point, the "forceDisconnectWiFi" and "checkNetworkStatus" functions are called until the connection is released. This allows for better control of correcting errors resulting in having an active network connection.
# - Added "ifconfig" and "iwconfig" output to Extras Interface Menu
# - Merged "checkForEmptyBSSID", "checkForEmptyESSID", and "checkForEmptyChannel" into "checkForEmptyCredentials" function.
# - Removed "arAttackDeAuthOnRetry" function. This was a duplicate and now uses "arAttackDeAuth" function instead.
# - Cleaned up "stopMonitorMode" function.
# - Added support for bully, used for WPS attacks.
# - Fixed issue with active network connection not force disconnecting before attacks begin.
# - Updated text for several menus.
# - Fixed (mostly) the issue with backup ZIP files overwriting old backups.
# v1.5
# - Updated code to handle new cleaning invoked backup options for "backupSessionFiles" function.
# - Added progress text for "cleanCaptureFiles", "cleanSessionFiles", and backupSessionFiles" functions.
# - Fixed "Clean Session Files" and Clean Capture Files" options from Extras Menu.
# - Now saving session files after Wifite Auto Attacks to prevent the .cap, .xor, etc files from being deleted.
# - Updated minimal number of IVs to 5000 before cracking for Wifite WEP Auto Attacks.
# - Fixed Wifite auto arguments for all encryption types.
# - Updated Misc Menu Text
# - Added "aireplay-ng" and "packetforge-ng" to dependency check.
# - Added terminal background colors and updated foreground text color selection.
# - Added a "more" option that can be typed under WEP Attack Menu. This menu has "TCP Dump", "Generate ARP Packet", "Forge ARP Request", and "Replay ARP Request" options.
# v1.4
# - Updated WPS attack to use PixieDust as a default option after 10 second timeout if no selection is made.
# - Added a manual interface name override option to "getWirelessInterfaces" function. Set manually to wlan0, wlan1, wlan2, etc. This will automatically display during normal execution and you may ignore it for defaults.
# - Added a "refresh" flag that is set to hide override text on subsequent calls to "getWirelessInterfaces" function.
# - Added "bannerSlim" function to use a "Title Only" banner for disclaimer and unreleased menus.
# - Updated text for gathering target info on all the different encryption types.
# - Updated sleep messages for WPS attacks.
# - Fixed PixieDust option not setting correctly if nothing is selected at menu choice.
# - Updated text for all banners. Changed the main title text and domain name.
# - Fixed all the killProcess functions to now kill the process until it no longer shows up under process list.
# - Added a force exit for aircrack-ng before cracking attempt. This attempts to fix the corrupt errors when scanning IVS and CAP files.
# - Fixed previous Airodump and Aireplay windows not closing when launching a new dump session for WEP Attack Menu.
# - Added "findCaptureFiles" function to list all available cap, ivs, csv, netxml files for cracking.
# - Added terminal colors to a "setTerminalColors" function.
# - Added "checkUpdate" and "getUpdate" functions to grab the newest shell script directly.
# - Updated text on stats banner. Changed "Interface Name: " to "Interface: " to allow for longer ESSID names without flooding to the next line.
# v1.3
# - Added support for AirCrack Suite v1.2+ using the new wlanXmon format instead of monX.
# - Fixed "wlanXmon" error in Kali Linux 2.x caused by new AirCrack Suite 1.2+. See "fixKaliTwoMonError" function for more info.
# - Added a function to check the Linux version running.
# - Removed Honeypot Mode from the banners. It has been relocated to the Advanced Menu.
# - Added "$interfaceName" and "$interfaceMode" variables.
# - Added interfaceName to the stats banner. This will display the current interface name (wlan0, mon0, wlan0mon, etc).
# - Added interfaceMode to the main banner. Valid Interface Modes are 0=Managed / 1=Monitor Standard / 2=Monitor New / 3=Monitor Other / 4=Unknown
# - Added "Open Interface Options" item to Extras Menu.
# - Added "Interface Up", "Interface Down", "Interface Managed", and "Interface Monitor" to Extras Menu. The Up and Down functions affect the interface ONLY for monitor mode (mon0, mon1, wlan0mon, wlan1mon, etc) currently. Please use Enable/Disable Channel Hopping to bring up/down a managed interface (i.e. wlan0, wlan1, etc).
# - Added support for all new Reaver arguments and options for Kali 2.x build.
# - Added airodump-ng WPS scanning options to now show WPS connections without using wifite to show them.
# - Removed the wifite window from being launched with standard WPS attack. Replaced by --wps flag in airodump-ng.
# - Added "fixAirmonCompat" function to send the command to kill any processes that may interfere.
# - Removed the "initAirmon" function that was inactive.
# - Added the airmon-ng conflicting process fix to Extras Menu.
# - Added "wlanXmon" interfaces for monitor mode termination. A better way of doing this will be done soon!
# - Fixed not returning to Extras Menu from "Open Interfaces Menu".
# - Added "isDebugMode" variable to show/hide certain areas that may need additional testing output. Disabled by default.
# - Fixed default WEP dump scanning channel hopping during attack.
# v1.2
# - Fixed the top text of disclaimer banner from being cut off.
# v1.1
# - Now globally enforcing disconnection from any active network upon agreement of disclaimer to resolve "Channel Hopping" issues. This must be done for all attacks to work properly.
# - Added "HoneyPot Mode" to main toolbar. The hotkey is "Z" to launch from anywhere in script. There is currently support for airbase-ng and wifi-honey.
# - Fixed "Negative One Channel Error" occuring in airodump-ng on Kali Linux 1.0.6 and higher. This is fixed globally and should work on all platforms.
# - Added "Start NetworkManager", "Stop NetworkManager", "Stop wpa_supplicant", "Stop wpa_cli", "Enable Channel Hopping", and "Disable Channel Hopping" to Extras menu.
# - Enabled the Advanced Menu. Also enabled the hotkey "A" to launch it. Future releases will contain highly configurable settings for supported apps and modules.
# - Added support for nmap and netcat, for use during post exploitation.
# - Fixed some $bssid and $essid variable errors in WEP attacks.
# - Fixed airodump window not closing if using load session hotkey during victim info, and then returning to the post monitor mode menu.
# - Fixed a bug where the post monitor mode screen would still load if no encryption type was selected. If the encryption type is empty, it will now return to the main menu.
# - Updated on-screen instructions for using the airdump windows and other terminal windows that are opened during target/victim setup.
# - Fixed network connection not refreshing the correct status when returning to the main menu if the network status has changed while still on the menu.
# - Added a second check to verify that no active network connection is present before launching an attack.
# - Moved autoMode text towards the top of the post monitor mode initiation screen to be more easily visible to the user.
# - Added support for post-exploitation attacks after a target has been compromised.
# - Added support for "wifite". This is used for some of the newer automated attack modes as well as an alternate option to aircrack-suite if desired.
# - Added Auto Attack Mode to the main menu. This option uses wifite to scan and attack any vulnerable network.
# - Changed some text around on some items to be more clear and understandable.
# - Added Auto modes for each attack type when selected. Once an encryption type is selected, you can type "autowep, autowps, autowpa, and autowpa2 respectively to automate the attack.
# - Fixed a few $lastMenuID variables not properly set for menu navigation.
# - Added a wifite window alongside the aircrack window when selecting WPS attacks, to help decipher which targets support WPS more easily.
# v1.0
# - Activated the disclaimer when launching the script to make sure everyone knows the rules ;)
# - Added "checkRootStatus" to verify elevated privileges before launching main menu.
# - Fixed a few typos throughout the script.
# - Added Connection display to main menu. A status of "0" is disconnected and "1" is connected.
# - Added connection status check before allowing an attack mode to be selected. This prevents trying to start an attack and being locked into a channel and other abnormalities.
# - Added text display variables for connection status. They can be displayed as "None" or "Wifi", depending on if connection status is 0 or 1.
# v0.9
# - Removed the writeDCrackPy() function. This was used to write the Python script dcrack.py out to a file.
# v0.8
# - Added support for besside-ng. Used for cracking WPA/WPA2 passwords,and upload to cloud cracking,
# - Fixed the aircrack window from closing after running dictionary attack.
# - Added checkDependencies() function to check for all required files before loading main menu.
# - Fixed the Navigation Bar from not showing up on the Help menu.
# - Fixed the aircrack window from not closing when restarting WPA/WPA2 attacks.
# - Fixed Help and Advanced menus not returning to the last page when trying to go back.
# v0.7
# - Fixed WEP aircrack errors with ESSID names that have spaces in them.
# - Fixed Terminal Options not returning to previous menu properly.
# - Cleaned up some old code that is no longer being used or referenced.
# - Fixed reaver WPC files not getting copied correctly.
# - Now copies all WPC files during reaver startup, and overwrites current WPC file after reaver session ends.
# v0.6
# - Added time and date stamp to all $encryptionType.sessions log files.
# - The "Clean Capture Files" option now only removes files in the init directory, not sessions directory.
# - Fixed bug not returning back to Extras menu after selected task has been completed.
# - All created files will now be saved to the "/sessions/$encryptionType" directory by default.
# - Added getCurrentDate() and getCurrentTime() functions to use with sessions and backups.
# - Added Backup options to Extras menu. This creates a zip file with all saved sessions and capture files.
# - Added "*.kismit.csv" and "*.kismit.netxml" files to "Cleanup Capture Files" menu under Extras.
# - Changed all references from $currentTask to $lastMenuID because of menu navigation issues.
# - Added a new variable called $lastMenuID for (hopefully) proper navigation between menus.
# - Moved code for checking MAC Spoof Status into a checkSpoofStatus() function. Can now be used globally.
# - Fixed a typo in Load Session function.
# - Updated sessions save folder and organized by encryption type.
# - Added saving reaver session WPC files to default sessions folder.
# v0.5
# - Fixed WEP attack. It wasn't being properly redirected after the last v0.4 update.
# - All attack modes re-tested and seem to be working fine.
# - Added a check for empty encryption type to prevent doing certain tasks if no type has yet been selected.
# - Updated Save and Load session menu. It does not work properly from some menus. Still in testing.
# v0.4
# - Moved all initialization functions and variables to initMain(). This is only for "code cleanliness".
# - Updated aircrack and airodump redirection based on the encryption type of the attack.
# - Added "Clean Session Files" to Extras menu. Be careful with this and be sure to keep backups.
# - Fixed not being able to return to attacks menu from Save and Load session for WEP attacks.
# - Added a $currentTask variable to change dynamically depending on what function is being executed.
# - Moved aircrack windows for WPA and WPA2 attacks to external terminal windows.
# - Fixed not being able to leave aircrack window while running WPA and WPA2 attacks.
# v0.3
# - Updated WPA and WPA2 attack modes. Both are fully working and can load custom wordlists.
# - Added the ability to change terminals under Extras menu. Supports Gnome, Konsole, Xterm, and Custom.
# - Fixed blank session files being written when no encryption type has yet been selected.
# - Added a disclaimer that must be accepted before launching main menu (currently disabled).
# - Fixed both WPA and WPA2 from not writing proper values to "$capturePath/$encryptionType/$encryptionType.sessions" log file.
# - Fixed a bug in WPA/WPA2 that prevented returning to main menu or exiting from wordlist page.
# - Updated some on-screen text when deauth station is running for WEP, WPA, and WPA2.
# - Removed Auto mode from top banner, its now defaulted after choosing encryption type.
# v0.2
# - Fixed WEP and WPS (reaver) attacks. Both are fully working now!
# - Each attack type writes to its own log file now ("$capturePath/$encryptionType/$encryptionType.sessions").
# - Cleaned up some old migrated code from previous scripts.
# v0.1
# - Initial version. Combined other current wifi scripts into one.
############################################################################
# VERSION HISTORY END ##################################################
############################################################################
############################################################################
# TO DO LIST BEGIN #####################################################
############################################################################
# Extend the width of the airodump windows when opening externally
# Add change options on-the-fly for WPS and other attack modes
# Add cowpatty support for WPA/WPA2 attacks
# Set an "ok so far" temp variable to see if all dependencies are available
# Set default $serverWPA veriable to some value other than blank
# Add sniffing/wireshark support
# Add support for airbase-ng
# Create separate handshake file with an appropriate filename
# Add "create wordlist" for phone numbers and possibly others. Add option for local
# Add checks and copy files created by besside to appropriate directories
# Add convert to .hccap support for ocl-hashcat and other compatible software
# Get advanced mode working
# Get help menu working
# Post-Exploitation Attacks To Add (Probably Scrap 20160514)
# driftnet
# nmap
# wifi-honey
############################################################################
# TO DO LIST END #######################################################
############################################################################
############################################################################
# INITIALIZATION OPTIONS BEGIN #########################################
############################################################################
initMain(){
#checkArgs
checkLinuxVersion
killAll
#startNetworkManager
getCurrentDate
getCurrentTime
getCurrentDateAndTime
setDependencies
checkDependencies
resizeWindow
setVariablesRequired
setVariablesOptional
setVariablesAdvanced
setDefaults
setDefaultsWEP
setDefaultsWPA
setDefaultsWPA2
setDefaultsWPS
setDefaultSession
setTerminalColors
# Optionally show dependencies before launch
#showDependencies
# Optionally Show Disclaimer Before Launch
showDisclaimer
# Optionally Show Unreleased Text Before Launch
#isUnreleased
# Load Main Menu
menuMain
}
checkArgs(){
case "$#" in
"1")
if [ -e $1 ];
then
echo "File $1 Exists"
else
echo "File $1 Does Not Exist"
fi
;;
esac
}
checkLinuxVersion(){
# Set both default Kali values to ON and if blank, Kali is not present
isKali=1
isKaliTwo=1
# Get Linux Build Info
linuxVersion=$(lsb_release -a | grep Description | cut -f2 -d":")
# Check against the Linux Version for the presence of Kali
kali=$(echo "$linuxVersion" | grep Kali)
# Check against the Linux Version for the presence of Kali 2.x
kaliTwo=$(echo "$linuxVersion" | grep Kali | grep 2.)
# Check For Kali Linux
case "$kali" in
"")
isKali=0
;;
esac
# Check For Kali Linux 2.x
# Uses Aircrack-ng v1.2 RC2+ (Monitor Mode Is Different)
case "$kaliTwo" in
"")
isKaliTwo=0
;;
esac
#echo "Linux Version: $linuxVersion"
#echo ""
#echo "Is Kali?: $isKali"
#echo ""
#echo "Is Kali 2.x?: $isKaliTwo"
#read pause
}
############################################################################
# INITIALIZATION OPTIONS END ###########################################
############################################################################
############################################################################
# DEPENDENCY OPTIONS BEGIN #############################################
############################################################################
setDependencies(){
pathAircrack="/usr/bin/aircrack-ng"
pathAireplay="/usr/sbin/aireplay-ng"
pathAirodump="/usr/sbin/airodump-ng"
pathBesside="/usr/sbin/besside-ng"
pathCut="/usr/bin/cut"
pathDate="/bin/date"
pathGrep="/bin/grep"
pathHead="/usr/bin/head"
pathLink="/usr/bin/link"
pathMacchanger="/usr/bin/macchanger"
pathMkdir="/bin/mkdir"
pathPacketforge="/usr/sbin/packetforge-ng"
pathReaver="/usr/bin/reaver"
pathRmdir="/bin/rmdir"
pathSed="/bin/sed"
pathSleep="/bin/sleep"
pathTail="/usr/bin/tail"
pathWash="/usr/bin/wash"
pathWget="/usr/bin/wget"
}
checkDependencies(){
#tempCounter=0
#numberOfDependencies=0
#tempPath=""
#tempStatus=""
# If counter is less than max dependencies, then build statuses
#if [ $tempCounter -lt $numberOfDependencies ];
# then
# # Set Path Name
# if [ -f $tempPath ];
# then
# # Set Status As Available
# $tempStatus="OK"
# else
# # Set Status As Unavailable
# $tempStatus="NA"
# fi
# else
# #echo "Done With Dependencies"
# #read pause
#fi
if [ -f $pathAircrack ];
then
statusPathAircrack="OK"
else
statusPathAircrack="NA"
fi
if [ -f $pathAirodump ];
then
statusPathAirodump="OK"
else
statusPathAirodump="NA"
fi
if [ -f $pathAireplay ];
then
statusPathAireplay="OK"
else
statusPathAireplay="NA"
fi
if [ -f $pathBesside ];
then
statusPathBesside="OK"
else
statusPathBesside="NA"
fi
if [ -f $pathCut ];
then
statusPathCut="OK"
else
statusPathCut="NA"
fi
if [ -f $pathDate ];
then
statusPathDate="OK"
else
statusPathDate="NA"
fi
if [ -f $pathGrep ];
then
statusPathGrep="OK"
else
statusPathGrep="NA"
fi
if [ -f $pathHead ];
then
statusPathHead="OK"
else
statusPathHead="NA"
fi
if [ -f $pathLink ];
then
statusPathLink="OK"
else
statusPathLink="NA"
fi
if [ -f $pathMacchanger ];
then
statusPathMacchanger="OK"
else
statusPathMacchanger="NA"
fi
if [ -f $pathMkdir ];
then
statusPathMkdir="OK"
else
statusPathMkdir="NA"
fi
if [ -f $pathPacketforge ];
then
statusPathPacketforge="OK"
else
statusPathPacketforge="NA"
fi
if [ -f $pathReaver ];
then
statusPathReaver="OK"
else
statusPathReaver="NA"
fi
if [ -f $pathRmdir ];
then
statusPathRmdir="OK"
else
statusPathRmdir="NA"
fi
if [ -f $pathSed ];
then
statusPathSed="OK"
else
statusPathSed="NA"
fi
if [ -f $pathSleep ];
then
statusPathSleep="OK"
else
statusPathSleep="NA"
fi
if [ -f $pathTail ];
then
statusPathTail="OK"
else
statusPathTail="NA"
fi
if [ -f $pathWash ];
then
statusPathWash="OK"
else
statusPathWash="NA"
fi
if [ -f $pathWget ];
then
statusPathWget="OK"
else
statusPathWget="NA"
fi
}
downloadDependencies(){
blank=""
}
showDependencies(){
banner
bannerStats
echo ""
echo "List of File Dependencies Needed"
echo ""
echo "$pathAircrack - Status: $statusPathAircrack"
echo "$pathAireplay - Status: $statusPathAireplay"
echo "$pathAirodump - Status: $statusPathAirodump"
echo "$pathBesside - Status: $statusPathBesside"
echo "$pathCut - Status: $statusPathCut"
echo "$pathDate - Status: $statusPathDate"
echo "$pathGrep - Status: $statusPathGrep"
echo "$pathHead - Status: $statusPathHead"
echo "$pathLink - Status: $statusPathLink"
echo "$pathMacchanger - Status: $statusPathMacchanger"
echo "$pathMkdir - Status: $statusPathMkdir"
echo "$pathPacketforge - Status: $statusPathPacketforge"
echo "$pathReaver - Status: $statusPathReaver"
echo "$pathRmdir - Status: $statusPathRmdir"
echo "$pathSed - Status: $statusPathSed"
echo "$pathSleep - Status: $statusPathSleep"
echo "$pathTail - Status: $statusPathTail"
echo "$pathWash - Status: $statusPathWash"
echo "$pathWget - Status: $statusPathWget"
echo ""
echo ""
echo "Press ENTER to continue...."
read pause
}
############################################################################
# DEPENDENCY OPTIONS END ###############################################
############################################################################
############################################################################
# TERMINAL OPTIONS BEGIN ###############################################
############################################################################
setWindowTitle(){
currentTask="setWindowTitle"
title='echo -ne "\033]0;WiFi Hacker v2.0\007"'
$title
}
resizeWindow(){
currentTask="resizeWindow"
printf '\033[8;32;115t'
}
setTerminalColors(){
currentTask="setTerminalColors"
# Foreground Colors
defaultFG=$(echo 'printf' '\033[39m')
black=$(echo 'printf' '\033[30m')
blue=$(echo 'printf' '\033[34m')
cyan=$(echo 'printf' '\033[36m')
darkGrey=$(echo 'printf' '\033[90m')
green=$(echo 'printf' '\033[32m')
lightBlue=$(echo 'printf' '\033[94m')
lightCyan=$(echo 'printf' '\033[96m')
lightGreen=$(echo 'printf' '\033[92m')
lightGrey=$(echo 'printf' '\033[37m')
lightMagenta=$(echo 'printf' '\033[95m')
lightRed=$(echo 'printf' '\033[91m')
lightYellow=$(echo 'printf' '\033[93m')
magenta=$(echo 'printf' '\033[35m')
red=$(echo 'printf' '\033[31m')
white=$(echo 'printf' '\033[0m')
whiteAlt=$(echo 'printf' '\033[97m')
yellow=$(echo 'printf' '\033[33m')
# Background Colors
defaultBG=$(echo 'printf' '\033[49m')
blackBG=$(echo 'printf' '\033[40m')
blueBG=$(echo 'printf' '\033[44m')
cyanBG=$(echo 'printf' '\033[46m')
darkGreyBG=$(echo 'printf' '\033[100m')
greenBG=$(echo 'printf' '\033[42m')
lightBlueBG=$(echo 'printf' '\033[104m')
lightCyanBG=$(echo 'printf' '\033[106m')
lightGreenBG=$(echo 'printf' '\033[102m')
lightGreyBG=$(echo 'printf' '\033[47m')
lightMagentaBG=$(echo 'printf' '\033[105m')
lightRedBG=$(echo 'printf' '\033[101m')
lightYellowBG=$(echo 'printf' '\033[103m')
magentaBG=$(echo 'printf' '\033[45m')
redBG=$(echo 'printf' '\033[41m')
whiteBG=$(echo 'printf' '\033[107m')
yellowBG=$(echo 'printf' '\033[43m')
}
setTerminalTextEffects(){
currentTask="setTerminalTextEffects"
textBlink=$(echo -e "\e[5m")
textBold=$(echo -e "\e[1m")
textDim=$(echo -e "\e[2m")
textHidden=$(echo -e "\e[8m")
textInverted=$(echo -e "\e[7m")
textUnderline=$(echo -e "\e[4m")
}
############################################################################
# TERMINAL OPTIONS END #################################################
############################################################################
############################################################################
# DEFAULT VARIABLES BEGIN ##############################################
############################################################################
setVariablesRequired(){
currentTask="setVariablesRequired"
versionBase="2.0"
versionBaseClean="00"
initPath="$PWD"
isDebugMode="0"
isDevBuild="0"
# Update Stuff
versionRemote="0.0"
versionRemoteClean="00"
versionRemoteTemp="0.0"
newUpdateAvailable="0"
updateMaster=https://raw.githubusercontent.com/esc0rtd3w/wifi-hacker/master/wifi-hacker.sh
updateTemp="/tmp/update-check.tmp"
updateChecked="0"
skipUpdate="0"
returnToUpdatePage="0"
# Setting default update downloaded script value
newVersionScript="0.0"
# Check Gnome version for terminal options (added 20190205)
gnomeVer=$(gnome-terminal --version | grep "3.")
case "$gnomeVer" in
# Kali 2018.4 GNOME Terminal 3.30.0 using VTE 0.54.1 +GNUTLS
"")
gnomeOptions="legacy"
terminal="gnome-terminal -x"
terminalGnome="gnome-terminal -x"
terminalGnomeLegacy="gnome-terminal -x"
;;
*)
gnomeOptions="new"
terminal="gnome-terminal --window --geometry=132x24 --"
terminalGnome="gnome-terminal --window --geometry=132x24 --"
terminalGnomeLegacy="gnome-terminal -x"
;;
esac
#echo "gnomeOptions: $gnomeOptions"
#read pause
terminalKonsole="konsole -e"
terminalXterm="xterm -e"
bin=""
}
setVariablesOptional(){
currentTask="setVariablesOptional"
blank=""
}
setVariablesAdvanced(){
currentTask="setVariablesAdvanced"
blank=""
}
setDefaults(){
currentTask="setDefaults"
startMonitorMode="airmon-ng start"
stopMonitorMode="airmon-ng stop"
getRandomMacAddress=""
spoofStatus="0"
resetSpoofStatus="0"
encryptionType="empty"
encryptionTypeText="Empty"
ipStatus="0"
interface="wlan0"
#interfaceMonitor="mon0"
interfaceMonitor="wlan0mon"
interfaceName="wlan0"
interfaceMode="0"
interfaceNumber="0"
interfaceNumberMax="99"
interfacesFound="0"
bssid=""
essid=""
channel=""
noChannel="0"
# This is used to return from backupCaptureFiles if invoked from backupCaptureFiles
backupFromCaptureErase="0"
# This is used to return from backupSessionFiles if invoked from backupSessionFiles
backupFromSessionErase="0"
# Default Attack Methods
attackMethodWEP=""
attackMethodWPS="reaver"
attackMethodWPA=""
attackMethodWPA2=""
#Find Network Adapter Commands
showAdapterPciAll=$(lspci | egrep -i 'network|ethernet')
showAdapterUsbAll=$(lsusb | egrep -i '')
showAdapterUsbAtheros=$(lsusb | egrep -i 'atheros|0cf3')
# Atheros WiFi Adapters
showAdapterUsbAtherosAR9271=$(lsusb | egrep -i 'AR9271' | cut -d ":" -f3)
# Intel WiFi Adapters
showAdapterUsbIntel6205=$(lspci | egrep -i 'Intel Corporation Centrino Advanced-N 6205' | cut -d ":" -f3)
# Support For 10 Adapter Names
adapterNameDefault="No Adapter Name Available"
showAdapterOneName="$adapterNameDefault"
showAdapterTwoName="$adapterNameDefault"
showAdapterThreeName="$adapterNameDefault"
showAdapterFourName="$adapterNameDefault"
showAdapterFiveName="$adapterNameDefault"
showAdapterSixName="$adapterNameDefault"
showAdapterSevenName="$adapterNameDefault"
showAdapterEightName="$adapterNameDefault"
showAdapterNineName="$adapterNameDefault"
showAdapterTenName="$adapterNameDefault"
# Default Capture Lists Values
listCap=0
listIvs=0
listXor=0
listCsv=0
listNetXml=0
hotkeyInput=""
apListType=""
# Default Session Values
sessionID="0"
capturePath=$(echo "$PWD/sessions")
capturePathWEP=$(echo "$PWD/sessions/wep")
capturePathWPS=$(echo "$PWD/sessions/wps")
capturePathWPA=$(echo "$PWD/sessions/wpa")
capturePathWPA2=$(echo "$PWD/sessions/wpa2")
# Default Current Directory Temp Path
whTemp=$(echo "$PWD/temp")
defaultScanOutputIVS="$initPath/apScan-01.ivs"
defaultScanOutputXML="$initPath/apScan-01.kismet.netxml"
defaultScanOutputTXT="$initPath/apScan-01.txt"
}
setDefaultsWEP(){
currentTask="setDefaultsWEP"
# aircrack-ng cracking mode WEP
acMode="1"
# aircrack-ng cracking mode WEP (WPA-PSK)
#acMode="2"
washFile="$whTemp/wash.txt"
washChannel="1"
}
setDefaultsWPA(){
currentTask="setDefaultsWPA"
wordlist="/usr/share/wordlists/metasploit/password.lst"
retryDeauth="0"
serverWPA=""
}
setDefaultsWPA2(){
currentTask="setDefaultsWPA2"
}
setDefaultsWPS(){
currentTask="setDefaultsWPS"
reaver="reaver"
reaverSessionPath="etc/reaver"
bssidCharOnly=""
reaverInterfaceInput=""
reaverBSSIDInput=""
reaverChannelInput=""
reaverESSIDInput=""
reaverExecInput=""
reaverMACInput=""
reaverOutfileInput=""
reaverSessionInput=""
reaverDelayInput=""
reaverFailWaitInput=""
reaverM57TimeoutInput=""
reaverMaxAttemptsInput=""
reaverPinInput=""
reaverTimeoutInput=""
reaverDelay="--delay="
reaverDHSmall="--dh-small"
reaverEAPTerminate="--eap-terminate"
reaverFailWait="--fail-wait="
reaverIgnoreLocks="--ignore-locks"
reaverM57Timeout="--m57-timeout="
reaverMaxAttempts="--max-attempts="
reaverNack="--nack"
reaverNoAssociate="--no-associate"
reaverNoNacks="--no-nacks"
reaverPin="--pin="
reaverRecurringDelay="--recurring-delay"
reaverTimeout="--timeout="
reaverWin7False="--win7"
reaver5ghz="--5ghz"
reaverAuto="--auto"
reaverChannel="--channel="
reaverDaemonize="--daemonize"
reaverESSID="--essid="
reaverExec="--exec="
reaverFixed="--fixed"
reaverHelp="--help"
reaverMAC="--mac="
reaverOutfile="--out-file="
reaverQuiet="--quiet"
reaverSession="--session="
reaverVerbose="-v"
reaverVerboseMore="-vv"
# Updated Options
reaverDaemonize="-D"
reaverExhaustive="-X"
reaverNoAutoPass="-Z"
reaverP1Index="-1"
reaverP2Index="-2"
reaverPixie="-K"