Fix WiFi monitor parsing, improve setup, reorganize docs

- Fix monitor interface regex parsing (Issues #27, #28)
- Add Python 3.9+ version check at startup
- Fix setup.sh to handle PEP 668 and auto-create venv
- Reorganize README: move detailed content to docs/ folder
- Add docs/FEATURES.md, USAGE.md, TROUBLESHOOTING.md, HARDWARE.md
This commit is contained in:
Smittix
2026-01-04 14:05:30 +00:00
parent 4f393c85ac
commit 3098a61487
8 changed files with 670 additions and 483 deletions
+14 -7
View File
@@ -335,19 +335,26 @@ def toggle_monitor_mode():
monitor_iface = list(new_interfaces)[0]
if not monitor_iface:
# Patterns to extract monitor interface name from airmon-ng output
# Interface names: start with letter, contain alphanumeric/underscore/dash
patterns = [
r'monitor mode.*enabled.*on\s+(\S+)',
r'\(monitor mode.*enabled.*?(\S+mon)\)',
r'created\s+(\S+mon)',
r'\bon\s+(\S+mon)\b',
r'\b(\S+mon)\b.*monitor',
# Look for interface names ending in 'mon' (most reliable)
r'\b([a-zA-Z][a-zA-Z0-9_-]*mon)\b',
# Airmon-ng format: [phyX]interfacename
r'\[phy\d+\]([a-zA-Z][a-zA-Z0-9_-]*mon)',
# "enabled for/on [phyX]interface" format
r'enabled.*?\[phy\d+\]([a-zA-Z][a-zA-Z0-9_-]*)',
# Original interface with 'mon' appended
r'\b(' + re.escape(interface) + r'mon)\b',
]
for pattern in patterns:
match = re.search(pattern, output, re.IGNORECASE)
if match:
monitor_iface = match.group(1)
break
candidate = match.group(1)
# Validate it looks like an interface name (not channel info like "10)")
if candidate and not candidate[0].isdigit() and ')' not in candidate:
monitor_iface = candidate
break
if not monitor_iface:
try: