-
Notifications
You must be signed in to change notification settings - Fork 17
/
fuzz.py
366 lines (363 loc) · 15.3 KB
/
fuzz.py
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
import subprocess
from Mngmt_frames.Beacon import Beacon
from Mngmt_frames.AssoReq import AssoReq
from Mngmt_frames.AssoResp import AssoResp
from Mngmt_frames.Authentication import Authentication
from Mngmt_frames.Probe_request import ProbeReq
from Mngmt_frames.Probe_response import Proberesp
from Mngmt_frames.ReassoReq import ReassoReq
from Mngmt_frames.ReassoResp import ReassoResp
from Connection_monitors.DeauthMonitor import DeauthMon
from Connection_monitors.AlivenessCheck import AllvCheck
from Msgs_colors import bcolors
from Ctrl_frames.ControlFrames import ControlFrames
from Data_frames.DataFrames import DataFrames
from fuzzer_init import *
from time import sleep
import threading
import settings
import sys
import os
import ascii_art
print(ascii_art.logo)
print('- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \n\n')
print('\t\tThis tool is capable of fuzzing either any management, control or data frame of the 802.11\n\t\tprotocol or the SAE exchange. For the management, control or data frames, you can choose\n\t\teither the "standard" mode where all of the frames transmitted have valid size values or\n\t\tthe "random" mode where the size value is random. The SAE fuzzing operation requires an AP\n\t\tthat supports WPA3. Management, control or data frame fuzzing can be executed against any AP\n\t\t(WPA2 or WPA3). Finally, a DoS attack vector is implemented, which exploits the findings of\n\t\tthe management, control or data frames fuzzing.\n')
print('- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \n\n')
print('1) Fuzz Management Frames')
print('2) Fuzz SAE exchange')
print('3) Fuzz Control Frames')
print('4) Fuzz Data Frames '+ bcolors.WARNING + '(BETA)' + bcolors.ENDC)
print('5) DoS attack module\n\n')
try:
choice = int(input('Enter a choice: '))
except:
print('\n' + bcolors.FAIL + 'Only integer inputs accepted' + bcolors.ENDC)
os._exit(0)
if choice == 1:
subprocess.call(['clear'], shell=True)
print(ascii_art.mngmt_frames)
print('Type "standard" for the standard mode')
print('Type "random" for the random mode\n\n')
mode = input('Enter a choice: ').lower()
if mode == 'standard' or mode == 'random':
Aliveness = AllvCheck(targeted_STA, 'fuzzing')
Aliveness.start()
while not settings.retrieving_IP:
if settings.IP_not_alive:
os._exit(0)
sleep(10)
subprocess.call(['clear'], shell=True)
else:
print(bcolors.FAIL + '\nNo such mode :(' + bcolors.ENDC)
os._exit(0)
subprocess.call(['clear'], shell=True)
print(ascii_art.mngmt_frames)
print('Which frames would you like to fuzz?')
print('1) Beacon frames')
print('2) Probe request frames')
print('3) Probe response frames')
print('4) Association request frames')
print('5) Association response frames')
print('6) Reassociation request frames')
print('7) Reassociation response frames')
print('8) Authentication frames\n\n')
try:
choice2 = int(input('Select a frame to fuzz: '))
except:
print('\n' + bcolors.FAIL + 'Only integer inputs accepted' + bcolors.ENDC)
os._exit(0)
Deauth_monitor = DeauthMon(targeted_AP, targeted_STA, att_interface)
Deauth_monitor.start()
if choice2 == 1:
if mode == 'random':
subprocess.call(['clear'], shell=True)
print(ascii_art.beacon)
print(ascii_art.wifi)
print("1) Target the STA and impersonate the AP")
print("2) Target the AP and impersonate the STA\n\n")
try:
direction = int(input('Select a frame to fuzz: '))
except:
print('\n' + bcolors.FAIL + 'Only integer inputs accepted' + bcolors.ENDC)
os._exit(0)
if direction in {1, 2}:
pass
else:
print(bcolors.FAIL + '\nNo such mode :(' + bcolors.ENDC)
os._exit(0)
else:
direction = 1
fuzz_beacons = Beacon(mode, "beacon", targeted_STA, targeted_AP, att_interface, real_ap_ssid, direction)
subprocess.call(['clear'], shell=True)
print(ascii_art.beacon)
print(ascii_art.wifi)
print("Fasten your seatbelts and grab a coffee. Fuzzing is about to begin!")
sleep(5)
fuzz_beacons.fuzz_beacon()
elif choice2 == 2:
fuzz_probe_reqs = ProbeReq(mode, "probe request", targeted_AP, targeted_STA, att_interface, real_ap_ssid)
subprocess.call(['clear'], shell=True)
print(ascii_art.probe_req)
print(ascii_art.wifi)
print("Fasten your seatbelts and grab a coffee. Fuzzing is about to begin!")
sleep(5)
fuzz_probe_reqs.fuzz_probe_req()
elif choice2 == 3:
if mode == 'random':
subprocess.call(['clear'], shell=True)
print(ascii_art.probe_resp)
print(ascii_art.wifi)
print("1) Target the STA and impersonate the AP")
print("2) Target the AP and impersonate the STA\n\n")
try:
direction = int(input('Select a frame to fuzz: '))
except:
print('\n' + bcolors.FAIL + 'Only integer inputs accepted' + bcolors.ENDC)
os._exit(0)
if direction in {1, 2}:
pass
else:
print(bcolors.FAIL + '\nNo such mode :(' + bcolors.ENDC)
os._exit(0)
else:
direction = 1
fuzz_probe_resp = Proberesp(mode, "probe response", targeted_STA, targeted_AP, att_interface, real_ap_ssid, direction)
subprocess.call(['clear'], shell=True)
print(ascii_art.probe_resp)
print(ascii_art.wifi)
print("Fasten your seatbelts and grab a coffee. Fuzzing is about to begin!")
sleep(5)
fuzz_probe_resp.fuzz_probe_resp()
elif choice2 == 4:
fuzz_asso_reqs = AssoReq(mode, "association request", targeted_AP, targeted_STA, att_interface, real_ap_ssid)
subprocess.call(['clear'], shell=True)
print(ascii_art.asso_req)
print(ascii_art.wifi)
print("Fasten your seatbelts and grab a coffee. Fuzzing is about to begin!")
sleep(5)
fuzz_asso_reqs.fuzz_asso_req()
elif choice2 == 5:
if mode == 'random':
subprocess.call(['clear'], shell=True)
print(ascii_art.asso_resp)
print(ascii_art.wifi)
print("1) Target the STA and impersonate the AP")
print("2) Target the AP and impersonate the STA\n\n")
try:
direction = int(input('Select a frame to fuzz: '))
except:
print('\n' + bcolors.FAIL + 'Only integer inputs accepted' + bcolors.ENDC)
os._exit(0)
if direction in {1, 2}:
pass
else:
print(bcolors.FAIL + '\nNo such mode :(' + bcolors.ENDC)
os._exit(0)
else:
direction = 1
fuzz_asso_resp = AssoResp(mode, "association response", targeted_STA, targeted_AP, att_interface, direction)
subprocess.call(['clear'], shell=True)
print(ascii_art.asso_resp)
print(ascii_art.wifi)
print("Fasten your seatbelts and grab a coffee. Fuzzing is about to begin!")
sleep(5)
fuzz_asso_resp.fuzz_asso_resp()
elif choice2 == 6:
fuzz_reasso_reqs = ReassoReq(mode, "reassociation request", targeted_AP, targeted_STA, att_interface, real_ap_ssid)
subprocess.call(['clear'], shell=True)
print(ascii_art.reasso_req)
print(ascii_art.wifi)
print("Fasten your seatbelts and grab a coffee. Fuzzing is about to begin!")
sleep(5)
fuzz_reasso_reqs.fuzz_reasso_req()
elif choice2 == 7:
if mode == 'random':
subprocess.call(['clear'], shell=True)
print(ascii_art.reasso_resp)
print(ascii_art.wifi)
print("1) Target the STA and impersonate the AP")
print("2) Target the AP and impersonate the STA\n\n")
try:
direction = int(input('Select a frame to fuzz: '))
except:
print('\n' + bcolors.FAIL + 'Only integer inputs accepted' + bcolors.ENDC)
os._exit(0)
if direction in {1, 2}:
pass
else:
print(bcolors.FAIL + '\nNo such mode :(' + bcolors.ENDC)
os._exit(0)
else:
direction = 1
fuzz_asso_resp = ReassoResp(mode, "reassociation response", targeted_STA, targeted_AP, att_interface, direction)
subprocess.call(['clear'], shell=True)
print(ascii_art.reasso_resp)
print(ascii_art.wifi)
print("Fasten your seatbelts and grab a coffee. Fuzzing is about to begin!")
sleep(5)
fuzz_asso_resp.fuzz_reasso_resp()
elif choice2 == 8:
fuzz_auth = Authentication(mode, "authentication", targeted_AP, targeted_STA, att_interface)
subprocess.call(['clear'], shell=True)
print(ascii_art.auth)
print(ascii_art.wifi)
print("Fasten your seatbelts and grab a coffee. Fuzzing is about to begin!")
sleep(5)
fuzz_auth.fuzz_auth()
elif choice == 2:
subprocess.call(['clear'], shell=True)
subprocess.call(['sudo python3 dos-sae.py'], shell=True)
elif choice == 3:
subprocess.call(['clear'], shell=True)
print(ascii_art.control_frames)
print('Type "standard" for the standard mode')
print('Type "random" for the random mode\n\n')
mode = input('Enter a choice: ').lower()
if mode == 'standard' or mode == 'random':
Aliveness = AllvCheck(targeted_STA, 'fuzzing')
Aliveness.start()
while not settings.retrieving_IP:
if settings.IP_not_alive:
os._exit(0)
sleep(10)
subprocess.call(['clear'], shell=True)
else:
print(bcolors.FAIL + '\nNo such mode :(' + bcolors.ENDC)
os._exit(0)
subprocess.call(['clear'], shell=True)
print(ascii_art.control_frames)
print("1) Target the STA and impersonate the AP")
print("2) Target the AP and impersonate the STA\n\n")
try:
direction = int(input('Select a frame to fuzz: '))
except:
print('\n' + bcolors.FAIL + 'Only integer inputs accepted' + bcolors.ENDC)
os._exit(0)
if direction in {1, 2}:
pass
else:
print(bcolors.FAIL + '\nNo such mode :(' + bcolors.ENDC)
os._exit(0)
subprocess.call(['clear'], shell=True)
print(ascii_art.control_frames)
print('Which frames would you like to fuzz?')
print('1) Beamforming Report Poll')
print('2) VHT/HE NDP Announcement')
print('3) Control Frame Extension')
print('4) Control wrapper')
print('5) Block Ack Request (BAR)')
print('6) Block ACK')
print('7) PS-Poll (Power Save-Poll)')
print('8) RTS–Request to Send')
print('9) CTS-Clear to Send')
print('10) ACK')
print('11) CF-End (Contention Free-End)')
print('12) CF-End & CF-ACK\n\n')
try:
choice2 = int(input('Select a frame to fuzz: '))
except:
print('\n' + bcolors.FAIL + 'Only integer inputs accepted' + bcolors.ENDC)
os._exit(0)
if choice2 == 3:
subprocess.call(['clear'], shell=True)
print(ascii_art.control_frames)
print('Which frames would you like to fuzz?')
print('1) Poll')
print('2) Service period request')
print('3) Grant')
print('4) DMG CTS')
print('5) DMG DTS')
print('6) Grant Ack')
print('7) Sector sweep (SSW)')
print('8) Sector sweep feedback (SSW-Feedback)')
print('9) Sector sweep Ack (SSW-Ack)\n\n')
try:
choice3 = int(input('Select a frame to fuzz: '))
except:
print('\n' + bcolors.FAIL + 'Only integer inputs accepted' + bcolors.ENDC)
os._exit(0)
if direction == 1:
fuzz_ctrl = ControlFrames(targeted_STA, targeted_AP, att_interface, mode, choice2, choice3 + 1)
else:
fuzz_ctrl = ControlFrames(targeted_AP, targeted_STA, att_interface, mode, choice2, choice3 + 1)
else:
if direction == 1:
fuzz_ctrl = ControlFrames(targeted_STA, targeted_AP, att_interface, mode, choice2, 0)
else:
fuzz_ctrl = ControlFrames(targeted_AP, targeted_STA, att_interface, mode, choice2, 0)
subprocess.call(['clear'], shell=True)
print(ascii_art.control_frames)
print(ascii_art.wifi)
print("Fasten your seatbelts and grab a coffee. Fuzzing is about to begin!")
sleep(5)
print(fuzz_ctrl.fuzz_ctrl_frames())
elif choice == 4:
subprocess.call(['clear'], shell=True)
print(ascii_art.data_frames)
print('Type "standard" for the standard mode')
print('Type "random" for the random mode\n\n')
mode = input('Enter a choice: ').lower()
if mode == 'standard' or mode == 'random':
Aliveness = AllvCheck(targeted_STA, 'fuzzing')
Aliveness.start()
while not settings.retrieving_IP:
if settings.IP_not_alive:
os._exit(0)
sleep(10)
subprocess.call(['clear'], shell=True)
else:
print(bcolors.FAIL + '\nNo such mode :(' + bcolors.ENDC)
os._exit(0)
subprocess.call(['clear'], shell=True)
print(ascii_art.data_frames)
print("1) Target the STA and impersonate the AP")
print("2) Target the AP and impersonate the STA\n\n")
try:
direction = int(input('Select a frame to fuzz: '))
except:
print('\n' + bcolors.FAIL + 'Only integer inputs accepted' + bcolors.ENDC)
os._exit(0)
if direction in {1, 2}:
pass
else:
print(bcolors.FAIL + '\nNo such mode :(' + bcolors.ENDC)
os._exit(0)
subprocess.call(['clear'], shell=True)
print(ascii_art.data_frames)
print('Which frames would you like to fuzz?')
print('1) Data')
print('2) Data + CF-ACK')
print('3) Data + CF-Poll')
print('4) Data + CF-Ack + CF-Poll')
print('5) Null Data')
print('6) CF-ACK (no data)')
print('7) CF-Poll (no data)')
print('8) CF-ACK + CF-Poll (no data)')
print('9) QoS Data')
print('10) QoS Data + CF-ACK')
print('11) QoS Data + CF-Poll')
print('12) QoS Data + CF-ACK + CF-Poll')
print('13) QoS Null Data')
print('14) Reserved Data Frame')
print('15) QoS Data + CF-Poll (no data)')
print('16) QoS CF-ACK + CF-Poll (no data)\n\n')
try:
choice2 = int(input('Select a frame to fuzz: '))
except:
print('\n' + bcolors.FAIL + 'Only integer inputs accepted' + bcolors.ENDC)
os._exit(0)
if direction == 1:
fuzz_data = DataFrames(targeted_STA, targeted_AP, att_interface, mode, choice2, True)
else:
fuzz_data = DataFrames(targeted_AP, targeted_STA, att_interface, mode, choice2, False)
subprocess.call(['clear'], shell=True)
print(ascii_art.data_frames)
print(ascii_art.wifi)
print("Fasten your seatbelts and grab a coffee. Fuzzing is about to begin!")
sleep(5)
print(fuzz_data.fuzz_data_frames())
elif choice == 5:
subprocess.call(['clear'], shell=True)
subprocess.call(['sudo python3 mage.py'], shell=True)
else:
print(bcolors.FAIL + '\nNo such choice :(' + bcolors.ENDC)