-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
271 lines (221 loc) · 9.45 KB
/
Copy pathmain.py
File metadata and controls
271 lines (221 loc) · 9.45 KB
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
# -*- coding: utf-8 -*-
"""
╔══════════════════════════════════════════════════════════════╗
║ WiFiSlayerTool v3.0 ║
║ Developer: waheeb Al-Humaeri ║
║ GitHub: github.com/waheeb71 ║
║ Telegram: @SyberSc71 ║
╚══════════════════════════════════════════════════════════════╝
A professional WiFi security auditing tool for ethical hackers
and penetration testers. Built for Kali Linux.
Usage:
sudo python3 main.py
"""
import sys
import os
import platform
# ─── Ensure we can import our packages ───────────────────────
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import config
from config import get_text, set_language
def check_dependencies():
"""Check and report missing Python dependencies."""
missing = []
try:
import rich # noqa: F401
except ImportError:
missing.append("rich")
try:
import termcolor # noqa: F401
except ImportError:
missing.append("termcolor")
if missing:
print(f"\n [!] Missing Python packages: {', '.join(missing)}")
print(f" [*] Install with: pip3 install {' '.join(missing)}")
print(f" [*] Or run: pip3 install -r requirements.txt\n")
sys.exit(1)
def check_platform():
"""Warn if not running on Linux."""
if platform.system() != "Linux":
try:
from core.ui import console, print_warning
print_warning(get_text("not_linux"))
print_warning("Some features require Linux + aircrack-ng suite")
console.print()
except Exception:
print(" [!] Warning: This tool is designed for Linux")
def check_root():
"""Check for root privileges."""
try:
if os.geteuid() != 0:
try:
from core.ui import print_error
print_error(get_text("root_required"))
print_error("Run with: sudo python3 main.py")
except Exception:
print(" [!] Run as root: sudo python3 main.py")
sys.exit(1)
except AttributeError:
# Windows doesn't have geteuid
pass
def select_language():
"""Prompt user to select language at startup."""
from core.ui import console, print_language_selector
print_language_selector()
choice = console.input("\n [bold bright_cyan]➤ Choose / اختر (1/2):[/] ").strip()
if choice == "1":
set_language("ar")
else:
set_language("en")
def check_system_packages():
"""Check if required system packages are installed."""
from core.network import check_package_installed
from core.ui import print_info, print_warning, print_success
missing = []
for pkg in config.REQUIRED_PACKAGES:
if not check_package_installed(pkg):
missing.append(pkg)
if missing:
print_warning(f"Missing packages: {', '.join(missing)}")
print_info("Install with: sudo bash install.sh")
else:
print_success("All system packages are installed ✓")
def main():
"""Main application entry point."""
# ─── Pre-flight Checks ───────────────────────────────────
check_dependencies()
from core.ui import (
console, print_banner, print_status_bar, print_main_menu,
get_menu_choice, print_info, print_success, print_error,
print_section,
)
from core.network import get_wireless_interfaces
from core.logger import log
from modules.scanner import scanner_menu
from modules.handshake import handshake_menu, crack_menu
from modules.attacker import attacker_menu
from modules.traffic import traffic_menu
from modules.wordlist import wordlist_menu
from modules.mac_spoof import mac_spoof_menu
from modules.advanced import advanced_menu
# ─── Clear screen & show banner ──────────────────────────
os.system("clear" if os.name != "nt" else "cls")
print_banner()
# ─── Language Selection ──────────────────────────────────
select_language()
# ─── Platform & Root ─────────────────────────────────────
check_platform()
# check_root() # Uncomment on production Kali
# ─── System Check ────────────────────────────────────────
console.print()
print_section("System Check")
check_system_packages()
# ─── Auto-detect Interface ───────────────────────────────
interfaces = get_wireless_interfaces()
current_interface = None
current_mode = None
if interfaces:
current_interface = interfaces[0]["name"]
current_mode = interfaces[0].get("mode", "Managed")
print_success(
f"Auto-detected interface: [bold]{current_interface}[/] "
f"({current_mode})"
)
else:
from core.ui import print_warning
print_warning(get_text("no_interfaces"))
log.info(f"Tool started. Interface={current_interface}, Lang={config.LANGUAGE}")
# ═════════════════════════════════════════════════════════
# MAIN LOOP
# ═════════════════════════════════════════════════════════
while True:
console.print()
print_status_bar(current_interface, current_mode, config.LANGUAGE)
print_main_menu()
choice = get_menu_choice()
if choice == 1:
# Scanner
result = scanner_menu(current_interface)
if result:
current_interface = result
current_mode = "Monitor" if "mon" in result else "Managed"
elif choice == 2:
# Capture Handshake
handshake_menu(current_interface)
elif choice == 3:
# Crack Password
crack_menu()
elif choice == 4:
# Traffic Analysis
traffic_menu(current_interface)
elif choice == 5:
# Deauth Attacks
attacker_menu(current_interface)
elif choice == 6:
# Wordlist Generator
wordlist_menu()
elif choice == 7:
# MAC Spoofing
mac_spoof_menu(current_interface)
elif choice == 8:
# Advanced Attacks
advanced_menu(current_interface)
elif choice == 9:
# Settings
settings_menu(current_interface)
elif choice == 0:
# Exit
console.print()
log.info("Tool exited by user")
print_info("Goodbye! Stay ethical, stay legal. 🛡️")
console.print()
break
def settings_menu(current_interface=None):
"""Settings sub-menu."""
from core.ui import console, print_sub_menu, print_success, print_error, print_info
from core.network import get_wireless_interfaces
while True:
console.print()
if get_text("choose") == "اختر":
options = [
("1", "🌐", "تغيير اللغة"),
("2", "📡", "تغيير الواجهة"),
("3", "📋", "فحص الحزم المثبتة"),
("4", "📂", "فتح مجلد السجلات"),
]
else:
options = [
("1", "🌐", "Change Language"),
("2", "📡", "Change Interface"),
("3", "📋", "Check Installed Packages"),
("4", "📂", "Open Logs Directory"),
]
print_sub_menu("⚙️ " + get_text("menu_settings"), options)
choice = console.input(
f"\n [bold bright_cyan]➤ {get_text('choose')}:[/] "
).strip()
if choice == "1":
select_language()
print_success("Language updated ✓")
elif choice == "2":
from core.ui import select_interface
interfaces = get_wireless_interfaces()
iface = select_interface(interfaces)
if iface:
print_success(f"Interface set to: {iface}")
elif choice == "3":
check_system_packages()
elif choice == "4":
print_info(f"Logs directory: {config.LOGS_DIR}")
os.system(f"ls -la {config.LOGS_DIR} 2>/dev/null || echo 'No logs yet'")
elif choice == "0":
break
else:
print_error(get_text("invalid_choice"))
# ═════════════════════════════════════════════════════════════
if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
print("\n\n Interrupted. Goodbye! 👋\n")
sys.exit(0)