Wi-Fi networks using the WPA-PSK and WPA2-PSK suites are vulnerable to an offline dictionary attack against the secret key.

WPA Handshakes

Rather than simply using the same encryption key for all clients, when a device joins a WPA-PSK or WPA2-PSK network, it performs a special packet exchange - dubbed a handshake - to establish a temporary key which the client uses.

By collecting this handshake, it is possible to attempt to recreate the secret data by trying thousands (or millions) of passwords. When the secret matches, you now know the original pre-shared key (PSK).

Handshakes are generated when a client connects to a network and when a client session is refreshed (by default, each client refreshes the temporary encryption data every 300 seconds, or 5 minutes.)

Collecting handshakes

Collecting a handshake requires several things:

  1. A client actively connecting to a WPA-PSK or WPA2-PSK network. Handshakes are only generated when a client is connecting.
  2. The Wi-Fi Pineapple Pager must be on the correct channel at this moment. During normal recon mode the Pager rapidly changes channels to build a view of the Wi-Fi environment.
  3. Critical portions of the handshake must be captured. A handshake consists of 4 specific packets; to successfully attack a handshake specific packets are required.

Maximizing handshake collection

To maximize handshake collection, the Pager can be set to a specific channel. This can be done using the DuckyScript commands PINEAPPLE_EXAMINE_CHANNEL and PINEAPPLE_EXAMINE_BSSID to stop channel hopping and pause on a single channel, or to automatically find the channel of a known access point and pause hopping, respectively.

These commands can be run from a ssh session or the terminal in the Virtual Pager, or activated by user or recon payloads.

When locked to a channel, the Pager has the maximum chance of collecting handshakes, but will not be able to monitor devices or access points on other channels.

Handshake collection can be combined with client deauthentication to increase the chances of capture - whenever a client joins a network it performs a handshake, so by forcing clients to reconnect, new handshakes may be generated. The Pineapple client disconnection feature can be triggred from the command line or a payload using the PINEAPPLE_DEAUTH_CLIENT command.

Return to normal recon mode with PINEAPPLE_EXAMINE_RESET.

Downloading Handshakes

Captured handshakes are stored in /root/loot/handshakes/. Handshake files are stored in the original pcap format and the Hashcat hcappx format.

You can download handshakes from your Pager using scp or sftp, or by downloading loot via the Virtual Pager.