Pmkidcracker - A Tool To Crack WPA2 Passphrase With PMKID Value Without Clients Or De-Authentication

AVvXsEhw1b6pfD0Y_aPyFbES7LKYrGQOKTv_Ynhzo9d898_MKuZlOUR_x3t_ixVJ6osromyM_2aZu_Sy1GQjDekPeQLFdRhoLFLytETV6Fw1hY6xOLb-3PwEkSZBbjPtHaeNDNrvyot4RCN9aaP7W7Is4cWy-hAfjXRqfQPbCQI26in2UEpQoof5Sk4OWn44yM6D=w640-h462

This program is a tool written in Python to recover the pre-shared key of a WPA2 WiFi network without any de-authentication or requiring any clients to be on the network. It targets the weakness of certain access points advertising the PMKID value in EAPOL message 1.

Program Usage​

python pmkidcracker.py -s <SSID> -ap <APMAC> -c <CLIENTMAC> -p <PMKID> -w <WORDLIST> -t <THREADS(Optional)>
NOTE: apmac, clientmac, pmkid must be a hexstring, e.g b8621f50edd9

How PMKID is Calculated​

The two main formulas to obtain a PMKID are as follows:
  1. Pairwise Master Key (PMK) Calculation: passphrase + salt(ssid) => PBKDF2(HMAC-SHA1) of 4096 iterations
  2. PMKID Calculation: HMAC-SHA1[pmk + ("PMK Name" + bssid + clientmac)]
This is just for understanding, both are already implemented in find_pw_chunk and calculate_pmkid.

Obtaining the PMKID​

Below are the steps to obtain the PMKID manually by inspecting the packets in WireShark.
*You may use Hcxtools or Bettercap to quickly obtain the PMKID without the below steps. The manual way is for understanding.
To obtain the PMKID manually from wireshark, put your wireless antenna in monitor mode, start capturing all packets with airodump-ng or similar tools. Then connect to the AP using an invalid password to capture the EAPOL 1 handshake message. Follow the next 3 steps to obtain the fields needed for the arguments.
Open the pcap in WireShark:
  • Filter with wlan_rsna_eapol.keydes.msgnr == 1 in WireShark to display only EAPOL message 1 packets.
  • In EAPOL 1 pkt, Expand IEEE 802.11 QoS Data Field to obtain AP MAC, Client MAC
  • In EAPOL 1 pkt, Expand 802.1 Authentication > WPA Key Data > Tag: Vendor Specific > PMKID is below
If access point is vulnerable, you should see the PMKID value like the below screenshot:
AVvXsEgnhIy35QKaNmbDTGNg0V4L5m7Ip3J2R87ysRe5-Ppr38CmGV2z9M8xRiAiTM7wLGa_sicIIjPASf8hUs1CHX6EVxwqI7ur1KqfemvQ3oqdQAvqCY_YCIV1DpX-TgsgOSlNa3lBpjPjJfrLZS4vZGe8ZOADGJnSLHq-UIF-5kHAZUIh7NMEbDToW6lY-2wS=w640-h386

Demo Run​

AVvXsEh4imPJseOE_CbEZat81jEK-yGdxBs0gQmyZ91ZjvUYH5FXEL_Ck7bdTaoPwvtyfe8iD4iODbFaelY5zl7HYQ4-eA9P63OHavFreKIrKaMy6REOAQN7l6INDckFe1M78Xdwqv1-tMwJ9S1QmytlL4qizh1jmIjDzetWpsntg98--R_01Vihkg_TJ1j6d2k5=w640-h238

Disclaimer​

This tool is for educational and testing purposes only. Do not use it to exploit the vulnerability on any network that you do not own or have permission to test. The authors of this script are not responsible for any misuse or damage caused by its use.
 
뒤로
상단