Detect Evil Twin in Splunk
Adversaries may host fraudulent Wi-Fi access points using the same SSID as a legitimate network to intercept traffic, steal credentials, or deliver malware. Evil Twin attacks exploit the 802.11 protocol's lack of mutual AP authentication — clients connect to whichever access point advertises the correct SSID with the strongest signal, without verifying the AP's identity. Attackers use tools such as hostapd, airbase-ng, create_ap, or Wi-Fi Pineapple devices to clone corporate or public SSIDs. Upon connection, victims are often directed to a fake captive portal for credential harvesting or subjected to man-in-the-middle attacks against unencrypted or SSL-stripped traffic. Attackers may also listen for 802.11 probe requests in which client devices broadcast previously connected network names (Preferred Network Lists), responding with matching SSIDs to automatically attract victim connections. APT28 (Fancy Bear / GRU) operationally deployed Wi-Fi Pineapple devices for Evil Twin attacks during intelligence collection operations against Organization for the Prohibition of Chemical Weapons (OPCW) and other targets, as documented in the October 2018 GRU indictment.
MITRE ATT&CK
- Tactic
- Credential Access Collection
- Technique
- T1557 Adversary-in-the-Middle
- Sub-technique
- T1557.004 Evil Twin
- Canonical reference
- https://attack.mitre.org/techniques/T1557/004/
SPL Detection Query
| tstats count WHERE index=wineventlog sourcetype="WinEventLog:Microsoft-Windows-WLAN-AutoConfig/Operational" EventCode=8001 BY _time, host, EventCode
| table _time, host, EventCode
```
```spl
(index=wineventlog OR index=windows)
sourcetype="WinEventLog:Microsoft-Windows-WLAN-AutoConfig/Operational"
(EventCode=8001 OR EventCode=11005)
| rex field=Message "(?ms)SSID\s*:\s*(?<ssid>[^\r\n]+)"
| rex field=Message "(?ms)BSSID\s*:\s*(?<bssid>[0-9a-fA-F:]{17})"
| rex field=Message "(?ms)Authentication\s+algorithm\s*:\s*(?<auth_algo>[^\r\n]+)"
| rex field=Message "(?ms)Cipher\s*:\s*(?<cipher>[^\r\n]+)"
| where isnotnull(ssid) AND len(ssid) > 0
| eval bssid=lower(trim(bssid))
| eval ssid=trim(ssid)
| eval auth_algo=lower(trim(auth_algo))
| stats
values(bssid) as observed_bssids,
dc(bssid) as unique_bssid_count,
values(host) as connected_hosts,
dc(host) as host_count,
earliest(_time) as first_seen,
latest(_time) as last_seen,
values(auth_algo) as auth_algorithms,
values(cipher) as ciphers
by ssid
| where unique_bssid_count > 2
| eval evil_twin_risk=case(
unique_bssid_count > 5, "high",
unique_bssid_count > 3, "medium",
true(), "low"
)
| eval alert_detail="SSID '" . ssid . "' observed with " . unique_bssid_count . " distinct BSSIDs across " . host_count . " hosts — potential Evil Twin AP"
| table first_seen, ssid, unique_bssid_count, observed_bssids, host_count, connected_hosts, auth_algorithms, ciphers, evil_twin_risk, alert_detail
| sort - unique_bssid_count Detects Evil Twin attacks by correlating Windows WLAN AutoConfig Event ID 8001 (successful Wi-Fi connection) events across multiple endpoints. Extracts SSID, BSSID, and authentication algorithm from event message text and identifies SSIDs associated with anomalously high numbers of unique BSSIDs — a hallmark of rogue AP deployment alongside legitimate infrastructure. The risk tier is graduated by BSSID count. Requires the Microsoft-Windows-WLAN-AutoConfig/Operational event log to be forwarded to Splunk via Windows Event Forwarding (WEF) or a Splunk Universal Forwarder configured with the wineventlog input for that channel.
Data Sources
Required Sourcetypes
False Positives & Tuning
- Large campus environments with many physical access points — each has a unique BSSID for the same SSID; tune unique_bssid_count threshold based on actual AP count from wireless controller inventory
- Band steering in enterprise APs producing multiple BSSIDs per physical device (one for each radio: 2.4GHz, 5GHz, 6GHz)
- Wireless mesh networks where every node has a distinct BSSID for the same SSID across building coverage areas
- Wi-Fi repeater or extender devices adding additional BSSIDs to extend an existing corporate network
- Conference or event spaces where temporary APs are deployed with the same corporate SSID under an IT-approved expansion
Other platforms for T1557.004
Testing Methodology
Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1Evil Twin AP with hostapd and dnsmasq on Linux
Expected signal: On victim Windows devices connecting to the rogue AP: WLAN AutoConfig Event ID 8001 in Microsoft-Windows-WLAN-AutoConfig/Operational showing successful connection to 'TargetCorporateSSID' with the attacker NIC's MAC address as BSSID. DHCP lease assignment from 192.168.50.x range (distinct from corporate DHCP). MDE DeviceNetworkInfo records new BSSID and gateway 192.168.50.1 for the SSID. DNS queries from victim directed to 192.168.50.1.
- Test 2Karma / Evil Twin Probe Response Attack with airbase-ng
Expected signal: Victim devices send visible 802.11 probe requests (capture with: tcpdump -i wlan0mon -e 'wlan type mgt subtype probe-req' 2>/dev/null). airbase-ng probe responses visible in tcpdump (subtype probe-resp). Victim device connection generates WLAN AutoConfig Event 8001 with airbase-ng NIC MAC as BSSID. DeviceNetworkInfo in MDE captures at0 MAC as BSSID with SSID 'TargetCorporateSSID'. DHCP logs show 192.168.55.x lease assignment.
- Test 3Wi-Fi Pineapple PineAP SSID Broadcast Configuration
Expected signal: Victim devices: WLAN AutoConfig Event 8001 with Pineapple's BSSID (Hak5 LLC OUI: 02:13:37 or similar; or randomized MAC depending on firmware version). Default gateway assignment from Pineapple's DHCP (typically 172.16.42.x or configured range). DeviceNetworkInfo captures Pineapple MAC as BSSID. Captive portal HTTP POST requests to 172.16.42.1 visible in web proxy logs. EvilPortal logs on Pineapple at /pineapple/modules/EvilPortal/logs/ contain captured credentials.
- Test 4Windows Mobile Hotspot Rogue AP (No Special Hardware Required)
Expected signal: On the attacker device: Microsoft-Windows-WLAN-AutoConfig/Operational events related to hosted network state changes; System Event Log entries for the 'Microsoft Hosted Network Virtual Adapter' appearing. On victim devices that connect: WLAN AutoConfig Event 8001 with attacker device's virtual adapter MAC (Microsoft Virtual WiFi Miniport Adapter OUI) as BSSID. Default gateway 192.168.137.1 (Windows Mobile Hotspot default) appears in DeviceNetworkInfo — distinct from corporate gateway. DeviceNetworkInfo records new BSSID for the corporate-named SSID.
References (9)
- https://attack.mitre.org/techniques/T1557/004/
- https://usa.kaspersky.com/resource-center/preemptive-safety/evil-twin-attacks
- https://kavigihan.medium.com/wireless-security-evil-twin-attack-d3842f4aef59
- https://posts.specterops.io/modern-wireless-attacks-pt-i-basic-rogue-ap-theory-evil-twin-and-karma-attacks-35a8571550ee
- https://www.bleepingcomputer.com/news/security/australian-charged-for-evil-twin-wifi-attack-on-plane/
- https://www.justice.gov/opa/press-release/file/1098481/download
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-devicenetworkinfo-table
- https://learn.microsoft.com/en-us/windows/win32/nativewifi/wlan-profileschema-elements
- https://github.com/hak5/wifipineapple-modules
Unlock Pro Content
Get the full detection package for T1557.004 including response playbook, investigation guide, and atomic red team tests.