Skip to main content

Attacking Open and WPA2-PSK Networks

Bypass a captive portal, then capture, crack and decrypt a WPA2 handshake.

Task 1: Introduction

Task 2: Bypassing the Captive Portal

Task 3: Stealing a Session on an Open Network

Task 4: How WPA2-PSK Works

Task 5: Capturing the Handshake

Task 6: Cracking the Handshake

Task 7: Connecting to the Network

Task 8: Decrypting Traffic and Stealing Sessions

Task 9: Conclusion

Back to all walkthroughs
Room Icon

Attacking Open and WPA2-PSK Networks

Premium room

Bypass a captive portal, then capture, crack and decrypt a WPA2 handshake.

medium

60 min

589

User profile photo.
User profile photo.

To access material, start machines and answer questions login.

The Wi-Fi Fundamentals and Reconnaissance room covered observation, producing a description of an entire wireless environment without connecting to any of it. That description confers no access. This room converts it into access.

Two configurations are addressed, being the two most frequently encountered in practice. An open network requires no password and applies no encryption, so every frame crosses the radio in cleartext and is readable by any receiver in range. - does encrypt that traffic, but the scheme rests on one passphrase shared by every client, and the four-way handshake proving a client knows it can be captured and attacked offline. Recovering that passphrase exposes the traffic of every device on the network, not only the attacker's own.

Two access points from the reconnaissance scan are in scope, each identified below by its (Basic Service Set Identifier), the hardware address of the access point's radio and the value every tool in this room is pointed at. Guest-WiFi (F0:9F:C2:71:22:10) is an open network on channel 6 behind a captive portal. Home-2G (F0:9F:C2:71:22:12) is WPA2-PSK, also on channel 6, with an unknown passphrase. The objective is access to both and a flag from each. The two are worked in parallel because the WPA2 attack differs from the open one by exactly one step.

Learning Objectives

  • Bypass a captive portal on an open network by spoofing the MAC address of an already-authorised client.
  • Explain WPA2-PSK and the role of the four-way handshake in proving a client knows the passphrase.
  • Capture a WPA2 four-way handshake by deauthenticating a connected client.
  • Crack a captured handshake against a wordlist to recover the passphrase.
  • Connect to the network with the recovered passphrase and retrieve a flag from behind it.
  • Decrypt captured WPA2 traffic to steal a victim's live session cookie.

Prerequisites

Completion of the Wi-Fi Fundamentals and Reconnaissance room, which is where monitor mode and airodump-ng are introduced and practised. Both are treated here as established tools rather than taught a second time.

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. For convenience, you can use the expand button in the bottom-left corner of Split View to open the VM in full-screen mode. No login is required, as the session opens directly onto the desktop, already authenticated as the user account.

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

Open a Terminal on the machine and confirm that the wireless interfaces are present:

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

Several wlan interfaces are listed, numbered from wlan0 upward. These are the radios used to observe the networks in the lab and to attack them. Most of the tooling requires root privileges, so commands are prefixed with sudo; the password, where prompted, is user.

The attacks in this room run from a card in monitor mode, so create the monitor interface before you begin:

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

airmon-ng check kill is not optional here, and it matters for more than the monitor interface. NetworkManager manages every wireless radio on the machine, so when it is left running it will reclaim the managed radio moments after wpa_supplicant associates with a network. The association appears to succeed, wpa_supplicant reports no error, and then iw dev wlan1 link reads Not connected and every DHCPDISCOVER goes unanswered. Stopping it first avoids that, and it has to come first because the command also stops any wpa_supplicant already running.

That gives you wlan0mon, the interface every capture and injection command in this room expects. The two managed radios stay as they are, wlan2 for the open network and wlan1 for the WPA2 one once its passphrase is known, because a card in monitor mode cannot associate with anything.

Answer the questions below

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