This lab is for educational purposes ONLY and must be conducted in a completely isolated and controlled lab environment. All activities related to setting up and detecting Rogue APs must be confined to equipment you own or have explicit, written permission to test on. DO NOT scan or interfere with any networks you do not own. Unauthorized network activities are illegal and carry severe penalties.
The Rogue AP created in this lab should use a clearly identifiable test SSID (e.g., "TestLab_RogueAP") to prevent accidental connections from non-lab devices.
Lab Scenario
In this lab, one group of students (or the instructor) will act as "Attackers" by setting up a Rogue AP that mimics a legitimate network or offers open access. Another group (or all students subsequently) will act as "Defenders/Analysts" to detect this Rogue AP using various tools and techniques.
Lab Prerequisites
- Controlled Environment: An isolated lab space where Wi-Fi signals will not interfere with or be detected by external production networks.
- Student Laptops/VMs: Capable of running network analysis tools.
- Computer (Attacker Machine): Physical or VM running Kali Linux (or similar). Let's assume this machine's user is `kali`.
- Wireless Adapter (Attacker): USB wireless adapter capable of AP mode (e.g., Alfa AWUS036NHA, TP-Link TL-WN722N v1). Let's assume its interface name before monitor mode is `wlan1`.
- Ethernet Cable & Port (Optional): To connect the Rogue AP to a (controlled) wired network segment if simulating a Rogue AP connected to the corporate LAN.
- Software:
hostapd,dnsmasq.
- Computer (Analyst Machine): Physical or VM running Kali Linux or Windows/macOS with appropriate tools. Let's assume its wireless interface is `wlan0`.
- Wireless Adapter (Analyst): Standard wireless adapter for scanning. A monitor mode capable adapter is beneficial for more advanced tools.
- Software:
- Wi-Fi scanning tools (e.g., InSSIDer, Acrylic Wi-Fi Home/Professional, LinSSID,
airodump-ng, Kismet). - Network mapping tools (e.g., Nmap for wired-side scanning if applicable).
- (Optional) Wireless Intrusion Detection System (WIDS) if available for demonstration.
- Wi-Fi scanning tools (e.g., InSSIDer, Acrylic Wi-Fi Home/Professional, LinSSID,
- A legitimate Wi-Fi router configured with an SSID: "CorpNet_Lab" and WPA2-PSK security. Note its BSSID and channel.
- A list of authorized BSSIDs (MAC addresses of legitimate APs) should be prepared by the instructor.
Lab Activity Structure
Objective: Create a wireless access point that is not authorized on the lab network. This part is done on the Attacker Machine.
1. Choose Rogue AP Type & Create its `hostapd` Configuration File:
First, decide which type of Rogue AP you want to simulate. For this lab, let's choose the "Evil Twin" Rogue AP. You will create a configuration file for `hostapd` software. This file tells `hostapd` how to set up the wireless network.
On the Attacker Machine (e.g., Kali Linux):
- Open a terminal.
- Navigate to a directory where you want to save the configuration file, for example, your home directory or a new lab directory:
cd /home/kali/ # Or mkdir rogue_lab; cd rogue_lab - Use a text editor like `nano` to create and edit the file. Let's name it `hostapd-evil-twin.conf`:
nano hostapd-evil-twin.conf - Copy and paste the following configuration into the `nano` editor:
# hostapd-evil-twin.conf # This interface name (e.g., wlan1mon) will be determined in the next step interface=wlan1mon_or_AP_interface driver=nl80211 # SSID should match the legitimate network we are mimicking ssid=CorpNet_Lab # Choose a Wi-Fi channel. You can use the same as CorpNet_Lab or a different one. # Check CorpNet_Lab's channel using airodump-ng or similar tool. Let's assume channel 6 for this example. channel=6 hw_mode=g # For an OPEN Evil Twin (easier for victims to connect): # No WPA/WPA2 lines are needed below. # (Optional - for a WPA2 Evil Twin, if you want to test password prompts) # If you enable WPA2, clients will be prompted for a password. # You could use the *actual* CorpNet_Lab password if known, or a common/simple one. # wpa=2 # wpa_passphrase=MySimplePassword123 # wpa_key_mgmt=WPA-PSK # wpa_pairwise=TKIP CCMP # rsn_pairwise=CCMP - Important: In the configuration above,
interface=wlan1mon_or_AP_interfaceis a placeholder. You will determine the exact interface name in the next step after putting your wireless card into monitor mode (it's often something like `wlan1mon`). For now, you can leave it as a placeholder or make an educated guess like `wlan1mon` if your attacker interface is `wlan1`. You might need to come back and edit this file. The `ssid` should be "CorpNet_Lab" to mimic the legitimate network. Choose a `channel`. For an open Evil Twin, ensure the WPA2 lines are commented out (with `#`) or removed. - Save the file and exit `nano`: Press `Ctrl+X`, then `Y` (to confirm saving), then `Enter` (to confirm the filename `hostapd-evil-twin.conf`).
2. Prepare the Attacker Machine's Wireless Adapter for AP Mode:
On the Attacker Machine's terminal:
sudo apt update && sudo apt install -y hostapd dnsmasq # Ensure tools are installed
sudo airmon-ng check kill
sudo airmon-ng start wlan1 # Replace wlan1 with your attacker's wireless interface
This sequence stops interfering network services and attempts to put your wireless card (wlan1 in this example) into monitor mode.
Note the name of the new monitor mode interface created by `airmon-ng` (e.g., wlan1mon).
Now, go back and edit your `hostapd-evil-twin.conf` file if necessary, and change the `interface=` line to this new monitor mode interface name. For example, if `airmon-ng` created `wlan1mon`, your `hostapd-evil-twin.conf` should have `interface=wlan1mon`.
3. Configure IP Address for the Rogue AP Interface and Set up DHCP/DNS with `dnsmasq`:
On the Attacker Machine:
- Assign a static IP to your monitor mode interface (which will act as the AP). This IP will be the gateway for clients connecting to your Rogue AP.
# Replace wlan1mon with your actual monitor mode interface sudo ifconfig wlan1mon up 192.168.88.1 netmask 255.255.255.0 - Create a configuration file for `dnsmasq`. This service will provide IP addresses (DHCP) and DNS to clients connecting to your Rogue AP. In your lab directory (e.g., `/home/kali/` or `/home/kali/rogue_lab/`), create `dnsmasq-rogue.conf`:
nano dnsmasq-rogue.conf - Paste the following into `dnsmasq-rogue.conf`, ensuring the `interface` matches your monitor mode interface:
# dnsmasq-rogue.conf # Replace wlan1mon with your actual monitor mode interface interface=wlan1mon # DHCP range for clients connecting to the Rogue AP dhcp-range=192.168.88.10,192.168.88.50,255.255.255.0,12h # Gateway IP for clients (the Rogue AP itself) dhcp-option=3,192.168.88.1 # DNS server for clients (can be the Rogue AP, or a public one like Google's) dhcp-option=6,192.168.88.1 # If you want to use Google DNS directly for clients: # dhcp-option=6,8.8.8.8,8.8.4.4 server=8.8.8.8 # Upstream DNS server dnsmasq will use if acting as DNS forwarder log-queries log-dhcp listen-address=127.0.0.1,192.168.88.1 # Listen on loopback and Rogue AP IP - Save and exit `nano`.
4. Start `dnsmasq` and `hostapd` (Rogue AP Activation):
You'll need two separate terminals on the Attacker Machine for this.
- In Terminal 1 (for dnsmasq): Navigate to the directory where you saved `dnsmasq-rogue.conf` and run:
sudo dnsmasq -C dnsmasq-rogue.conf -d(The
-dflag keeps it in the foreground and shows debug messages, useful for troubleshooting). - In Terminal 2 (for hostapd): Navigate to the directory where you saved `hostapd-evil-twin.conf` (or your chosen config) and run:
sudo hostapd hostapd-evil-twin.conf(This will also run in the foreground, showing AP status messages).
Objective: Use various tools to identify the unauthorized Rogue AP established in Part 1. This is performed on Analyst Machines.
Task 2.1: Basic Wireless Scanning (All Analyst Machines)
Use standard Wi-Fi scanning tools available on your OS or installed tools.
- Windows: Built-in Wi-Fi list, InSSIDer, Acrylic Wi-Fi Home.
- macOS: Built-in Wi-Fi list (Option-click Wi-Fi icon for details like BSSID/Channel), Wireless Diagnostics.
- Linux: NetworkManager applet, LinSSID,
iwlist wlan0 scan(replacewlan0with your analyst wireless interface).
Instructions for Analysts:
- Scan for available wireless networks using one of the tools above.
- Create a table (digital or on paper) of all detected APs, noting: SSID, BSSID (MAC Address), Channel, Security Type, Signal Strength.
SSID BSSID Channel Security Signal (dBm) Notes (Authorized?) CorpNet_Lab (BSSID of Legit AP) (Channel of Legit AP) WPA2 (Signal) Authorized (from instructor list) CorpNet_Lab (BSSID of Rogue AP) 6 (or chosen Rogue channel) OPEN (Signal) Suspicious! (Rogue?) - Compare the detected APs against the instructor-provided list of authorized APs (SSIDs and BSSIDs for "CorpNet_Lab").
- Identify potential Rogue APs. What are the indicators?
- The "CorpNet_Lab" SSID appearing with a different BSSID than the authorized one.
- The "CorpNet_Lab" SSID appearing with OPEN security when the legitimate one is WPA2.
- The "CorpNet_Lab" SSID appearing on an unexpected channel.
- Any completely unexpected SSIDs (though we didn't set one up in this specific Evil Twin scenario).
Task 2.2: Advanced Wireless Scanning with Airodump-ng (Kali Linux Analysts)
Airodump-ng provides more detailed information.
- On the Analyst Kali machine, put the wireless card (
wlan0in this example) in monitor mode:sudo airmon-ng check kill sudo airmon-ng start wlan0 # Replace wlan0 if your analyst interface is different # Note the monitor interface name, e.g., wlan0mon - Start scanning using the monitor mode interface:
sudo airodump-ng wlan0mon # Or your actual monitor interface name - Analyze the output. Look for the "CorpNet_Lab" SSID. You should see two entries if both the legitimate AP and the Rogue AP are active: one with WPA2 security (legitimate) and one that is OPEN (the Rogue). Note their BSSIDs and channels.
- Document the BSSID and other details of the Rogue "CorpNet_Lab" AP.
Task 2.3: Using Kismet for Rogue AP Detection (Optional, Advanced)
Kismet is a powerful wireless network detector. (This is a brief introduction).
- If Kismet is installed (
sudo apt install kismet), configure it by editing/etc/kismet/kismet_site.conforkismet_core.conf(depending on version) to add your monitor mode interface as a source (e.g., `source=wlan0mon`). - Start Kismet (e.g.,
sudo kismetorsudo kismet_server). Access its web UI (oftenhttp://localhost:2501). - Observe detected networks. Kismet can be configured with known APs to alert on new/rogue ones. Discuss how this feature would work.
Task 2.4: Wired-Side Detection (Conceptual - if Rogue AP were connected to LAN)
This part is for discussion. If the Rogue AP were also connected to the lab's wired network, how might it be detected?
- Discussion Points:
- MAC Address Tables on Switches: An unexpected port showing multiple client MACs.
- Port Security: Could trigger violations on a managed switch.
- DHCP Logs: Rogue AP might request an IP for itself, or its clients might.
- Nmap Scans: Scanning the wired network might find the Rogue AP's IP if it obtained one.
1. Document Findings:
Each analyst/group should compile a report including:
- Tools used for detection.
- Details of the detected Rogue AP (SSID, BSSID, Channel, Security Type like OPEN).
- Reasons why it was identified as a Rogue AP (e.g., duplicate SSID with open security, BSSID not on authorized list).
- Screenshots of tool outputs showing the Rogue AP.
- Potential risks posed by this specific (open Evil Twin) Rogue AP.
2. Discussion:
Class discussion points:
- Which detection methods were most effective?
- Why is an open Evil Twin particularly dangerous? (Users might connect without realizing it's not the secure network).
- What steps would an organization take upon discovering a Rogue AP? (Locate physically, disable switch port if connected, investigate).
3. Cleanup (All Machines):
Attacker Machine:
- In the terminals running `hostapd` and `dnsmasq`, press `Ctrl+C` to stop them.
- Stop monitor mode:
sudo airmon-ng stop wlan1mon(or your attacker's monitor interface). - Restore normal network configurations (e.g.,
sudo service NetworkManager restartor reboot).
- If monitor mode was enabled, stop it:
sudo airmon-ng stop wlan0mon(or your analyst's monitor interface). - Restore normal network configurations if changed.
Key Takeaways & Risks of Rogue APs
- Bypass Network Security Controls: If connected to the internal wired network, they can bypass firewalls.
- Data Interception (MitM): Attackers can sniff unencrypted traffic from clients connected to the Rogue AP.
- Malware Distribution: Can redirect users to malicious sites.
- Unauthorized Network Access.
- Compliance Violations.
Countermeasures & Best Practices
- Regular Wireless Site Surveys.
- Wireless Intrusion Prevention/Detection Systems (WIPS/WIDS).
- 802.1X Network Access Control (NAC) on wired ports.
- Physical Security for network ports.
- Switch Port Security (MAC limiting).
- Employee Training about unauthorized APs.
- Maintain an Inventory of Authorized AP BSSIDs.
Conclusion
This lab provided a practical understanding of how Rogue Access Points, particularly Evil Twins, can be established and detected. Vigilant monitoring and a multi-layered security approach are crucial for mitigating these risks.