WPA2 & WPA3 Enterprise Networks

Defeating WPA2 Enterprise PEAP Authentication Demonstration

In this section, we’ll cover how to exploit WPA2 Enterprise PEAP authentication, a common challenge in Capture the Flag (CTF) competitions involving wireless network security. This demonstration will guide you through network reconnaissance, capturing handshakes, and launching a Man-in-the-Middle (MitM) attack to extract credentials.

You can watch the full demonstration on YouTube. For more detailed reading, refer to the source article.

Prerequisites

Ensure you have the following:

  • A wireless card that supports monitor mode.

  • The necessary tools: airodump-ng, aireplay-ng, hostapd-mana, Wireshark, openssl, asleap, hashcat, and wpa_supplicant.

Step-by-Step Process

1. Kill Unwanted Services and Put Your Interface into Monitor Mode

To start, stop any conflicting services and put your wireless interface into monitor mode.

airmon-ng check kill
airmon-ng start wlan0  # Replace wlan0 with your interface if necessary

2. Network Reconnaissance

Use airodump-ng to scan for wireless networks and detect WPA2 Enterprise setups.

airodump-ng wlan0mon

This command lists available wireless networks. Find the target network's BSSID, ESSID, and channel for the next steps.

  • Replace <channel> with the target network’s channel.

  • Replace <capturefile> with a filename to store the captured data.

3. Capture Handshake

Once you’ve identified the target network, start capturing packets on the specific channel:

4. Deauthenticate a Client to Capture the Handshake

To capture the handshake, deauthenticate a client connected to the target network:

  • Replace the -a and -c options with the BSSID and client MAC address you are targeting.

Once the handshake is captured, stop the monitor mode on the wireless device

5. Obtain the Certificate Files

Remote into your system and open Wireshark to capture the certificate files during the PEAP handshake. Use the following filter to capture the necessary packets:

Drill down into the packet details:

  1. Go to TLSv1 Record LayerHandshake ProtocolCertificate.

  2. Right-click the certificate string and select "Export Packet Bytes" to save the certificate file.

6. Configure and Start FreeRADIUS Server

Next, convert the certificate to the proper format and configure FreeRADIUS to use it. Start by converting the certificate:

Then, configure FreeRADIUS with the correct certificate information:

  • Country (C), State (ST), Locality (L), Organization (O), Email, and Common Name must match the certificate information.

  • Modify the ca.cnf and server.cnf files in /etc/freeradius/3.0/certs/ with the certificate details (shown as screenshots in the source).

Change directories to /etc/freeradius/3.0/certs/ and run:

7. Prepare Hostapd for EAP Authentication

Create the mana.conf file in /etc/hostapd-mana/ with the following configuration:

Next, create the mana.eap_user file in /etc/hostapd-mana/ with the following configurations:

8. Start the Hostapd-MANA Server

Run the following command to start the Hostapd-MANA server:

This will emulate a rogue AP using the WPA2 Enterprise configuration.

9. Capture User Login Credentials

Monitor traffic using hostapd-mana for successful logins. Once a user successfully authenticates, you can capture their credentials. Use asleap to crack the credentials:

10. Use Hashcat to Crack the Hashes

You can also use hashcat to crack the obtained hashes:

11. Connecting to The Wireless Network:

Finally, create a wpa.conf file for WPA2 EAP authentication. You are adding in the SSID, username, and password:

To connect to the network:

Then, obtain an IP address:

Summary

By following these steps, you’ve learned how to crack WPA2 Enterprise PEAP authentication using tools like hostapd-mana, Wireshark, and asleap. This process involves capturing handshakes, emulating a rogue AP, and cracking the credentials to gain network access. This method is often used in CTF challenges focused on wireless security and authentication exploits.

Last updated