-
Notifications
You must be signed in to change notification settings - Fork 4
/
multint.sh
executable file
·448 lines (392 loc) · 15 KB
/
multint.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
#!/usr/bin/env bash
#Global shellcheck disabled warnings
#shellcheck disable=SC2034,SC2154
###### GENERIC PLUGIN VARS ######
plugin_name="multint"
plugin_description="Support for dual WiFi adapters on Evil Twin with Captive Portal attack"
plugin_author="xpz3"
#Enabled 1 / Disabled 0 - Set this plugin as enabled - Default value 1
plugin_enabled=1
###### PLUGIN REQUIREMENTS ######
#Set airgeddon versions to apply this plugin (leave blank to set no limits, minimum version recommended is 10.0 on which plugins feature was added)
plugin_minimum_ag_affected_version="11.31"
plugin_maximum_ag_affected_version=""
#Set only one element in the array "*" to affect all distros, otherwise add them one by one with the name which airgeddon uses for that distro (examples "BlackArch", "Parrot", "Kali")
plugin_distros_supported=("*")
function multint_override_select_interface() {
debug_print
local interface_menu_band
local multintcounter=0
multint_enabled=1
while [ "${multintcounter}" -lt 2 ]
do
clear
language_strings "${language}" 88 "title"
current_menu="select_interface_menu"
if [ "${multintcounter}" -eq 0 ]; then
language_strings "${language}" "multint_text_1" "green"
else
language_strings "${language}" "multint_text_2" "green"
fi
print_simple_separator
ifaces=$(ip link | grep -E "^[0-9]+" | cut -d ':' -f 2 | awk '{print $1}' | grep -E "^lo$" -v)
option_counter=0
for item in ${ifaces}; do
option_counter=$((option_counter + 1))
if [ ${#option_counter} -eq 1 ]; then
spaceiface=" "
else
spaceiface=" "
fi
echo -ne "${option_counter}.${spaceiface}${item} "
set_chipset "${item}"
if [ "${chipset}" = "" ]; then
language_strings "${language}" 245 "blue"
else
interface_menu_band=""
if check_interface_wifi "${item}"; then
interface_menu_band+="${blue_color}// ${pink_color}"
get_5ghz_band_info_from_phy_interface "$(physical_interface_finder "${item}")"
case "$?" in
"1")
interface_menu_band+="${band_24ghz}"
;;
*)
interface_menu_band+="${band_24ghz}, ${band_5ghz}"
;;
esac
fi
if [ "${is_rtl_language}" -eq 1 ]; then
echo -e "${interface_menu_band} ${blue_color}// ${normal_color}${chipset} ${yellow_color}:Chipset${normal_color}"
else
echo -e "${interface_menu_band} ${blue_color}// ${yellow_color}Chipset:${normal_color} ${chipset}"
fi
fi
done
print_hint ${current_menu}
read -rp "> " iface
if [[ ! ${iface} =~ ^[[:digit:]]+$ ]] || (( iface < 1 || iface > option_counter )); then
invalid_iface_selected
else
option_counter2=0
for item2 in ${ifaces}; do
option_counter2=$((option_counter2 + 1))
if [[ "${iface}" = "${option_counter2}" ]]; then
if [ "${multintcounter}" -eq 0 ]; then
multint_ap_interface="${item2}"
current_iface_on_messages="${multint_ap_interface}"
if ! set_mode_without_airmon "${multint_ap_interface}" "managed"; then
echo
language_strings "${language}" 1 "red"
language_strings "${language}" 115 "read"
multintcounter=$((multintcounter - 1))
fi
else
multint_deauth_interface="${item2}"
current_iface_on_messages="${multint_deauth_interface}"
interface=${item2}
phy_interface=$(physical_interface_finder "${interface}")
check_interface_supported_bands "${phy_interface}" "main_wifi_interface"
interface_mac=$(ip link show "${interface}" | awk '/ether/ {print $2}')
card_vif_support=1 #Suppress VIF not supported message as we are using two separate cards
check_interface_wifi_longname "${interface}"
break
fi
fi
done
fi
multintcounter=$((multintcounter + 1))
done
if [ "${multint_ap_interface}" = "${multint_deauth_interface}" ]; then
multint_enabled=0
fi
}
function multint_override_prepare_et_monitor() {
debug_print
disable_rfkill
if [ "${multint_enabled}" -eq 1 ]; then
iface_monitor_et_deauth="${multint_deauth_interface}"
ip link set "${iface_monitor_et_deauth}" down > /dev/null 2>&1
else
iface_phy_number=${phy_interface:3:1}
iface_monitor_et_deauth="mon${iface_phy_number}"
iw phy "${phy_interface}" interface add "${iface_monitor_et_deauth}" type monitor 2> /dev/null
fi
ip link set "${iface_monitor_et_deauth}" up > /dev/null 2>&1
iw "${iface_monitor_et_deauth}" set channel "${channel}" > /dev/null 2>&1
}
function multint_override_prepare_et_interface() {
debug_print
et_initial_state=${ifacemode}
if [ "${multint_enabled}" -eq 1 ]; then
ifacemode="Managed"
multint_deauth_interface="${interface}"
interface="${multint_ap_interface}"
fi
if [ "${ifacemode}" != "Managed" ]; then
check_airmon_compatibility "interface"
if [ "${interface_airmon_compatible}" -eq 1 ]; then
new_interface=$(${airmon} stop "${interface}" 2> /dev/null | grep station | head -n 1)
ifacemode="Managed"
[[ ${new_interface} =~ \]?([A-Za-z0-9]+)\)?$ ]] && new_interface="${BASH_REMATCH[1]}"
if [ "${interface}" != "${new_interface}" ]; then
if check_interface_coherence; then
interface=${new_interface}
phy_interface=$(physical_interface_finder "${interface}")
check_interface_supported_bands "${phy_interface}" "main_wifi_interface"
current_iface_on_messages="${interface}"
fi
echo
language_strings "${language}" 15 "yellow"
fi
else
if ! set_mode_without_airmon "${interface}" "managed"; then
echo
language_strings "${language}" 1 "red"
language_strings "${language}" 115 "read"
return 1
else
ifacemode="Managed"
fi
fi
fi
}
function multint_override_restore_et_interface() {
debug_print
if [ "${multint_enabled}" -eq 1 ]; then
interface="${multint_deauth_interface}"
set_mode_without_airmon "${multint_ap_interface}" "managed"
ifacemode="Monitor"
fi
echo
language_strings "${language}" 299 "blue"
disable_rfkill
mac_spoofing_desired=0
ip addr del "${et_ip_router}/${std_c_mask}" dev "${interface}" > /dev/null 2>&1
ip route del "${et_ip_range}/${std_c_mask_cidr}" dev "${interface}" table local proto static scope link > /dev/null 2>&1
if [ "${multint_enabled}" -eq 0 ]; then
if [ "${et_initial_state}" = "Managed" ]; then
set_mode_without_airmon "${interface}" "managed"
ifacemode="Managed"
else
if [ "${interface_airmon_compatible}" -eq 1 ]; then
new_interface=$(${airmon} start "${interface}" 2> /dev/null | grep monitor)
desired_interface_name=""
[[ ${new_interface} =~ ^You[[:space:]]already[[:space:]]have[[:space:]]a[[:space:]]([A-Za-z0-9]+)[[:space:]]device ]] && desired_interface_name="${BASH_REMATCH[1]}"
if [ -n "${desired_interface_name}" ]; then
echo
language_strings "${language}" 435 "red"
language_strings "${language}" 115 "read"
return
fi
ifacemode="Monitor"
[[ ${new_interface} =~ \]?([A-Za-z0-9]+)\)?$ ]] && new_interface="${BASH_REMATCH[1]}"
if [ "${interface}" != "${new_interface}" ]; then
interface=${new_interface}
phy_interface=$(physical_interface_finder "${interface}")
check_interface_supported_bands "${phy_interface}" "main_wifi_interface"
current_iface_on_messages="${interface}"
fi
else
if set_mode_without_airmon "${interface}" "monitor"; then
ifacemode="Monitor"
fi
fi
fi
fi
control_routing_status "end"
}
function multint_override_select_secondary_interface() {
debug_print
if [ "${return_to_et_main_menu}" -eq 1 ]; then
return 1
fi
if [ "${return_to_enterprise_main_menu}" -eq 1 ]; then
return 1
fi
clear
if [ -n "${enterprise_mode}" ]; then
current_menu="enterprise_attacks_menu"
case ${enterprise_mode} in
"smooth")
language_strings "${language}" 522 "title"
;;
"noisy")
language_strings "${language}" 523 "title"
;;
esac
elif [[ -z "${enterprise_mode}" ]] && [[ -z "${et_mode}" ]]; then
current_menu="dos_attacks_menu"
elif [[ -z "${enterprise_mode}" ]] && [[ -n "${et_mode}" ]]; then
current_menu="evil_twin_attacks_menu"
case ${et_mode} in
"et_onlyap")
language_strings "${language}" 270 "title"
;;
"et_sniffing")
language_strings "${language}" 291 "title"
;;
"et_sniffing_sslstrip2")
language_strings "${language}" 292 "title"
;;
"et_sniffing_sslstrip2_beef")
language_strings "${language}" 397 "title"
;;
"et_captive_portal")
language_strings "${language}" 293 "title"
;;
esac
fi
if [ "${1}" = "dos_pursuit_mode" ]; then
if [ "${multint_enabled}" -eq 1 ]; then
readarray -t secondary_ifaces < <(iw dev | grep "Interface" | awk '{print $2}' | grep "${interface}" -v | grep "${multint_ap_interface}" -v)
else
readarray -t secondary_ifaces < <(iw dev | grep "Interface" | awk '{print $2}' | grep "${interface}" -v)
fi
elif [ "${1}" = "internet" ]; then
if [ "${multint_enabled}" -eq 1 ]; then
if [ -n "${secondary_wifi_interface}" ]; then
readarray -t secondary_ifaces < <(ip link | grep -E "^[0-9]+" | cut -d ':' -f 2 | awk '{print $1}' | grep -E "^lo$" -v | grep "${interface}" -v | grep "${secondary_wifi_interface}" -v | grep "${multint_ap_interface}" -v)
else
readarray -t secondary_ifaces < <(ip link | grep -E "^[0-9]+" | cut -d ':' -f 2 | awk '{print $1}' | grep -E "^lo$" -v | grep "${interface}" -v | grep "${multint_ap_interface}" -v)
fi
else
if [ -n "${secondary_wifi_interface}" ]; then
readarray -t secondary_ifaces < <(ip link | grep -E "^[0-9]+" | cut -d ':' -f 2 | awk '{print $1}' | grep -E "^lo$" -v | grep "${interface}" -v | grep "${secondary_wifi_interface}" -v)
else
readarray -t secondary_ifaces < <(ip link | grep -E "^[0-9]+" | cut -d ':' -f 2 | awk '{print $1}' | grep -E "^lo$" -v | grep "${interface}" -v)
fi
fi
fi
if [ ${#secondary_ifaces[@]} -eq 1 ]; then
if [ "${1}" = "dos_pursuit_mode" ]; then
secondary_wifi_interface="${secondary_ifaces[0]}"
secondary_phy_interface=$(physical_interface_finder "${secondary_wifi_interface}")
check_interface_supported_bands "${secondary_phy_interface}" "secondary_wifi_interface"
elif [ "${1}" = "internet" ]; then
internet_interface="${secondary_ifaces[0]}"
fi
echo
language_strings "${language}" 662 "yellow"
language_strings "${language}" 115 "read"
return 0
fi
option_counter=0
for item in "${secondary_ifaces[@]}"; do
if [ "${option_counter}" -eq 0 ]; then
if [ "${1}" = "dos_pursuit_mode" ]; then
echo
language_strings "${language}" 511 "green"
elif [ "${1}" = "internet" ]; then
echo
language_strings "${language}" 279 "green"
fi
print_simple_separator
if [ -n "${enterprise_mode}" ]; then
language_strings "${language}" 521
else
language_strings "${language}" 266
fi
print_simple_separator
fi
option_counter=$((option_counter + 1))
if [ ${#option_counter} -eq 1 ]; then
spaceiface=" "
else
spaceiface=" "
fi
set_chipset "${item}"
echo -ne "${option_counter}.${spaceiface}${item} "
if [ -z "${chipset}" ]; then
language_strings "${language}" 245 "blue"
else
if [ "${is_rtl_language}" -eq 1 ]; then
echo -e "${blue_color}// ${normal_color}${chipset} ${yellow_color}:Chipset${normal_color}"
else
echo -e "${blue_color}// ${yellow_color}Chipset:${normal_color} ${chipset}"
fi
fi
done
if [ "${option_counter}" -eq 0 ]; then
if [ -n "${enterprise_mode}" ]; then
return_to_enterprise_main_menu=1
elif [[ -z "${enterprise_mode}" ]] && [[ -n "${et_mode}" ]]; then
return_to_et_main_menu=1
return_to_et_main_menu_from_beef=1
fi
echo
if [ "${1}" = "dos_pursuit_mode" ]; then
language_strings "${language}" 510 "red"
elif [ "${1}" = "internet" ]; then
language_strings "${language}" 280 "red"
fi
language_strings "${language}" 115 "read"
return 1
fi
if [ ${option_counter: -1} -eq 9 ]; then
spaceiface+=" "
fi
print_hint ${current_menu}
read -rp "> " secondary_iface
if [ "${secondary_iface}" -eq 0 ] 2> /dev/null; then
if [ -n "${enterprise_mode}" ]; then
return_to_enterprise_main_menu=1
elif [[ -z "${enterprise_mode}" ]] && [[ -n "${et_mode}" ]]; then
return_to_et_main_menu=1
return_to_et_main_menu_from_beef=1
fi
return 1
elif [[ ! ${secondary_iface} =~ ^[[:digit:]]+$ ]] || ((secondary_iface < 1 || secondary_iface > option_counter)); then
if [ "${1}" = "dos_pursuit_mode" ]; then
invalid_secondary_iface_selected "dos_pursuit_mode"
else
invalid_secondary_iface_selected "internet"
fi
else
option_counter2=0
for item2 in "${secondary_ifaces[@]}"; do
option_counter2=$((option_counter2 + 1))
if [ "${secondary_iface}" = "${option_counter2}" ]; then
if [ "${1}" = "dos_pursuit_mode" ]; then
secondary_wifi_interface=${item2}
secondary_phy_interface=$(physical_interface_finder "${secondary_wifi_interface}")
check_interface_supported_bands "${secondary_phy_interface}" "secondary_wifi_interface"
elif [ "${1}" = "internet" ]; then
internet_interface=${item2}
fi
break
fi
done
return 0
fi
}
function initialize_multint_language_strings() {
debug_print
arr["ENGLISH","multint_text_1"]="Select an interface for AP (Master Mode):"
arr["SPANISH","multint_text_1"]="Selecciona una interfaz para AP (Master Mode):"
arr["FRENCH","multint_text_1"]="Sélectionnez une interface pour AP (Master Mode) :"
arr["CATALAN","multint_text_1"]="Seleccioneu una interfície per a AP (Master Mode):"
arr["PORTUGUESE","multint_text_1"]="Selecione uma interface para AP (Master Mode):"
arr["RUSSIAN","multint_text_1"]="Выберите интерфейс для AP (Master Mode):"
arr["GREEK","multint_text_1"]="Επιλέξτε μια διεπαφή για AP (Master Mode):"
arr["ITALIAN","multint_text_1"]="Seleziona un'interfaccia per AP (Master Mode):"
arr["POLISH","multint_text_1"]="Wybierz interfejs dla AP (Master Mode):"
arr["GERMAN","multint_text_1"]="Wählen Sie eine Schnittstelle für AP (Master Mode):"
arr["TURKISH","multint_text_1"]="AP (Master Mode) için bir arayüz seçin:"
arr["ARABIC","multint_text_1"]="حدد واجهة لـ AP (Master Mode):"
arr["CHINESE","multint_text_1"]="请选择一个接口用于 AP (Master Mode):"
arr["ENGLISH","multint_text_2"]="Select an interface for Deauth (Monitor Mode):"
arr["SPANISH","multint_text_2"]="Selecciona una interfaz para Deauth (Monitor Mode):"
arr["FRENCH","multint_text_2"]="Sélectionnez une interface pour Deauth (Monitor Mode) :"
arr["CATALAN","multint_text_2"]="Seleccioneu una interfície per a Deauth (Monitor Mode:"
arr["PORTUGUESE","multint_text_2"]="Selecione uma interface para Deauth (Monitor Mode):"
arr["RUSSIAN","multint_text_2"]="Выберите интерфейс для and Deauth (Monitor Mode):"
arr["GREEK","multint_text_2"]="Επιλέξτε μια διεπαφή για Deauth (Monitor Mode):"
arr["ITALIAN","multint_text_2"]="Seleziona un'interfaccia per Deauth (Monitor Mode):"
arr["POLISH","multint_text_2"]="Wybierz interfejs dla Deauth (Monitor Mode):"
arr["GERMAN","multint_text_2"]="Wählen Sie eine Schnittstelle für Deauth (Monitor Mode):"
arr["TURKISH","multint_text_2"]="Deauth (Monitor Mode) için bir arayüz seçin:"
arr["ARABIC","multint_text_2"]="حدد واجهة لـ Deauth (Monitor Mode):"
arr["CHINESE","multint_text_2"]="请选择一个接口用于 Deauth (Monitor Mode):"
}
initialize_multint_language_strings