mirror of
https://github.com/smittix/intercept.git
synced 2026-06-11 23:43:30 -07:00
Support /usr/sbin paths for aircrack-ng on Debian and add hcxtools
- Add get_tool_path() to check /usr/sbin and /sbin for tools - Update wifi.py to use full paths for airmon-ng, airodump-ng, aireplay-ng, aircrack-ng - Add hcxdumptool and hcxtools to setup.sh for Debian and macOS - Update check_cmd() in setup.sh to also check /usr/sbin and /sbin 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
+21
-1
@@ -1,15 +1,35 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
import os
|
||||
import shutil
|
||||
from typing import Any
|
||||
|
||||
logger = logging.getLogger('intercept.dependencies')
|
||||
|
||||
# Additional paths to search for tools (e.g., /usr/sbin on Debian)
|
||||
EXTRA_TOOL_PATHS = ['/usr/sbin', '/sbin']
|
||||
|
||||
|
||||
def check_tool(name: str) -> bool:
|
||||
"""Check if a tool is installed."""
|
||||
return shutil.which(name) is not None
|
||||
return get_tool_path(name) is not None
|
||||
|
||||
|
||||
def get_tool_path(name: str) -> str | None:
|
||||
"""Get the full path to a tool, checking standard PATH and extra locations."""
|
||||
# First check standard PATH
|
||||
path = shutil.which(name)
|
||||
if path:
|
||||
return path
|
||||
|
||||
# Check additional paths (e.g., /usr/sbin for aircrack-ng on Debian)
|
||||
for extra_path in EXTRA_TOOL_PATHS:
|
||||
full_path = os.path.join(extra_path, name)
|
||||
if os.path.isfile(full_path) and os.access(full_path, os.X_OK):
|
||||
return full_path
|
||||
|
||||
return None
|
||||
|
||||
|
||||
# Comprehensive tool dependency definitions
|
||||
|
||||
Reference in New Issue
Block a user