-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconfig.py
More file actions
234 lines (208 loc) · 6.2 KB
/
config.py
File metadata and controls
234 lines (208 loc) · 6.2 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
#!/usr/bin/env python3
"""
Fichero de configuración de WirelessPen.
Parámetros de configuración del Kit de Auditoría WiFi WirelessPen.
Este kit realiza EXCLUSIVAMENTE auditorías WiFi pasivas y no intrusivas.
No se transmite ninguna trama. Sin deautenticación, sin inyección.
"""
import os
from pathlib import Path
# Información del framework
FRAMEWORK_NAME = "WirelessPen"
VERSION = "3.0.0"
FRAMEWORK_VERSION = VERSION # Alias por compatibilidad
BUILD = "Passive Audit Edition"
AUTHOR = "Crypt0xDev"
# Información del autor en forma de dict (usada por los tests)
AUTHOR_INFO = {
"name": AUTHOR,
"email": "crypt0xdev@users.noreply.github.com",
"github": "https://github.com/Crypt0xDev",
}
GITHUB = "https://github.com/Crypt0xDev/WirelessPen"
LICENSE = "MIT"
BUILD_DATE = "2024-11-04"
# Requisitos del sistema
MIN_PYTHON_VERSION = "3.6"
REQUIRED_OS = ["Linux", "Kali", "Ubuntu", "Debian", "Arch"]
# Configuración de red
DEFAULT_SCAN_TIME = 30 # segundos
MONITOR_STATUS_INTERVAL = 15 # segundos entre impresiones de estado
MAX_RETRIES = 3
# Umbrales de detección de anomalías
DEAUTH_THRESHOLD = 20 # Tramas Deauth por ventana → alerta de tormenta
DEAUTH_WINDOW_SEC = 10.0
HIGH_BEACON_RATE = 50 # Beacons/s por BSSID → alerta de inundación
CONGESTION_THRESHOLD = 5 # APs en el mismo canal → info de congestión
# Configuración de canales
WIFI_CHANNELS_2_4GHZ = list(range(1, 15)) # 1-14
WIFI_CHANNELS_5GHZ = [
36,
40,
44,
48,
52,
56,
60,
64,
100,
104,
108,
112,
116,
120,
124,
128,
132,
136,
140,
149,
153,
157,
161,
165,
]
COMMON_CHANNELS = [1, 6, 11] # Canales más usados en 2,4 GHz
# Rutas de ficheros
HOME_DIR = Path.home()
OUTPUT_DIR = HOME_DIR / "WirelessPen_Results"
TEMP_DIR = "/tmp/wirelesspen"
LOG_DIR = OUTPUT_DIR / "logs"
# Rutas de diccionarios (en orden de preferencia)
WORDLIST_PATHS = [
"/usr/share/wordlists/rockyou.txt",
"/usr/share/wordlists/wpa2.txt",
"/usr/share/wordlists/fasttrack.txt",
"/opt/wordlists/rockyou.txt",
"~/wordlists/rockyou.txt",
"/usr/share/dict/american-english",
"/usr/share/dict/words",
]
# Dependencias de herramientas del sistema (todas en modo de sólo lectura / uso pasivo)
CORE_DEPENDENCIES = {
"iw": {
"commands": ["iw"],
"package": "iw",
"min_version": "5.0",
"critical": True,
"description": "Herramienta moderna de configuración inalámbrica (consulta del modo de interfaz)",
},
"wireless-tools": {
"commands": ["iwconfig"],
"package": "wireless-tools",
"min_version": "30",
"critical": False,
"description": "Herramientas de configuración inalámbrica alternativas (iwconfig)",
},
}
# Dependencias de paquetes Python
PYTHON_DEPENDENCIES = {
"scapy": {
"package": "scapy>=2.5.0",
"description": "Captura de paquetes y análisis pasivo de tramas 802.11",
},
}
# Hardware soportado en modo monitor (solo captura pasiva; no se usa inyección)
SUPPORTED_HARDWARE = {
"realtek": {
"chipsets": ["RTL8812AU", "RTL8821AU", "RTL8188EU", "RTL8192EU", "RTL8814AU"],
"drivers": ["rtl8812au", "rtl8821au", "rtl8188eu", "8812au"],
"monitor_mode": True,
},
"atheros": {
"chipsets": ["AR9271", "ATH9K", "ATH10K", "QCA9377", "QCA6174"],
"drivers": ["ath9k_htc", "ath9k", "ath10k_pci"],
"monitor_mode": True,
},
"mediatek": {
"chipsets": ["MT7610U", "MT7612U", "MT76x2U", "MT7921"],
"drivers": ["mt76x2u", "mt7610u", "mt76x0u"],
"monitor_mode": True,
},
"intel": {
"chipsets": ["AC7260", "AC8265", "AX200", "AX210"],
"drivers": ["iwlwifi"],
"monitor_mode": False,
},
"broadcom": {
"chipsets": ["BCM43142", "BCM4360", "BCM43602"],
"drivers": ["brcmfmac", "b43", "wl"],
"monitor_mode": False,
},
}
# Default configuration dict (used by tests)
DEFAULT_CONFIG = {
"scan_time": DEFAULT_SCAN_TIME,
"monitor_status_interval": MONITOR_STATUS_INTERVAL,
"deauth_threshold": DEAUTH_THRESHOLD,
"high_beacon_rate": HIGH_BEACON_RATE,
"congestion_threshold": CONGESTION_THRESHOLD,
}
# Attack Configurations
ATTACK_CONFIGS = {
"handshake": {
"timeout": HANDSHAKE_TIMEOUT,
"deauth_count": DEAUTH_COUNT,
"deauth_interval": 10,
"max_rounds": 5,
"output_format": "cap",
},
"pmkid": {
"timeout": PMKID_TIMEOUT,
"output_format": "pcapng",
"hashcat_mode": 22000,
},
"wps": {
"timeout": WPS_TIMEOUT,
"delay": 15,
"max_attempts": 11000,
"lockout_time": 300,
},
"deauth": {"packet_count": DEAUTH_COUNT, "interval": 1, "broadcast": True},
}
# Color and UI Configuration
UI_CONFIG = {
"banner_width": 80,
"table_width": 90,
"progress_bar_width": 50,
"enable_colors": True,
"enable_unicode": True,
}
# Logging Configuration
LOGGING_CONFIG = {
"level": "INFO",
"format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s",
"file_handler": True,
"console_handler": True,
"max_file_size": 10 * 1024 * 1024, # 10MB
"backup_count": 5,
}
# Security Configuration
SECURITY_CONFIG = {
"require_confirmation": True,
"destructive_attacks": ["deauth", "evil_twin"],
"max_session_time": 3600, # 1 hour
"auto_cleanup": True,
}
def get_output_directory():
"""Get the configured output directory."""
return OUTPUT_DIR
def get_wordlist():
"""Find the first available wordlist."""
for path in WORDLIST_PATHS:
expanded_path = os.path.expanduser(path)
if os.path.exists(expanded_path):
return expanded_path
return None
def create_directories():
"""Create necessary directories."""
directories = [OUTPUT_DIR, LOG_DIR, TEMP_DIR]
for directory in directories:
os.makedirs(directory, exist_ok=True)
def get_dependency_by_command(command):
"""Get dependency info by command name."""
all_deps = {**CORE_DEPENDENCIES, **OPTIONAL_DEPENDENCIES}
for dep_name, dep_info in all_deps.items():
if command in dep_info["commands"]:
return dep_name, dep_info
return None, None