-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathokeus
executable file
·134 lines (126 loc) · 5.88 KB
/
okeus
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
#!/usr/bin/env python3
# OkeusStrike - Advanced Deauthentication Attack Tool - okeus
# Copyright (C) 2025 Richard Smith (Islc12)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# not all these imports are used in the final code, they are here until I determine exactly which file they will be used in
import socket # Low-level networking with raw sockets
import okeusarguments # Parsing command-line arguments from arguments.py
import discover # Network discovery functions from discovery.py
import convert # MAC address conversion from convert.py
import powerchan # Power level adjustment from powerchange.py
import output # File output functions from output.py
import mac # Handles target, source and bssid flags
import input # Handles file input and reason codes
import massatk # Handles flooding and broadcast attacks
import timer # Handles time-based attack types
import framecontrol # Handles fragmentation and sequencing
import os # Interact with the underlying OS
import time # Time-based attack types (delays, duration, etc.)
import glob # File navigation for captured files
import struct # Unpacking binary data (e.g., network headers)
import binascii # Convert between binary and ASCII representations
import fcntl # Low-level network interface control (e.g., setting flags)
import select # Non-blocking I/O and socket timeout handling
import errno # Handling OS-level network errors
import sys # System-specific functionality (e.g., exiting on errors)
import itertools # Iterating over values (useful for fragmentation/sequencing)
import threading # multithreading for file writing while capturing/attacking
# Check if the script is running with root privileges, exits if not
if os.geteuid() != 0:
print("ATTENTION: Script requires root privlages, please run as root")
exit(1)
def main():
args = okeusarguments.parse_arguments()
# Parse command-line arguments
write_file = args.writefile # mapped
interface = args.netinterface # handled automatically
net_discovery = args.discover_networks # mapped
client_discovery = args.client_discover # mapped
net_channel = args.channel # mapped
power_level = args.power # mapped
target_macs = args.target # mapped
source_mac = args.ap_source # mapped
network_bssid = args.net_bssid # mapped
broadcast_attack = args.broadcast # mapped
timedelay = args.time # mapped
frame_flood = args.flood # mapped
num_frames = args.count # mapped
frag_size = args.fragment_size # mapped
sequence_number = args.sequence # mapped
reason = args.reason_code # mapped
dur_of_attack = args.duration # mapped
# handle all illogical arguments
if write_file and not (net_discovery or client_discovery or target_macs):
print("Error: --writefile requires --discover, --client-discover, or --target")
exit(1)
if frame_flood and (num_frames or timedelay or dur_of_attack):
print("Error: --flood requires no other arguments")
exit(1)
if client_discovery and (target_macs or source_mac or broadcast_attack or timedelay or frame_flood or num_frames or frag_size or sequence_number or reason or dur_of_attack):
print("Error: --client-discover requires no other arguments")
exit(1)
if net_discovery and (client_discovery or net_channel or target_macs or source_mac or network_bssid or broadcast_attack or timedelay
or frame_flood or num_frames or frag_size or sequence_number or reason or dur_of_attack):
print("Error: --discover requires no other arguments")
exit(1)
if (target_macs and network_bssid) and not source_mac: # allows source mac address to be optional
source_mac = network_bssid
if (power_level or broadcast_attack or timedelay or frame_flood or num_frames or
frag_size or sequence_number or reason or dur_of_attack) and not target_macs:
print("Error: target input required") # requires target input for most operations
exit(1)
if (power_level or broadcast_attack or timedelay or frame_flood or num_frames or
frag_size or sequence_number or reason or dur_of_attack) and not network_bssid:
print("Error: network BSSID required") # requires network BSSID for most operations
exit(1)
# start logic
if net_discovery:
discover.disc(interface)
if write_file:
output.create_file(write_file)
if client_discovery:
xmac = convert.machex(client_discovery)
discover.client_disc(xmac, interface)
if net_channel:
powerchan.channelinput(net_channel)
if power_level:
powerchan.powerinput(power_level)
if target_macs:
xmac = convert.machex(target_macs)
mac.target(xmac)
if source_mac:
xmac = convert.machex(source_mac)
mac.source(xmac)
if network_bssid:
xmac = convert.machex(network_bssid)
mac.bssid(xmac)
if broadcast_attack:
massatk.broadcast()
if timedelay:
timer.time_delay(timedelay)
if frame_flood:
massatk.deauthflood(frame_flood)
if num_frames:
timer.user_frames(num_frames)
if frag_size:
framecontrol.userfragment(frag_size)
if sequence_number:
framecontrol.sequenceinput(sequence_number)
if reason:
input.reasoncode_input(reason)
if dur_of_attack:
timer.duration_input(dur_of_attack)
if __name__ == "__main__":
main()