A comprehensive, modular framework for WiFi penetration testing with a passive-first approach.
- Modular Architecture: Pluggable modules for different testing scenarios
- Passive-First Approach: Emphasizes passive reconnaissance before active attacks
- Safety Features: Built-in safe mode to prevent accidental network disruption
- Comprehensive Logging: Detailed logging and audit trails
- Multiple Attack Vectors: Handshake capture, PMKID attacks, wordlist management
- Cross-Platform: Works on Linux, macOS, and Windows (with WSL/Bash)
wifi-pentest-framework/
ββ wpf.sh # Main entrypoint (Bash)
ββ wpf.ps1 # PowerShell wrapper for Windows
ββ lib/ # Shared libraries
β ββ colors.sh # Color definitions
β ββ log.sh # Logging utilities
β ββ menu.sh # Interactive menu system
β ββ checks.sh # System checks and validation
β ββ utils.sh # Common utility functions
ββ modules/ # Core modules
β ββ iface.sh # Interface management (monitor mode, etc.)
β ββ scan_passive.sh # Passive scanning and traffic capture
β ββ analyze_pcaps.sh # PCAP analysis and statistics
β ββ handshake_stub.sh # WPA handshake capture
β ββ pmkid_stub.sh # PMKID capture and processing
β ββ wordlist_tools.sh # Wordlist management and optimization
β ββ plugin_template.sh # Template for custom modules
ββ out/ # Output directory for captures and reports
ββ logs/ # Log files
ββ .env # Configuration file
Linux/macOS:
- Bash 4.0+
- Root privileges (for monitor mode and packet capture)
- Network tools:
iwconfig
,ip
,tcpdump
Windows:
- PowerShell 5.1+ or PowerShell Core
- Windows Subsystem for Linux (WSL) or Git for Windows (with Bash)
Recommended Tools:
aircrack-ng
suitetshark/wireshark
hcxtools
(for PMKID attacks)hashcat
(for password cracking)
-
Clone or download the framework:
git clone https://github.com/trefeon/wifi-pentest-framework.git wifi-pentest-framework cd wifi-pentest-framework
-
Make scripts executable (Linux/macOS):
chmod +x wpf.sh chmod +x modules/*.sh
-
Configure the framework:
# Edit .env file to customize settings nano .env
Linux/macOS:
# Interactive mode
sudo ./wpf.sh
# With specific interface
sudo ./wpf.sh -i wlan0
# Disable safe mode
sudo ./wpf.sh --no-safe-mode
# Show help
./wpf.sh --help
Windows:
# Interactive mode
.\wpf.ps1
# With arguments
.\wpf.ps1 -Arguments "-i", "wlan0"
- Enable/disable monitor mode
- Channel configuration
- MAC address randomization
- Interface state restoration
- Quick scans (30s, 2.4GHz)
- Extended scans (5min, 2.4GHz + 5GHz)
- Targeted scanning
- Channel hopping
- Traffic capture and analysis
- Wireless network discovery
- Handshake extraction
- Traffic statistics
- Protocol analysis
- Format conversion (CSV, JSON, text)
- Passive handshake monitoring
- Active deauthentication attacks
- Handshake validation
- Multiple target support
- Client-less PMKID attacks
- hcxtools integration
- Hashcat format preparation
- Target validation
- Wordlist optimization
- Length and pattern filtering
- Duplicate removal
- Targeted wordlist generation
- Rule-based mutations
The framework uses a .env
file for configuration. Key settings include:
# Safety and behavior
SAFE_MODE=true # Restrict destructive operations
LOG_LEVEL=INFO # Logging verbosity
VERBOSE=false # Detailed output
# Scanning
SCAN_DURATION=60 # Default scan time (seconds)
CHANNEL_HOP_INTERVAL=2 # Channel hop interval (seconds)
MAX_CAPTURE_SIZE=100M # Maximum capture file size
# Attacks
HANDSHAKE_TIMEOUT=300 # Handshake capture timeout
PMKID_TIMEOUT=120 # PMKID capture timeout
DEAUTH_COUNT=10 # Deauth packets to send
- Prevents accidental network disruption
- Limits deauthentication packet count
- Requires confirmation for destructive operations
- Provides warnings for potentially harmful actions
- All operations are logged with timestamps
- Session tracking for forensic analysis
- Error logging for troubleshooting
- Command execution history
- Automatic interface state restoration on exit
- MAC address restoration
- Monitor mode cleanup
- Signal handlers for graceful shutdown
# Start framework and navigate to "Passive Scanning" β "Quick scan"
sudo ./wpf.sh
# This performs a 30-second 2.4GHz scan and analyzes results
# Navigate to "Handshake Capture" β "Passive handshake capture"
# Enter target BSSID: AA:BB:CC:DD:EE:FF
# Wait for natural handshake or use active attack (if safe mode disabled)
# Navigate to "PMKID Capture" β "Client-less PMKID attack"
# Enter target BSSID: AA:BB:CC:DD:EE:FF
# Framework will attempt to capture PMKID for offline cracking
# Navigate to "Wordlist Tools" β "Generate targeted wordlist"
# Enter target SSID: "CompanyWiFi"
# Framework generates SSID-based password variations
Use the provided template (modules/plugin_template.sh
) to create custom modules:
-
Copy the template:
cp modules/plugin_template.sh modules/my_module.sh
-
Customize the module metadata and functions
-
Implement your specific functionality in
your_main_function()
-
Add the module to the main menu system
- Follow the existing code structure and style
- Include proper error handling and logging
- Add input validation for all user inputs
- Test with both safe mode enabled and disabled
- Update documentation for new features
bash
4.0+iwconfig
/iw
ifconfig
/ip
tcpdump
ps
,grep
,awk
,sed
-
aircrack-ng suite: Advanced WiFi tools
airodump-ng
: Network discoveryaireplay-ng
: Active attacksaircrack-ng
: WEP/WPA cracking
-
Wireshark/tshark: Packet analysis
-
hcxtools: PMKID attacks and processing
-
hashcat: Password cracking
-
john: Password cracking with rules
Ubuntu/Debian:
sudo apt update
sudo apt install aircrack-ng wireshark-common tshark hashcat
CentOS/RHEL:
sudo yum install aircrack-ng wireshark hashcat
macOS (with Homebrew):
brew install aircrack-ng wireshark hashcat
This framework is intended for:
- Authorized penetration testing
- Educational purposes
- Security research on your own networks
Users are responsible for ensuring they have proper authorization before testing any networks. Unauthorized access to computer networks is illegal in most jurisdictions.
-
"No wireless interfaces found"
- Ensure wireless adapter is connected and recognized
- Check if drivers support monitor mode
- Try:
iwconfig
orip link show
-
"Permission denied" errors
- Run with
sudo
for network operations - Check if user is in necessary groups (e.g.,
netdev
)
- Run with
-
Monitor mode fails
- Some adapters don't support monitor mode
- Try different wireless adapter
- Check for conflicting network managers
-
Tools not found
- Install missing dependencies
- Check PATH configuration
- Some tools may have different names on different systems
Enable debug mode in .env
:
DEBUG_MODE=true
LOG_LEVEL=DEBUG
This provides detailed execution information for troubleshooting.
MIT License - see LICENSE file for details
- Issues: Report bugs and request features via GitHub Issues
- Documentation: Refer to module-specific help sections
- Community: GitHub Discussions and Issues
Remember: Always obtain proper authorization before conducting any penetration testing activities.