forked from v1s1t0r1sh3r3/airgeddon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
airgeddon.sh
executable file
·16310 lines (13935 loc) · 453 KB
/
airgeddon.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
#!/usr/bin/env bash
#Title........: airgeddon.sh
#Description..: This is a multi-use bash script for Linux systems to audit wireless networks.
#Author.......: v1s1t0r
#Version......: 11.02
#Usage........: bash airgeddon.sh
#Bash Version.: 4.2 or later
#Global shellcheck disabled warnings
#shellcheck disable=SC2154,SC2034
#Language vars
#Change this line to select another default language. Select one from available values in array
language="ENGLISH"
declare -A lang_association=(
["en"]="ENGLISH"
["es"]="SPANISH"
["fr"]="FRENCH"
["ca"]="CATALAN"
["pt"]="PORTUGUESE"
["ru"]="RUSSIAN"
["gr"]="GREEK"
["it"]="ITALIAN"
["pl"]="POLISH"
["de"]="GERMAN"
["tr"]="TURKISH"
["ar"]="ARABIC"
)
rtl_languages=(
"ARABIC"
)
#Tools vars
essential_tools_names=(
"iw"
"awk"
"airmon-ng"
"airodump-ng"
"aircrack-ng"
"xterm"
"ip"
"lspci"
"ps"
)
optional_tools_names=(
"wpaclean"
"crunch"
"aireplay-ng"
"mdk4"
"hashcat"
"hostapd"
"dhcpd"
"nft"
"ettercap"
"etterlog"
"lighttpd"
"dnsmasq"
"wash"
"reaver"
"bully"
"pixiewps"
"bettercap"
"beef"
"packetforge-ng"
"hostapd-wpe"
"asleap"
"john"
"openssl"
"hcxpcapngtool"
"hcxdumptool"
"tshark"
)
update_tools=("curl")
internal_tools=(
"xdpyinfo"
"ethtool"
"lsusb"
"rfkill"
"wget"
"ccze"
"xset"
)
declare -A possible_package_names=(
[${essential_tools_names[0]}]="iw" #iw
[${essential_tools_names[1]}]="awk / gawk" #awk
[${essential_tools_names[2]}]="aircrack-ng" #airmon-ng
[${essential_tools_names[3]}]="aircrack-ng" #airodump-ng
[${essential_tools_names[4]}]="aircrack-ng" #aircrack-ng
[${essential_tools_names[5]}]="xterm" #xterm
[${essential_tools_names[6]}]="iproute2" #ip
[${essential_tools_names[7]}]="pciutils" #lspci
[${essential_tools_names[8]}]="procps / procps-ng" #ps
[${optional_tools_names[0]}]="aircrack-ng" #wpaclean
[${optional_tools_names[1]}]="crunch" #crunch
[${optional_tools_names[2]}]="aircrack-ng" #aireplay-ng
[${optional_tools_names[3]}]="mdk4" #mdk4
[${optional_tools_names[4]}]="hashcat" #hashcat
[${optional_tools_names[5]}]="hostapd" #hostapd
[${optional_tools_names[6]}]="isc-dhcp-server / dhcp-server / dhcp" #dhcpd
[${optional_tools_names[7]}]="nftables" #nft
[${optional_tools_names[8]}]="ettercap / ettercap-text-only / ettercap-graphical" #ettercap
[${optional_tools_names[9]}]="ettercap / ettercap-text-only / ettercap-graphical" #etterlog
[${optional_tools_names[10]}]="lighttpd" #lighttpd
[${optional_tools_names[11]}]="dnsmasq" #dnsmasq
[${optional_tools_names[12]}]="reaver" #wash
[${optional_tools_names[13]}]="reaver" #reaver
[${optional_tools_names[14]}]="bully" #bully
[${optional_tools_names[15]}]="pixiewps" #pixiewps
[${optional_tools_names[16]}]="bettercap" #bettercap
[${optional_tools_names[17]}]="beef-xss / beef-project" #beef
[${optional_tools_names[18]}]="aircrack-ng" #packetforge-ng
[${optional_tools_names[19]}]="hostapd-wpe" #hostapd-wpe
[${optional_tools_names[20]}]="asleap" #asleap
[${optional_tools_names[21]}]="john" #john
[${optional_tools_names[22]}]="openssl" #openssl
[${optional_tools_names[23]}]="hcxtools" #hcxpcapngtool
[${optional_tools_names[24]}]="hcxdumptool" #hcxdumptool
[${optional_tools_names[25]}]="tshark / wireshark-cli / wireshark" #tshark
[${update_tools[0]}]="curl" #curl
)
#More than one alias can be defined separated by spaces at value
declare -A possible_alias_names=(
["beef"]="beef-xss beef-server"
)
#General vars
airgeddon_version="11.02"
language_strings_expected_version="11.02-1"
standardhandshake_filename="handshake-01.cap"
standardpmkid_filename="pmkid_hash.txt"
standardpmkidcap_filename="pmkid.cap"
timeout_capture_handshake="20"
timeout_capture_pmkid="25"
tmpdir="/tmp/"
osversionfile_dir="/etc/"
plugins_dir="plugins/"
minimum_bash_version_required="4.2"
resume_message=224
abort_question=12
pending_of_translation="[PoT]"
escaped_pending_of_translation="\[PoT\]"
standard_resolution="1024x768"
curl_404_error="404: Not Found"
rc_file_name=".airgeddonrc"
alternative_rc_file_name="airgeddonrc"
language_strings_file="language_strings.sh"
broadcast_mac="FF:FF:FF:FF:FF:FF"
minimum_hcxdumptool_filterap_version="6.0.0"
#5Ghz vars
ghz="Ghz"
band_24ghz="2.4${ghz}"
band_5ghz="5${ghz}"
valid_channels_24_ghz_regexp="([1-9]|1[0-4])"
valid_channels_24_and_5_ghz_regexp="([1-9]|1[0-4]|3[68]|4[02468]|5[02468]|6[024]|10[02468]|11[02468]|12[02468]|13[2468]|14[0249]|15[13579]|16[15])"
minimum_wash_dualscan_version="1.6.5"
#aircrack vars
aircrack_tmp_simple_name_file="aircrack"
aircrack_pot_tmp="${aircrack_tmp_simple_name_file}.pot"
aircrack_pmkid_version="1.4"
#hashcat vars
hashcat3_version="3.0"
hashcat4_version="4.0.0"
hashcat_hccapx_version="3.40"
minimum_hashcat_pmkid_version="6.0.0"
hashcat_2500_deprecated_version="6.2.4"
hashcat_handshake_cracking_plugin="2500"
hashcat_pmkid_cracking_plugin="22000"
hashcat_enterprise_cracking_plugin="5500"
hashcat_tmp_simple_name_file="hctmp"
hashcat_tmp_file="${hashcat_tmp_simple_name_file}.hccap"
hashcat_pot_tmp="${hashcat_tmp_simple_name_file}.pot"
hashcat_output_file="${hashcat_tmp_simple_name_file}.out"
hccapx_tool="cap2hccapx"
possible_hccapx_converter_known_locations=(
"/usr/lib/hashcat-utils/${hccapx_tool}.bin"
)
#john the ripper vars
jtr_tmp_simple_name_file="jtrtmp"
jtr_pot_tmp="${jtr_tmp_simple_name_file}.pot"
jtr_output_file="${jtr_tmp_simple_name_file}.out"
#WEP vars
wep_data="wepdata"
wepdir="wep/"
wep_attack_file="ag.wep.sh"
wep_key_handler="ag.wep_key_handler.sh"
wep_processes_file="wep_processes"
#Docker vars
docker_based_distro="Arch"
docker_io_dir="/io/"
#WPS vars
minimum_reaver_pixiewps_version="1.5.2"
minimum_reaver_nullpin_version="1.6.1"
minimum_bully_pixiewps_version="1.1"
minimum_bully_verbosity4_version="1.1"
minimum_wash_json_version="1.6.2"
known_pins_dbfile="known_pins.db"
pins_dbfile_checksum="pindb_checksum.txt"
wps_default_generic_pin="12345670"
wps_attack_script_file="ag.wpsattack.sh"
wps_out_file="ag.wpsout.txt"
timeout_secs_per_pin="30"
timeout_secs_per_pixiedust="30"
#Repository and contact vars
repository_hostname="github.com"
github_user="v1s1t0r1sh3r3"
github_repository="airgeddon"
branch="master"
script_filename="airgeddon.sh"
urlgithub="https://${repository_hostname}/${github_user}/${github_repository}"
urlscript_directlink="https://raw.githubusercontent.com/${github_user}/${github_repository}/${branch}/${script_filename}"
urlscript_pins_dbfile="https://raw.githubusercontent.com/${github_user}/${github_repository}/${branch}/${known_pins_dbfile}"
urlscript_pins_dbfile_checksum="https://raw.githubusercontent.com/${github_user}/${github_repository}/${branch}/${pins_dbfile_checksum}"
urlscript_language_strings_file="https://raw.githubusercontent.com/${github_user}/${github_repository}/${branch}/${language_strings_file}"
urlscript_options_config_file="https://raw.githubusercontent.com/${github_user}/${github_repository}/${branch}/${rc_file_name}"
urlgithub_wiki="https://${repository_hostname}/${github_user}/${github_repository}/wiki"
mail="[email protected]"
author="v1s1t0r"
#Dhcpd, Hostapd and misc Evil Twin vars
ip_range="192.169.1.0"
alt_ip_range="192.167.1.0"
router_ip="192.169.1.1"
alt_router_ip="192.167.1.1"
broadcast_ip="192.169.1.255"
alt_broadcast_ip="192.167.1.255"
range_start="192.169.1.33"
range_stop="192.169.1.100"
alt_range_start="192.167.1.33"
alt_range_stop="192.167.1.100"
std_c_mask="255.255.255.0"
ip_mask="255.255.255.255"
std_c_mask_cidr="24"
ip_mask_cidr="32"
any_mask_cidr="0"
any_ip="0.0.0.0"
any_ipv6="::/0"
loopback_ip="127.0.0.1"
loopback_ipv6="::1/128"
routing_tmp_file="ag.iptables_nftables"
dhcpd_file="ag.dhcpd.conf"
dnsmasq_file="ag.dnsmasq.conf"
internet_dns1="8.8.8.8"
internet_dns2="8.8.4.4"
internet_dns3="139.130.4.5"
bettercap_proxy_port="8080"
bettercap_dns_port="5300"
dns_port="53"
dhcp_port="67"
www_port="80"
https_port="443"
minimum_bettercap_advanced_options="1.5.9"
minimum_bettercap_fixed_beef_iptables_issue="1.6.2"
bettercap2_version="2.0"
bettercap2_sslstrip_working_version="2.28"
ettercap_file="ag.ettercap.log"
bettercap_file="ag.bettercap.log"
bettercap_config_file="ag.bettercap.cap"
bettercap_hook_file="ag.bettercap.js"
beef_port="3000"
beef_control_panel_url="http://${loopback_ip}:${beef_port}/ui/panel"
jshookfile="hook.js"
beef_file="ag.beef.conf"
beef_pass="airgeddon"
beef_db="beef.db"
beef_default_cfg_file="config.yaml"
beef_needed_brackets_version="0.4.7.2"
beef_installation_url="https://github.com/beefproject/beef/wiki/Installation"
hostapd_file="ag.hostapd.conf"
hostapd_wpe_file="ag.hostapd_wpe.conf"
hostapd_wpe_log="ag.hostapd_wpe.log"
control_et_file="ag.et_control.sh"
control_enterprise_file="ag.enterprise_control.sh"
enterprisedir="enterprise/"
certsdir="certs/"
certspass="airgeddon"
default_certs_path="/etc/hostapd-wpe/certs/"
default_certs_pass="whatever"
webserver_file="ag.lighttpd.conf"
webdir="www/"
indexfile="index.htm"
checkfile="check.htm"
cssfile="portal.css"
jsfile="portal.js"
attemptsfile="ag.et_attempts.txt"
currentpassfile="ag.et_currentpass.txt"
et_successfile="ag.et_success.txt"
enterprise_successfile="ag.enterprise_success.txt"
et_processesfile="ag.et_processes.txt"
enterprise_processesfile="ag.enterprise_processes.txt"
asleap_pot_tmp="ag.asleap_tmp.txt"
channelfile="ag.et_channel.txt"
possible_dhcp_leases_files=(
"/var/lib/dhcp/dhcpd.leases"
"/var/state/dhcp/dhcpd.leases"
"/var/lib/dhcpd/dhcpd.leases"
)
possible_beef_known_locations=(
"/usr/share/beef/"
"/usr/share/beef-xss/"
"/opt/beef/"
"/opt/beef-project/"
"/usr/lib/beef/"
#Custom BeEF location (set=0)
)
#Connection vars
ips_to_check_internet=(
"${internet_dns1}"
"${internet_dns2}"
"${internet_dns3}"
)
#Distros vars
known_compatible_distros=(
"Wifislax"
"Kali"
"Parrot"
"Backbox"
"BlackArch"
"Cyborg"
"Ubuntu"
"Mint"
"Debian"
"SuSE"
"CentOS"
"Gentoo"
"Fedora"
"Red Hat"
"Arch"
"OpenMandriva"
"Pentoo"
"Manjaro"
)
known_incompatible_distros=(
"Microsoft"
)
known_arm_compatible_distros=(
"Raspbian"
"Parrot arm"
"Kali arm"
)
#Hint vars
declare main_hints=(128 134 163 437 438 442 445 516 590 626 660 697 699)
declare dos_hints=(129 131 133 697 699)
declare handshake_pmkid_hints=(127 130 132 664 665 697 699)
declare dos_handshake_hints=(142 697 699)
declare decrypt_hints=(171 179 208 244 163 697 699)
declare personal_decrypt_hints=(171 178 179 208 244 163 697 699)
declare enterprise_decrypt_hints=(171 179 208 244 163 610 697 699)
declare select_interface_hints=(246 697 699)
declare language_hints=(250 438)
declare option_hints=(445 250 448 477 591 626 697 699)
declare evil_twin_hints=(254 258 264 269 309 328 400 509 697 699)
declare evil_twin_dos_hints=(267 268 509 697 699)
declare beef_hints=(408)
declare wps_hints=(342 343 344 356 369 390 490 625 697 699)
declare wep_hints=(431 429 428 432 433 697 699)
declare enterprise_hints=(112 332 483 518 629 301 697 699)
#Charset vars
crunch_lowercasecharset="abcdefghijklmnopqrstuvwxyz"
crunch_uppercasecharset="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
crunch_numbercharset="0123456789"
crunch_symbolcharset="!#$%/=?{}[]-*:;"
hashcat_charsets=("?l" "?u" "?d" "?s")
#Tmux vars
session_name="airgeddon"
tmux_main_window="airgeddon-Main"
no_hardcore_exit=0
#Check coherence between script and language_strings file
function check_language_strings() {
debug_print
if [ -f "${scriptfolder}${language_strings_file}" ]; then
language_file_found=1
language_file_mismatch=0
#shellcheck source=./language_strings.sh
source "${scriptfolder}${language_strings_file}"
set_language_strings_version
if [ "${language_strings_version}" != "${language_strings_expected_version}" ]; then
language_file_mismatch=1
fi
else
language_file_found=0
fi
if [[ "${language_file_found}" -eq 0 ]] || [[ "${language_file_mismatch}" -eq 1 ]]; then
language_strings_handling_messages
generate_dynamic_line "airgeddon" "title"
if [ "${language_file_found}" -eq 0 ]; then
echo_red "${language_strings_no_file[${language}]}"
if [ "${airgeddon_version}" = "6.1" ]; then
echo
echo_yellow "${language_strings_first_time[${language}]}"
fi
elif [ "${language_file_mismatch}" -eq 1 ]; then
echo_red "${language_strings_file_mismatch[${language}]}"
fi
echo
echo_blue "${language_strings_try_to_download[${language}]}"
read -p "${language_strings_key_to_continue[${language}]}" -r
if check_repository_access; then
if download_language_strings_file; then
echo
echo_yellow "${language_strings_successfully_downloaded[${language}]}"
read -p "${language_strings_key_to_continue[${language}]}" -r
clear
return 0
else
echo
echo_red "${language_strings_failed_downloading[${language}]}"
fi
else
echo
echo_red "${language_strings_failed_downloading[${language}]}"
fi
echo
echo_blue "${language_strings_exiting[${language}]}"
echo
hardcore_exit
fi
}
#Download the language strings file
function download_language_strings_file() {
debug_print
local lang_file_downloaded=0
remote_language_strings_file=$(timeout -s SIGTERM 15 curl -L ${urlscript_language_strings_file} 2> /dev/null)
if [[ -n "${remote_language_strings_file}" ]] && [[ "${remote_language_strings_file}" != "${curl_404_error}" ]]; then
lang_file_downloaded=1
else
http_proxy_detect
if [ "${http_proxy_set}" -eq 1 ]; then
remote_language_strings_file=$(timeout -s SIGTERM 15 curl --proxy "${http_proxy}" -L ${urlscript_language_strings_file} 2> /dev/null)
if [[ -n "${remote_language_strings_file}" ]] && [[ "${remote_language_strings_file}" != "${curl_404_error}" ]]; then
lang_file_downloaded=1
fi
fi
fi
if [ "${lang_file_downloaded}" -eq 1 ]; then
echo "${remote_language_strings_file}" > "${scriptfolder}${language_strings_file}"
chmod +x "${scriptfolder}${language_strings_file}" > /dev/null 2>&1
#shellcheck source=./language_strings.sh
source "${scriptfolder}${language_strings_file}"
return 0
else
return 1
fi
}
#Set messages for language_strings handling
function language_strings_handling_messages() {
declare -gA language_strings_no_file
language_strings_no_file["ENGLISH"]="Error. Language strings file not found"
language_strings_no_file["SPANISH"]="Error. No se ha encontrado el fichero de traducciones"
language_strings_no_file["FRENCH"]="Erreur. Fichier contenant les traductions absent"
language_strings_no_file["CATALAN"]="Error. No s'ha trobat el fitxer de traduccions"
language_strings_no_file["PORTUGUESE"]="Erro. O arquivo de tradução não foi encontrado"
language_strings_no_file["RUSSIAN"]="Ошибка. Не найден языковой файл"
language_strings_no_file["GREEK"]="Σφάλμα. Το αρχείο γλωσσών δεν βρέθηκε"
language_strings_no_file["ITALIAN"]="Errore. Non si trova il file delle traduzioni"
language_strings_no_file["POLISH"]="Błąd. Nie znaleziono pliku tłumaczenia"
language_strings_no_file["GERMAN"]="Fehler. Die Übersetzungsdatei wurde nicht gefunden"
language_strings_no_file["TURKISH"]="Hata. Çeviri dosyası bulunamadı"
language_strings_no_file["ARABIC"]="خطأ. ملف اللغة غير موجود"
declare -gA language_strings_file_mismatch
language_strings_file_mismatch["ENGLISH"]="Error. The language strings file found mismatches expected version"
language_strings_file_mismatch["SPANISH"]="Error. El fichero de traducciones encontrado no es la versión esperada"
language_strings_file_mismatch["FRENCH"]="Erreur. Les traductions trouvées ne sont pas celles attendues"
language_strings_file_mismatch["CATALAN"]="Error. El fitxer de traduccions trobat no és la versió esperada"
language_strings_file_mismatch["PORTUGUESE"]="Erro. O a versão do arquivos de tradução encontrado é a incompatível"
language_strings_file_mismatch["RUSSIAN"]="Ошибка. Языковой файл не соответствует ожидаемой версии"
language_strings_file_mismatch["GREEK"]="Σφάλμα. Το αρχείο γλωσσών που έχει βρεθεί δεν αντιστοιχεί με την προαπαιτούμενη έκδοση"
language_strings_file_mismatch["ITALIAN"]="Errore. Il file delle traduzioni trovato non è la versione prevista"
language_strings_file_mismatch["POLISH"]="Błąd. Znaleziony plik tłumaczenia nie jest oczekiwaną wersją"
language_strings_file_mismatch["GERMAN"]="Fehler. Die gefundene Übersetzungsdatei ist nicht die erwartete Version"
language_strings_file_mismatch["TURKISH"]="Hata. Bulunan çeviri dosyası beklenen sürüm değil"
language_strings_file_mismatch["ARABIC"]="خطأ. ملف اللغة غيرمتطابق مع الإصدار المتوقع"
declare -gA language_strings_try_to_download
language_strings_try_to_download["ENGLISH"]="airgeddon will try to download the language strings file..."
language_strings_try_to_download["SPANISH"]="airgeddon intentará descargar el fichero de traducciones..."
language_strings_try_to_download["FRENCH"]="airgeddon va essayer de télécharger les fichiers de traductions..."
language_strings_try_to_download["CATALAN"]="airgeddon intentarà descarregar el fitxer de traduccions..."
language_strings_try_to_download["PORTUGUESE"]="O airgeddon tentará baixar o arquivo de tradução..."
language_strings_try_to_download["RUSSIAN"]="airgeddon попытается загрузить языковой файл..."
language_strings_try_to_download["GREEK"]="Το airgeddon θα προσπαθήσει να κατεβάσει το αρχείο γλωσσών..."
language_strings_try_to_download["ITALIAN"]="airgeddon cercherá di scaricare il file delle traduzioni..."
language_strings_try_to_download["POLISH"]="airgeddon spróbuje pobrać plik tłumaczeń..."
language_strings_try_to_download["GERMAN"]="airgeddon wird versuchen, die Übersetzungsdatei herunterzuladen..."
language_strings_try_to_download["TURKISH"]="airgeddon çeviri dosyasını indirmeye çalışacak..."
language_strings_try_to_download["ARABIC"]="سيحاول airgeddon تنزيل ملف سلاسل اللغة ..."
declare -gA language_strings_successfully_downloaded
language_strings_successfully_downloaded["ENGLISH"]="Language strings file was successfully downloaded"
language_strings_successfully_downloaded["SPANISH"]="Se ha descargado con éxito el fichero de traducciones"
language_strings_successfully_downloaded["FRENCH"]="Les fichiers traduction ont été correctement téléchargés"
language_strings_successfully_downloaded["CATALAN"]="S'ha descarregat amb èxit el fitxer de traduccions"
language_strings_successfully_downloaded["PORTUGUESE"]="O arquivo de tradução foi baixado com sucesso"
language_strings_successfully_downloaded["RUSSIAN"]="Языковой файл был успешно загружен"
language_strings_successfully_downloaded["GREEK"]="Το αρχείο γλωσσών κατέβηκε με επιτυχία"
language_strings_successfully_downloaded["ITALIAN"]="Il file delle traduzioni è stato scaricato con successo"
language_strings_successfully_downloaded["POLISH"]="Plik z tłumaczeniem został pomyślnie pobrany"
language_strings_successfully_downloaded["GERMAN"]="Die Übersetzungsdatei wurde erfolgreich heruntergeladen"
language_strings_successfully_downloaded["TURKISH"]="Çeviri dosyası başarıyla indirildi"
language_strings_successfully_downloaded["ARABIC"]="تم تنزيل ملف سلاسل اللغة بنجاح"
declare -gA language_strings_failed_downloading
language_strings_failed_downloading["ENGLISH"]="The language string file can't be downloaded. Check your internet connection or download it manually from ${normal_color}${urlgithub}"
language_strings_failed_downloading["SPANISH"]="No se ha podido descargar el fichero de traducciones. Comprueba tu conexión a internet o descárgalo manualmente de ${normal_color}${urlgithub}"
language_strings_failed_downloading["FRENCH"]="Impossible de télécharger le fichier traduction. Vérifiez votre connexion à internet ou téléchargez le fichier manuellement ${normal_color}${urlgithub}"
language_strings_failed_downloading["CATALAN"]="No s'ha pogut descarregar el fitxer de traduccions. Comprova la connexió a internet o descarrega'l manualment de ${normal_color}${urlgithub}"
language_strings_failed_downloading["PORTUGUESE"]="Não foi possível baixar o arquivos de tradução. Verifique a sua conexão com a internet ou baixe manualmente em ${normal_color}${urlgithub}"
language_strings_failed_downloading["RUSSIAN"]="Языковой файл не может быть загружен. Проверьте подключение к Интернету или загрузите его вручную с ${normal_color}${urlgithub}"
language_strings_failed_downloading["GREEK"]="Το αρχείο γλωσσών δεν μπορεί να κατέβει. Ελέγξτε τη σύνδεση σας με το διαδίκτυο ή κατεβάστε το χειροκίνητα ${normal_color}${urlgithub}"
language_strings_failed_downloading["ITALIAN"]="Impossibile scaricare il file delle traduzioni. Controlla la tua connessione a internet o scaricalo manualmente ${normal_color}${urlgithub}"
language_strings_failed_downloading["POLISH"]="Nie można pobrać pliku tłumaczenia. Sprawdź połączenie internetowe lub pobierz go ręcznie z ${normal_color}${urlgithub}"
language_strings_failed_downloading["GERMAN"]="Die Übersetzungsdatei konnte nicht heruntergeladen werden. Überprüfen Sie Ihre Internetverbindung oder laden Sie sie manuell von ${normal_color}${urlgithub} runter"
language_strings_failed_downloading["TURKISH"]="Çeviri dosyası indirilemedi. İnternet bağlantınızı kontrol edin veya manuel olarak indirin ${normal_color}${urlgithub}"
language_strings_failed_downloading["ARABIC"]="${normal_color}${urlgithub}${red_color} لا يمكن تنزيل ملف اللغة. تحقق من اتصالك بالإنترنت أو قم بتنزيله يدويًا من"
declare -gA language_strings_first_time
language_strings_first_time["ENGLISH"]="If you are seeing this message after an automatic update, don't be scared! It's probably because airgeddon has different file structure since version 6.1. It will be automatically fixed"
language_strings_first_time["SPANISH"]="Si estás viendo este mensaje tras una actualización automática, ¡no te asustes! probablemente es porque a partir de la versión 6.1 la estructura de ficheros de airgeddon ha cambiado. Se reparará automáticamente"
language_strings_first_time["FRENCH"]="Si vous voyez ce message après une mise à jour automatique ne vous inquiétez pas! A partir de la version 6.1 la structure de fichier d'airgeddon a changé. L'ajustement se fera automatiquement"
language_strings_first_time["CATALAN"]="Si estàs veient aquest missatge després d'una actualització automàtica, no t'espantis! probablement és perquè a partir de la versió 6.1 l'estructura de fitxers de airgeddon ha canviat. Es repararà automàticament"
language_strings_first_time["PORTUGUESE"]="Se você está vendo esta mensagem depois de uma atualização automática, não tenha medo! A partir da versão 6.1 da estrutura de arquivos do airgeddon mudou. Isso será corrigido automaticamente"
language_strings_first_time["RUSSIAN"]="Если вы видите это сообщение после автоматического обновления, не переживайте! Вероятно, это объясняется тем, что, начиная с версии 6.1, airgeddon имеет другую структуру файлов. Проблема будет разрешена автоматически"
language_strings_first_time["GREEK"]="Εάν βλέπετε αυτό το μήνυμα μετά από κάποια αυτόματη ενημέρωση, μην τρομάξετε! Πιθανόν είναι λόγω της διαφορετικής δομής του airgeddon μετά από την έκδοση 6.1. Θα επιδιορθωθεί αυτόματα"
language_strings_first_time["ITALIAN"]="Se stai vedendo questo messaggio dopo un aggiornamento automatico, niente panico! probabilmente è perché a partire dalla versione 6.1 é cambiata la struttura dei file di airgeddon. Sarà riparato automaticamente"
language_strings_first_time["POLISH"]="Jeśli widzisz tę wiadomość po automatycznej aktualizacji, nie obawiaj się! To prawdopodobnie dlatego, że w wersji 6.1 zmieniła się struktura plików airgeddon. Naprawi się automatycznie"
language_strings_first_time["GERMAN"]="Wenn Sie diese Nachricht nach einem automatischen Update sehen, haben Sie keine Angst! Das liegt vermutlich daran, dass ab Version 6.1 die Dateistruktur von airgeddon geändert wurde. Es wird automatisch repariert"
language_strings_first_time["TURKISH"]="Otomatik bir güncellemeden sonra bu mesajı görüyorsanız, korkmayın! muhtemelen 6.1 sürümünden itibaren airgeddon dosya yapısı değişmiştir. Otomatik olarak tamir edilecektir"
language_strings_first_time["ARABIC"]="إذا كنت ترى هذه الرسالة بعد التحديث التلقائي ، فلا تخف! ربما يرجع السبب في ذلك إلى أن airgeddon له بنية ملفات مختلفة منذ الإصدار 6.1. سيتم إصلاحه تلقائيًا "
declare -gA language_strings_exiting
language_strings_exiting["ENGLISH"]="Exiting airgeddon script v${airgeddon_version} - See you soon! :)"
language_strings_exiting["SPANISH"]="Saliendo de airgeddon script v${airgeddon_version} - Nos vemos pronto! :)"
language_strings_exiting["FRENCH"]="Fermeture du script airgeddon v${airgeddon_version} - A bientôt! :)"
language_strings_exiting["CATALAN"]="Sortint de airgeddon script v${airgeddon_version} - Ens veiem aviat! :)"
language_strings_exiting["PORTUGUESE"]="Saindo do script airgeddon v${airgeddon_version} - Até breve! :)"
language_strings_exiting["RUSSIAN"]="Выход из скрипта airgeddon v${airgeddon_version} - До встречи! :)"
language_strings_exiting["GREEK"]="Κλείσιμο του airgeddon v${airgeddon_version} - Αντίο :)"
language_strings_exiting["ITALIAN"]="Uscendo dallo script airgeddon v${airgeddon_version} - A presto! :)"
language_strings_exiting["POLISH"]="Wyjście z skryptu airgeddon v${airgeddon_version} - Do zobaczenia wkrótce! :)"
language_strings_exiting["GERMAN"]="Sie verlassen airgeddon v${airgeddon_version} - Bis bald! :)"
language_strings_exiting["TURKISH"]="airgeddon yazılımından çıkış yapılıyor v${airgeddon_version} - Yakında görüşürüz! :)"
language_strings_exiting["ARABIC"]="الخروج من البرنامج airgeddon v${airgeddon_version}- نراكم قريبًا! :)"
declare -gA language_strings_key_to_continue
language_strings_key_to_continue["ENGLISH"]="Press [Enter] key to continue..."
language_strings_key_to_continue["SPANISH"]="Pulsa la tecla [Enter] para continuar..."
language_strings_key_to_continue["FRENCH"]="Pressez [Enter] pour continuer..."
language_strings_key_to_continue["CATALAN"]="Prem la tecla [Enter] per continuar..."
language_strings_key_to_continue["PORTUGUESE"]="Pressione a tecla [Enter] para continuar..."
language_strings_key_to_continue["RUSSIAN"]="Нажмите клавишу [Enter] для продолжения..."
language_strings_key_to_continue["GREEK"]="Πατήστε το κουμπί [Enter] για να συνεχίσετε..."
language_strings_key_to_continue["ITALIAN"]="Premere il tasto [Enter] per continuare..."
language_strings_key_to_continue["POLISH"]="Naciśnij klawisz [Enter] aby kontynuować..."
language_strings_key_to_continue["GERMAN"]="Drücken Sie die [Enter]-Taste um fortzufahren..."
language_strings_key_to_continue["TURKISH"]="Devam etmek için [Enter] tuşuna basın..."
language_strings_key_to_continue["ARABIC"]="اضغط على مفتاح [Enter] للمتابعة ..."
}
#Generic toggle option function
function option_toggle() {
debug_print
local required_reboot=0
if [[ -n "${2}" ]] && [[ "${2}" = "required_reboot" ]]; then
required_reboot=1
fi
local option_var_name="${1}"
local option_var_value="${!1}"
if "${option_var_value:-true}"; then
sed -ri "s:(${option_var_name})=(true):\1=false:" "${rc_path}" 2> /dev/null
if ! grep "${option_var_name}=false" "${rc_path}" > /dev/null; then
return 1
fi
if [ ${required_reboot} -eq 0 ]; then
eval "export ${option_var_name}=false"
fi
else
sed -ri "s:(${option_var_name})=(false):\1=true:" "${rc_path}" 2> /dev/null
if ! grep "${option_var_name}=true" "${rc_path}" > /dev/null; then
return 1
fi
if [ ${required_reboot} -eq 0 ]; then
eval "export ${option_var_name}=true"
fi
fi
case "${option_var_name}" in
"AIRGEDDON_BASIC_COLORS")
remap_colors
;;
"AIRGEDDON_EXTENDED_COLORS")
initialize_extended_colorized_output
;;
"AIRGEDDON_5GHZ_ENABLED")
phy_interface=$(physical_interface_finder "${interface}")
check_interface_supported_bands "${phy_interface}" "main_wifi_interface"
secondary_phy_interface=$(physical_interface_finder "${secondary_wifi_interface}")
check_interface_supported_bands "${secondary_phy_interface}" "secondary_wifi_interface"
;;
esac
return 0
}
#Get current permanent language
function get_current_permanent_language() {
debug_print
current_permanent_language=$(grep "language=" "${scriptfolder}${scriptname}" | grep -v "auto_change_language" | head -n 1 | awk -F "=" '{print $2}')
current_permanent_language=$(echo "${current_permanent_language}" | sed -e 's/^"//;s/"$//')
}
#Set language as permanent
function set_permanent_language() {
debug_print
sed -ri "s:^([l]anguage)=\"[a-zA-Z]+\":\1=\"${language}\":" "${scriptfolder}${scriptname}" 2> /dev/null
if ! grep -E "^[l]anguage=\"${language}\"" "${scriptfolder}${scriptname}" > /dev/null; then
return 1
fi
return 0
}
#Print the current line of where this was called and the function's name. Applies to some (which are useful) functions
function debug_print() {
if "${AIRGEDDON_DEBUG_MODE:-true}"; then
declare excluded_functions=(
"airmon_fix"
"ask_yesno"
"check_pending_of_translation"
"clean_env_vars"
"contains_element"
"create_rcfile"
"echo_blue"
"echo_brown"
"echo_cyan"
"echo_green"
"echo_green_title"
"echo_pink"
"echo_red"
"echo_red_slim"
"echo_white"
"echo_yellow"
"env_vars_initialization"
"env_vars_values_validation"
"fix_autocomplete_chars"
"flying_saucer"
"generate_dynamic_line"
"initialize_colors"
"initialize_script_settings"
"interrupt_checkpoint"
"language_strings"
"last_echo"
"physical_interface_finder"
"print_hint"
"print_large_separator"
"print_simple_separator"
"read_yesno"
"remove_warnings"
"set_script_paths"
"special_text_missed_optional_tool"
"store_array"
"under_construction_message"
)
if (IFS=$'\n'; echo "${excluded_functions[*]}") | grep -qFx "${FUNCNAME[1]}"; then
return 1
fi
echo "Line:${BASH_LINENO[1]}" "${FUNCNAME[1]}"
fi
return 0
}
#Set the message to show again after an interrupt ([Ctrl+C] or [Ctrl+Z]) without exiting
function interrupt_checkpoint() {
debug_print
if [ -z "${last_buffered_type1}" ]; then
last_buffered_message1=${1}
last_buffered_message2=${1}
last_buffered_type1=${2}
last_buffered_type2=${2}
else
if [[ "${1}" -ne "${resume_message}" ]] 2>/dev/null && [[ "${1}" != "${resume_message}" ]]; then
last_buffered_message2=${last_buffered_message1}
last_buffered_message1=${1}
last_buffered_type2=${last_buffered_type1}
last_buffered_type1=${2}
fi
fi
}
#Add the text on a menu when you miss an optional tool
function special_text_missed_optional_tool() {
debug_print
declare -a required_tools=("${!3}")
allowed_menu_option=1
if ! "${AIRGEDDON_DEVELOPMENT_MODE:-false}"; then
tools_needed="${optionaltool_needed[${1}]}"
for item in "${required_tools[@]}"; do
if [ "${optional_tools[${item}]}" -eq 0 ]; then
allowed_menu_option=0
tools_needed+="${item} "
fi
done
fi
local message
message=$(replace_string_vars "${@}")
if [ ${allowed_menu_option} -eq 1 ]; then
last_echo "${message}" "${normal_color}"
else
[[ ${message} =~ ^([0-9]+)\.(.*)$ ]] && forbidden_options+=("${BASH_REMATCH[1]}")
tools_needed=${tools_needed:: -1}
echo_red_slim "${message} (${tools_needed})"
fi
}
#Generate the chars in front of and behind a text for titles and separators
function generate_dynamic_line() {
debug_print
local type=${2}
if [ "${type}" = "title" ]; then
if [ "${FUNCNAME[2]}" = "main_menu" ]; then
ncharstitle=91
else
ncharstitle=78
fi
titlechar="*"
elif [ "${type}" = "separator" ]; then
ncharstitle=58
titlechar="-"
fi
titletext=${1}
titlelength=${#titletext}
finaltitle=""
for ((i=0; i < (ncharstitle/2 - titlelength+(titlelength/2)); i++)); do
finaltitle="${finaltitle}${titlechar}"
done
if [ "${type}" = "title" ]; then
finaltitle="${finaltitle} ${titletext} "
elif [ "${type}" = "separator" ]; then
finaltitle="${finaltitle} (${titletext}) "
fi
for ((i=0; i < (ncharstitle/2 - titlelength+(titlelength/2)); i++)); do
finaltitle="${finaltitle}${titlechar}"
done
if [ $((titlelength % 2)) -gt 0 ]; then
finaltitle+="${titlechar}"
fi
if [ "${type}" = "title" ]; then
echo_green_title "${finaltitle}"
elif [ "${type}" = "separator" ]; then
echo_blue "${finaltitle}"
fi
}
#Wrapper to check managed mode on an interface
function check_to_set_managed() {
debug_print
check_interface_mode "${1}"
case "${ifacemode}" in
"Managed")
echo
language_strings "${language}" 0 "red"
language_strings "${language}" 115 "read"
return 1
;;
"(Non wifi card)")
echo
language_strings "${language}" 1 "red"
language_strings "${language}" 115 "read"
return 1
;;
esac
return 0
}
#Wrapper to check monitor mode on an interface
function check_to_set_monitor() {
debug_print
check_interface_mode "${1}"
case "${ifacemode}" in
"Monitor")
echo
language_strings "${language}" 10 "red"
language_strings "${language}" 115 "read"
return 1
;;
"(Non wifi card)")
echo
language_strings "${language}" 13 "red"
language_strings "${language}" 115 "read"
return 1
;;
esac
return 0
}
#Check for monitor mode on an interface
function check_monitor_enabled() {
debug_print
mode=$(iw "${1}" info 2> /dev/null | grep type | awk '{print $2}')
current_iface_on_messages="${1}"
if [[ ${mode^} != "Monitor" ]]; then
return 1
fi
return 0
}
#Check if an interface is a wifi card or not
function check_interface_wifi() {
debug_print
iw "${1}" info > /dev/null 2>&1
return $?
}
#Create a list of interfaces associated to its macs
function renew_ifaces_and_macs_list() {
debug_print
readarray -t IFACES_AND_MACS < <(ip link | grep -E "^[0-9]+" | cut -d ':' -f 2 | awk '{print $1}' | grep -E "^lo$" -v | grep "${interface}" -v)
declare -gA ifaces_and_macs
for iface_name in "${IFACES_AND_MACS[@]}"; do
mac_item=$(cat "/sys/class/net/${iface_name}/address" 2> /dev/null)
if [ -n "${mac_item}" ]; then
ifaces_and_macs[${iface_name}]=${mac_item}
fi
done
declare -gA ifaces_and_macs_switched
for iface_name in "${!ifaces_and_macs[@]}"; do
ifaces_and_macs_switched[${ifaces_and_macs[${iface_name}]}]=${iface_name}
done
}
#Check the interface coherence between interface names and macs
function check_interface_coherence() {
debug_print
renew_ifaces_and_macs_list
interface_auto_change=0
interface_found=0
for iface_name in "${!ifaces_and_macs[@]}"; do
if [ "${interface}" = "${iface_name}" ]; then
interface_found=1
interface_mac=${ifaces_and_macs[${iface_name}]}
break
fi
done
if [ ${interface_found} -eq 0 ]; then
for iface_mac in "${ifaces_and_macs[@]}"; do
iface_mac_tmp=${iface_mac:0:15}
interface_mac_tmp=${interface_mac:0:15}
if [ "${iface_mac_tmp}" = "${interface_mac_tmp}" ]; then
interface=${ifaces_and_macs_switched[${iface_mac}]}
phy_interface=$(physical_interface_finder "${interface}")
check_interface_supported_bands "${phy_interface}" "main_wifi_interface"
interface_auto_change=1
break
fi
done
fi
return ${interface_auto_change}
}
#Check if an adapter is compatible to airmon
function check_airmon_compatibility() {
debug_print
if [ "${1}" = "interface" ]; then
set_chipset "${interface}" "read_only"
if iw phy "${phy_interface}" info 2>/dev/null | grep -iq 'interface combinations are not supported'; then
interface_airmon_compatible=0
else
interface_airmon_compatible=1
fi
else
set_chipset "${secondary_wifi_interface}" "read_only"
if ! iw dev "${secondary_wifi_interface}" set bitrates legacy-2.4 1 > /dev/null 2>&1; then
secondary_interface_airmon_compatible=0
else
secondary_interface_airmon_compatible=1
fi
fi
}
#Add contributing footer to a file
function add_contributing_footer_to_file() {
debug_print
{
echo ""
echo "---------------"
echo ""
echo "${footer_texts[${language},0]}"
} >> "${1}"
}
#Prepare the vars to be used on wps pin database attacks
function set_wps_mac_parameters() {
debug_print
six_wpsbssid_first_digits=${wps_bssid:0:8}
six_wpsbssid_first_digits_clean=${six_wpsbssid_first_digits//:}
six_wpsbssid_last_digits=${wps_bssid: -8}
six_wpsbssid_last_digits_clean=${six_wpsbssid_last_digits//:}
four_wpsbssid_last_digits=${wps_bssid: -5}
four_wpsbssid_last_digits_clean=${four_wpsbssid_last_digits//:}
}
#Check if wash has json option
function check_json_option_on_wash() {
debug_print