Module 12: Attacking WPA Enterprise

Basics

Uses Extensible Authentication Protocol (EAP) and Remote Authentication Dial-In User Service (RADIUS) for authentication. Older (deprecated) methods of EAP don't require certificates, newer do.

Commonly used EAP methods on Wi-Fi networks:

  • EAP Transport Layer Security (EAP-TLS): Uses a certificate on the server and client side, instead of username/password.

  • EAP Tunneled Transport Layer Security (EAP-TTLS): Doesn't necessarily need client certificates. It creates a tunnel and exchanges the credentials using one of the few possible different inner methods (also called phase 2) such as Challenge-Handshake Authentication Protocol (CHAP), Authentication Protocol (PAP), Microsoft CHAP (MS-CAHP), or MS-CHAPv2.

  • Protected EAP (PEAP) also creates a TLS tunnel before credentials are exchanged. Different methods can be used. MS-CHAPv2 is a commonly used inner method.

PEAP Exchange

Just walking through a PEAP exchange.

Attack

Gathering information on our target AP (SSID Playtronics):

kali@kali:~$ sudo airodump-ng wlan0mon

...

CH  2 ][ Elapsed: 30 s ][ 1992-09-11 13:37 ][

 BSSID              PWR Beacons    #Data, #/s  CH  MB   ENC  CIPHER AUTH ESSID

 FC:EC:DA:8F:2E:90  -40     639       19    1   2  300. WPA2 CCMP   MGT  Playtronics
 00:AB:E7:ED:E9:69  -84     104        0    0   11 54e.  WPA2 CCMP   PSK  whistler
 00:C7:0F:78:6D:2E  -84     104        0    0   7  54e.  WPA2 CCMP   PSK  mother
 04:53:45:60:34:52  -84     104        0    0   5  54e.  WPA2 CCMP   PSK  arbogast

 BSSID              STATION            PWR   Rate    Lost  Packets  Probes

 04:53:45:60:34:52  0D:09:6C:60:43:54  -69    0 - 1      0       35  FederalReserve, ATC, CoolidgeInstitute, CenturionBank
 FC:EC:DA:8F:2E:90  00:DC:FE:82:EF:06  -26   54 -54      0       31  Playtronics

Checking the validity of a certificate:

Restart the dump, writing to disk:

Disable the monitor mode once we capture the handshake:

Open the capture in Wireshark, filtering for tls.handshake.certificate:

In the Packet Details, locate Extensible Authentication Protocol > Transport Layer Security > TLSv1 Record Layer: Handshake Protocol: Certificate > Handshake Protocol: Certificate > Certificates to find each certificate. Right click each certificate and select Export Packet Bytes to save the data into a file with a .der extension.

These certificates, in binary form, can be opened in the file manager or we can display information about them using OpenSSL:

Optionally, convert the file to .pem:

Installing freeradius, an open soruce RADIUS server. We'll use its scripts to generate certificates that look similar to the ones we received:

Modifying /etc/freeradius/3.0/certs/ca.cnf to match our target CA certificate so it looks less suspicious to clients if they inspect it:

Updating the server information for the same reason:

Building the certificates. First regenerate dh with a 2048 bit key:

If we run make but the certificates already exist, we will not be able to overwrite them. We have to run make destroycerts to clean up first.

Updating hostapd's mana config with our certificates:

Creating the EAP user file at /etc/hostapd-mana/mana.eap_user as referenced in our previous file:

hostapd.eap_user format:

  • The first column indicates a specific user by username or, in the event of wildcard character (*), any user. It can contain a domain name as well.

  • The second column contains the protocols allowed for the specific users and authentication phase.

  • The third one is optional and is used for the password when a specific user is mentioned.

  • The fourth one, indicated here with [2], indicates that the settings on this line are for phase 2 authentication.

Starting hostapd-mana with the configuration file we created:

Example output of a user connecting to our AP:

Using asleap to crack the password hash, using the output captured in hostapd-mana or by referencing /tmp/hostapd.credout:

crackapd can be used to automatically run asleap when it sees credentials in teh log file. If successful, it adds the user to hostapd eap_user file, allowing the user to successfully connect to our rogue AP.

We could also provide internet access by adding a DHCP server and a few nftables rules to enable routing.

We could also push the attack further by authenticating to the real AP ourselves, providing our clients access to the actual company network as well.

Last updated