A simple Python script to demonstrate WPA2 handshake validation using PMKID (Hashcat 22000 format) or 4-way handshake. This tool derives keys, verifies MICs, and attempts to confirm a correct WPA2 passphrase.
wpa2-python-checker
is a minimal Python script that can test whether a provided password matches a WPA2 handshake. It demonstrates the following steps:
- Deriving the Pairwise Master Key (PMK) via PBKDF2.
- Generating the Pairwise Transient Key (PTK) using the WPA2 PRF function.
- Computing the MIC to validate a handshake or verifying PMKID for a PMKID-based attack.
-
PMKID Checking (Hashcat 22000)
Verifies if the provided password is correct by calculating the PMKID. -
MIC Checking (4-Way Handshake)
Uses the PTK to verify the MIC of the handshake data. -
Minimal Dependencies
Only requires a small set of Python libraries (e.g.,hashlib
,hmac
,binascii
).
-
Clone the repository:
git clone https://github.com/tomasvanagas/wpa2-python-checker.git cd wpa2-python-checker
-
Install the required dependencies:
pip install pbkdf2
The project consists of a single file named checker.py
. Simply run it with Python:
python3 checker.py
You can modify or extend checker.py
to accept arguments for the password or handshake string. Currently, the script includes a RunTest
method and a small example in the main body:
password = "vanagas123"
handshake = "WPA*02*4cb5dd3b660d7936940be82911be3b94*7669d957e8ca*a4c6f023fce8*546f6d61736950686f6e65*..."
HC22000_Checker.RunTest(password, handshake)
Feel free to replace password
and handshake
with your own test values or incorporate command-line arguments as needed.
-
Edit
checker.py
, modifying the variables at the end of the file:password = "your_password_here" handshake = "WPA*02*..." HC22000_Checker.RunTest(password, handshake)
-
Run the script:
python checker.py
- If the handshake is correct, it will print the PMK and the SSID hex, followed by the password.
- If incorrect, it will return
False
without printing.