Skip to main content

Attacking Weak and Misconfigured EAP

Read an enterprise login off the air, then defeat EAP-TLS by stealing its CA key.

Task 1: Introduction

Task 2: Why the EAP Method Decides the Attack

Task 3: Capturing an EAP-MD5 Exchange

Task 4: Cracking the MD5 Challenge and Response

Task 5: Enumerating the Accepted EAP Methods

Task 6: Downgrading to a Cleartext Method

Task 7: Why EAP-TLS Does Not Fall the Same Way

Task 8: Stealing the Certificate Authority

Task 9: Conclusion

Back to all walkthroughs
Room Icon

Attacking Weak and Misconfigured EAP

Premium room

Read an enterprise login off the air, then defeat EAP-TLS by stealing its CA key.

hard

90 min

92

User profile photo.
User profile photo.

To access material, start machines and answer questions login.

Enterprise Wi-Fi can be difficult to attack when it has been deployed correctly. Each user authenticates with their own credentials, so there is no shared secret sitting on the access point for us to steal. Clients that validate the certificate presented to them will also refuse to connect to an impostor, no matter what network name that impostor is using. This is where the Attacking Enterprise Wi-Fi room left off.

However, a corporate network is rarely deployed all at once. It is built up over many years, and decisions that were made a long time ago are often still in place. A network that authenticates staff laptops against a directory today might also have to support a handheld scanner that was purchased in 2011, a building management controller whose firmware was last updated by a contractor who has since retired, or a printer that supports a single authentication method and refuses every other one. Each of these is a reason for an administrator to leave an old authentication option enabled, and such options are rarely taken away again.

In this room we will attack three networks that belong to the same organisation. First, we will attack a network that runs an authentication method with no protection at all. The username is transmitted in plain text, and the proof of the password can be captured by anyone in range and then broken offline. We will not need a rogue access point to do this. We will only need the deauthentication frames that any station in range is able to transmit.

Then, we will attack a second network. Once we have enumerated the authentication methods that its RADIUS server accepts, we can use a rogue access point to negotiate the weakest of them.

Finally, we will attack a third network that runs EAP-. This method defeats every attack from the Attacking Enterprise Wi-Fi room, because no password exists anywhere in the exchange for us to capture, crack or relay. However, we can use the private key of the network's certificate authority to sign a client certificate that the network will trust.

Learning Objectives

  • Explain which EAP methods protect the inner exchange and which leave it readable.
  • Identify the EAP method in use from a capture.
  • Capture an EAP- authentication passively and extract the identity, challenge and response.
  • Recover the password from that exchange offline with hashcat mode 4800.
  • Enumerate the EAP methods a RADIUS server accepts with EAP_buster.
  • Downgrade a client to a cleartext inner method with a rogue access point.
  • Explain why EAP-TLS defeats credential capture, cracking and relaying.
  • Recognise an exposed certificate authority and use it to sign a client certificate that the network will trust.

Prerequisites

Machine Access

Start the lab by clicking the Start Machine button below. The machine takes a couple of minutes to boot and then appears in Split View in your browser. The expand button in the bottom-left corner opens the VM in full screen. No login is required, since the session opens directly onto the desktop as the user account. If you would rather work from your own machine, the same account is reachable over SSH with the credentials below. Every command in this room runs on that machine. The lab networks are emulated radios inside the machine itself, so no AttackBox is needed.

The tasks build on one another, so they are meant to be worked in order. The machine does not retain that state across a restart. Resuming the room on another day means starting the lab again and re-running the earlier tasks.

Set up your virtual environment

To successfully complete this room, you'll need to set up your virtual environment. This involves starting the Lab Machine, ensuring you're equipped with the necessary tools and access to tackle the challenges ahead.
Lab machine
Status:Off

Credentials for the lab machine are below:

Credentials

 

Username
 
user
 
Password
 
user
 
IP address
 
MACHINE_IP
 
Connection via
 
SSH
ssh user@MACHINE_IP
 

Confirming the Wireless Interfaces

First, open a Terminal on the machine. Most of the tools in this room require root privileges, so we will prefix our commands with sudo. If a password is requested, we should enter user.

We can then list the wireless interfaces with the iw dev command.

Terminal
user@debian-thm:~$ sudo iw dev

Several wlan interfaces are listed, numbered from wlan0 upward. These are the radios that we will use to observe the lab networks and to attack them.

Next, we can put one of these radios into monitor mode. Airmon-ng can be used to enable monitor mode on a wireless interface. It may also be used to terminate the processes that interfere with monitor mode.

Terminal
user@debian-thm:~$ sudo airmon-ng check kill
user@debian-thm:~$ sudo airmon-ng start wlan0

The above commands will terminate those processes and then put wlan0 into monitor mode as wlan0mon. This is the interface that every capture and injection command in this room expects.

We should not skip the airmon-ng check kill command here. NetworkManager manages every wireless radio on the machine, and it will reclaim the managed radio shortly after wpa_supplicant associates with a network. When this happens, the association appears to succeed and wpa_supplicant reports no error. However, iw dev wlan1 link then reads Not connected, and every DHCPDISCOVER goes unanswered. This command also terminates any wpa_supplicant that is already running, so it has to be run before we start one of our own.

We use the managed radio wlan1 for everything else in this room. We will use wlan1 to enumerate the methods that the RADIUS server accepts. We will use wlan1 to run our own access point. We will also use wlan1 to join two networks for real, once to reach an internal web server and once to confirm that a forged certificate works. All of the networks in this room operate on channel 44 in the 5 GHz band.

Answer the questions below

Deploy the machine and read through the introduction, then continue to the next task when you are ready.