Wi-Fi Networks
This detection identifies adversary activity consistent with gaining initial access via wireless network connections, including Wi-Fi network enumeration, suspicious wireless profile creation or modification, connection to new or unauthorized SSIDs, and process execution of wireless management utilities. The detection focuses on command-line wireless management tools (netsh wlan, nmcli, iwconfig, wpa_cli), Windows WLAN AutoConfig operational events, and anomalous wireless interface activity on dual-homed systems that may indicate a Nearest Neighbor-style bridging attack. Associated with APT28 operations documented in the Volexity Nearest Neighbor report, where threat actors compromised geographically proximate organizations to pivot via Wi-Fi into high-value targets.
What is T1669 Wi-Fi Networks?
Wi-Fi Networks (T1669) maps to the Initial Access tactic — the adversary is trying to get into your network in MITRE ATT&CK.
This page provides production-ready detection logic for Wi-Fi Networks, covering the data sources and telemetry it touches: Microsoft Defender for Endpoint, Windows Security Events. The queries below are rated high severity at medium confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.
MITRE ATT&CK
- Tactic
- Initial Access
- Technique
- T1669 Wi-Fi Networks
- Canonical reference
- https://attack.mitre.org/techniques/T1669/
let WifiManagementCommands = dynamic([
"netsh wlan connect",
"netsh wlan add profile",
"netsh wlan export profile",
"netsh wlan delete profile",
"netsh wlan show networks",
"netsh wlan show profiles",
"netsh wlan set profileparameter",
"Connect-WifiNetwork",
"Add-WifiProfile",
"iwconfig",
"nmcli device wifi",
"nmcli con add type wifi",
"wpa_cli connect",
"wpa_cli scan"
]);
let WifiEnumCommands = dynamic([
"netsh wlan show networks",
"netsh wlan show profiles",
"netsh wlan show interfaces",
"nmcli device wifi list",
"iwlist scan",
"airport -s",
"wpa_cli scan_results"
]);
union
(
DeviceProcessEvents
| where TimeGenerated > ago(1h)
| where ProcessCommandLine has_any (WifiManagementCommands)
| extend ActivityType = case(
ProcessCommandLine has "connect", "WiFi Connection Attempt",
ProcessCommandLine has "add profile" or ProcessCommandLine has "con add type wifi", "WiFi Profile Created",
ProcessCommandLine has "delete profile", "WiFi Profile Deleted",
ProcessCommandLine has "export profile", "WiFi Profile Exported",
ProcessCommandLine has "show networks" or ProcessCommandLine has "scan", "WiFi Network Enumeration",
"WiFi Management Activity"
)
| project TimeGenerated, DeviceName, AccountName, ProcessCommandLine, ActivityType,
InitiatingProcessFileName, InitiatingProcessCommandLine,
InitiatingProcessParentFileName, FolderPath, ReportId
),
(
SecurityEvent
| where TimeGenerated > ago(1h)
| where EventID == 4688
| where CommandLine has_any (WifiManagementCommands)
| extend ActivityType = case(
CommandLine has "connect", "WiFi Connection Attempt",
CommandLine has "add profile", "WiFi Profile Created",
CommandLine has "show networks", "WiFi Network Enumeration",
"WiFi Management Activity"
)
| project TimeGenerated, Computer, SubjectUserName, CommandLine, ActivityType,
NewProcessName, ParentProcessName
)
| order by TimeGenerated desc Detects wireless network management commands executed via process events and Security audit logs. Covers Windows netsh wlan operations for connecting, profiling, and enumerating Wi-Fi networks, as well as Linux wireless tools (nmcli, iwconfig, wpa_cli). Elevated priority for connection and profile creation events over enumeration alone. Particularly relevant for dual-homed endpoints where a wired corporate system suddenly issues wireless connection commands, indicative of a Nearest Neighbor-style bridging attack.
Data Sources
Required Tables
False Positives
- IT administrators using netsh wlan for legitimate network troubleshooting or configuration management of corporate laptops
- Corporate endpoint management tools (SCCM, Intune) deploying or rotating Wi-Fi profiles via scripted netsh commands during device provisioning
- Security tools and network assessment software (Nmap, Kismet host agents) performing authorized Wi-Fi surveys on designated scan hosts
- Developers and network engineers running wireless diagnostics on test systems or lab environments
- Automated onboarding scripts that connect new employee devices to corporate SSIDs using pre-staged profiles
Sigma rule & cross-platform mapping
The detection logic for Wi-Fi Networks (T1669) above is provided in a vendor-neutral
form so you can deploy it on any SIEM. The same logic is shipped here as native
KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the
following logsource:
logsource:
category: process_creation
product: windows Browse the community-maintained Sigma rules for this technique:
Platform-specific guides for T1669
References (1)
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 1Wi-Fi Network Enumeration via netsh
Expected signal: DeviceProcessEvents: ProcessCommandLine contains 'netsh wlan show networks' with parent process cmd.exe or PowerShell. SecurityEvent 4688 if process auditing enabled. Sysmon EventID 1 with CommandLine matching netsh wlan.
- Test 2Create and Connect to Wireless Profile on Windows
Expected signal: WLAN AutoConfig EventID 20019 (profile added) and EventID 8001 or 8002 (connect attempt). DeviceProcessEvents for netsh wlan add profile and netsh wlan connect. Temp file creation event for atomic_wifi.xml (Sysmon EventID 11).
- Test 3Linux Wireless Network Scan and Profile Enumeration
Expected signal: Linux auditd syscall audit for execve of nmcli, iwconfig, ip, cat processes with wireless-related arguments. Syslog entries from NetworkManager for scan requests. auditd EXECVE records if auditd is configured with -a always,exit -F arch=b64 -S execve rules.
- Test 4Export Wireless Profile with PSK (Credential Theft Simulation)
Expected signal: DeviceProcessEvents for netsh wlan export profile with key=clear parameter. Sysmon EventID 11 (file create) for XML files written to TEMP directory. Possible DeviceFileEvents for subsequent file read if contents are further processed.
Response Playbook
Triage
- Step 1: Identify the triggering process — check InitiatingProcessFileName and InitiatingProcessCommandLine. Was netsh/nmcli launched by cmd.exe, PowerShell, or a scripting engine? Legitimate admin tools typically run from known management paths (C:\Windows\System32\, SCCM client directories). Suspicious: launched from user temp dirs, AppData, or web server process trees.
- Step 2: Determine the target SSID. For netsh events, parse the CommandLine or SSID field from WLAN AutoConfig event 8001. Cross-reference the SSID against known corporate wireless networks. Any connection to an unrecognized or external SSID on a corporate device is high priority.
- Step 3: Establish whether the device is a dual-homed system — check DeviceNetworkEvents or network inventory for the host having both wired (Ethernet) and wireless (Wi-Fi) adapters. Dual-homed systems that suddenly issue wireless connection commands warrant immediate escalation per the Nearest Neighbor attack pattern.
- Step 4: Review the timeline of events on the host in the 30 minutes preceding the Wi-Fi activity. Look for RDP logins, PowerShell remoting events (4624 type 3/10), or new process executions that may indicate a prior lateral movement step that positioned the attacker to issue the wireless command.
- Step 5: Check whether wireless profiles were exported (netsh wlan export). Exported profiles contain pre-shared keys (PSKs) in cleartext and represent credential theft if exfiltrated.
- Step 6: Validate the user account context — was this executed by a domain account, local admin, or SYSTEM? SYSTEM-context wireless commands are rare for legitimate use and indicate either compromise or a misconfigured service.
- Step 7: Review WLAN AutoConfig events 8001/8003 (connect/disconnect) for repeated connection attempts to the same or multiple SSIDs, which may indicate an automated probing loop.
Containment
- If the device appears compromised, isolate it immediately via EDR (Defender for Endpoint: Isolate device action) to prevent the wireless interface from being used as a bridge into the corporate network.
- Rotate the pre-shared key (PSK) for any corporate SSIDs the device has profiles for, in case profiles were read or exported. Coordinate with network team to push key rotation to access points.
- Disable the wireless adapter on the endpoint via Group Policy (Block Wi-Fi in Network adapter settings) or registry key push if full isolation is not immediately possible.
- If a rogue AP or unauthorized SSID was connected to, alert the facilities/physical security team for physical sweep of the premises. The Nearest Neighbor technique requires physical proximity — attacker may be in building, parking lot, or adjacent facility.
- Revoke any active sessions for the user account associated with the Wi-Fi commands and force re-authentication. If SYSTEM context, investigate the compromised service and rotate service account credentials.
- Block outbound connections from the source host at the perimeter firewall while investigation proceeds, especially if the device established a wireless connection that could serve as a C2 channel.
Evidence Collection
- Export the full WLAN AutoConfig operational log: wevtutil epl Microsoft-Windows-WLAN-AutoConfig/Operational C:\Evidence\wlan_autoconfig.evtx
- Collect current and historical wireless profiles: netsh wlan export profile folder=C:\Evidence\wifi_profiles\ — note these contain PSKs in cleartext for WPA2-PSK networks.
- Capture network adapter configuration: Get-NetAdapter | Select Name,InterfaceDescription,Status,MacAddress,LinkSpeed | Export-Csv C:\Evidence\adapters.csv and Get-NetIPAddress | Export-Csv C:\Evidence\ipaddresses.csv
- Collect recent process execution history from Sysmon log: wevtutil qe Microsoft-Windows-Sysmon/Operational /q:"*[System[(EventID=1)]]" /f:xml > C:\Evidence\sysmon_processes.xml
- Export Windows Security log for logon events 4624/4625/4648 covering the 2 hours around the incident: wevtutil epl Security C:\Evidence\security.evtx
- Capture live wireless connection state: netsh wlan show interfaces > C:\Evidence\wlan_interfaces.txt and netsh wlan show networks mode=bssid > C:\Evidence\nearby_networks.txt
- Collect prefetch files from C:\Windows\Prefetch\ — look for NETSH.EXE-*.pf entries with recent timestamps indicating repeated netsh wlan executions.
- If Linux endpoint: collect /var/log/syslog entries for wpa_supplicant, NetworkManager, and iwconfig; capture /etc/NetworkManager/system-connections/ directory contents.
Escalation Criteria
- ! Escalate immediately if the host is confirmed dual-homed (active wired + wireless interfaces) and issued wireless connection commands — this matches the Nearest Neighbor attack profile and requires physical security response in addition to IR.
- ! Escalate if wireless profiles containing PSKs for production SSIDs were exported, as this constitutes credential theft for the entire wireless segment.
- ! Escalate if subsequent network events show the host communicating over a wireless interface to destinations not associated with corporate infrastructure, indicating the wireless connection was used for C2 or data exfiltration.
- ! Escalate if the wireless activity was preceded by RDP or remote PowerShell connections from an external or anomalous source IP — the classic Nearest Neighbor attack chain.
- ! Escalate if multiple endpoints in the same physical location show coordinated wireless connection events around the same timestamp, suggesting systematic reconnaissance of a Wi-Fi segment.
- ! Escalate if the SSID connected to matches a known evil twin or rogue AP pattern (corporate SSID name with slight variation, e.g., 'Corp-WiFi' vs 'Corp-WiFi2').
Investigation Guide
Forensic Artifacts
- >
Windows WLAN AutoConfig operational log: Applications and Services Logs\Microsoft\Windows\WLAN-AutoConfig\Operational — events 8001 (connected), 8002 (failed), 8003 (disconnected), 20019 (profile added) - >
Wireless profile XML files stored at C:\ProgramData\Microsoft\Wlansvc\Profiles\Interfaces\{GUID}\ — contain SSID, auth type, and encoded PSK - >
Registry key HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles\ — stores historical network connections with first/last connect timestamps and network type - >
Registry key HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\ — maps network profile GUIDs to DNS suffix and gateway MAC, useful for identifying the access point - >
Prefetch files for NETSH.EXE in C:\Windows\Prefetch\ with run timestamps - >
Windows event log: System — event 10000/10001 (NetworkProfile connected/disconnected) from Microsoft-Windows-NetworkProfile provider - >
Linux: /var/log/syslog entries from wpa_supplicant showing SSID associations, /var/log/NetworkManager/NetworkManager.log, /etc/NetworkManager/system-connections/ for saved profiles - >
macOS: /Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist contains known network history with timestamps
Tuning Guidance
Start by building an allowlist of known devices and accounts authorized to manage wireless connections (IT workstations, network admin accounts, MDM service accounts). Filter the WLAN AutoConfig source heavily on corporate SSIDs — create a lookup of approved SSID names and suppress events for connections to those names. For process-based detections, add a parent process allowlist excluding SCCM (CcmExec.exe), Intune Management Extension (IntuneManagementExtension.exe), and known MDM tool paths. Tune severity down for enumeration-only events (show networks, show profiles) and focus high-fidelity alerting on profile creation (add profile, EventID 20019) and actual connections (EventID 8001) to unrecognized SSIDs. The dual-homed hunting query has the highest signal-to-noise ratio for detecting Nearest Neighbor attacks — prioritize this for organizations with known APT28 targeting.
Hunting Queries
Hunts for dual-homed endpoints that have both wired and wireless network activity alongside Wi-Fi management command execution — the hallmark of a Nearest Neighbor pivot candidate or active bridging attack.
// Hunt: Dual-homed systems with both Ethernet and WiFi connections active — high-value pivot candidates
DeviceNetworkEvents
| where TimeGenerated > ago(7d)
| where LocalIPType == "Private"
| summarize InterfaceTypes = make_set(NetworkAdapterType), UniqueIPs = dcount(LocalIP) by DeviceName
| where InterfaceTypes has "802.11" and (InterfaceTypes has "Ethernet" or InterfaceTypes has "Other")
| join kind=inner (
DeviceProcessEvents
| where TimeGenerated > ago(7d)
| where ProcessCommandLine has_any ("netsh wlan", "nmcli", "iwconfig", "wpa_cli")
| summarize WifiCommandCount = count(), WifiCommands = make_set(ProcessCommandLine) by DeviceName
) on DeviceName
| project DeviceName, InterfaceTypes, UniqueIPs, WifiCommandCount, WifiCommands
| order by WifiCommandCount desc index=* sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=3 earliest=-7d
| stats dc(DestinationIp) as UniqueDestinations, values(DestinationIp) as DestIPs by Computer, SourceIp
| join type=inner Computer [
search index=* sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1 earliest=-7d
(CommandLine="*netsh wlan*" OR CommandLine="*nmcli*" OR CommandLine="*iwconfig*")
| stats count as WifiCmdCount, values(CommandLine) as WifiCommands by Computer
]
| table Computer, SourceIp, UniqueDestinations, WifiCmdCount, WifiCommands
| sort -WifiCmdCount Hunts for the creation of new wireless network profiles followed by outbound connections to public IP addresses within 30 minutes — indicates a new Wi-Fi connection being leveraged for C2 or data exfiltration immediately after establishment.
// Hunt: New wireless network profiles created in WLAN AutoConfig logs correlated with subsequent outbound connections
let NewProfiles = SecurityEvent
| where TimeGenerated > ago(30d)
| where EventID == 4688
| where CommandLine has "netsh wlan add profile" or CommandLine has "netsh wlan connect"
| extend SSID = extract(@"ssid=\"?([\w\s\-]+)\"?", 1, CommandLine)
| project ProfileTime = TimeGenerated, DeviceName = Computer, AccountName = SubjectUserName, CommandLine, SSID;
let PostConnectNetwork = DeviceNetworkEvents
| where TimeGenerated > ago(30d)
| where RemoteIPType == "Public"
| project NetworkTime = TimeGenerated, DeviceName, RemoteIP, RemotePort, RemoteUrl;
NewProfiles
| join kind=inner PostConnectNetwork on DeviceName
| where NetworkTime between (ProfileTime .. (ProfileTime + 30m))
| summarize OutboundConnections = count(), RemoteIPs = make_set(RemoteIP), RemoteUrls = make_set(RemoteUrl)
by DeviceName, AccountName, ProfileTime, SSID
| where OutboundConnections > 0
| order by ProfileTime desc index=* sourcetype="WinEventLog:Microsoft-Windows-WLAN-AutoConfig/Operational" EventCode=20019 earliest=-30d
| rex field=Message "Profile Name\s*:\s*(?<ProfileName>[^\r\n]+)"
| rex field=Message "SSID\s*:\s*(?<SSID>[^\r\n]+)"
| eval ProfileTime=_time
| join type=inner Computer [
search index=* sourcetype="stream:ip" OR sourcetype="pan:traffic" earliest=-30d
| where dest_ip NOT IN ("10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16")
| stats count as PublicConnections, values(dest_ip) as PublicIPs, values(dest_port) as Ports by host, _time
| rename host as Computer
]
| where _time > ProfileTime AND _time < ProfileTime+1800
| table _time, Computer, SSID, ProfileName, PublicConnections, PublicIPs, Ports
| sort -_time Hunts for wireless network scanning commands launched from non-standard parent processes or with obfuscation flags — automated Wi-Fi reconnaissance that would not appear in a normal user's interactive shell session.
// Hunt: Wireless network enumeration (show networks/scan) from non-interactive processes — automated probing
DeviceProcessEvents
| where TimeGenerated > ago(14d)
| where ProcessCommandLine has_any (
"netsh wlan show networks",
"nmcli device wifi list",
"iwlist scan",
"wpa_cli scan_results",
"netsh wlan show profiles"
)
| where InitiatingProcessFileName !in~ ("cmd.exe", "powershell.exe", "pwsh.exe", "bash", "sh", "zsh")
or InitiatingProcessCommandLine has_any ("hidden", "-w 1", "-windowstyle h", "-nop", "bypass")
| project TimeGenerated, DeviceName, AccountName, ProcessCommandLine,
InitiatingProcessFileName, InitiatingProcessCommandLine,
InitiatingProcessParentFileName
| order by TimeGenerated desc index=* sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1 earliest=-14d
(CommandLine="*netsh wlan show networks*" OR CommandLine="*netsh wlan show profiles*" OR
CommandLine="*iwlist*scan*" OR CommandLine="*nmcli device wifi list*")
| where NOT (ParentImage IN ("C:\\Windows\\System32\\cmd.exe", "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"))
OR match(CommandLine, "(?i)-w\\s*1|-windowstyle\s*h|-nop|-nonin|bypass|hidden")
| table _time, Computer, User, CommandLine, ParentImage, ParentCommandLine
| sort -_time Atomic Red Team Tests
Enumerates available wireless networks and saved profiles using netsh wlan, simulating the reconnaissance phase an adversary would perform after gaining code execution on a Windows system to identify Wi-Fi networks available for connection.
Command
netsh wlan show networks mode=bssid && netsh wlan show profiles && netsh wlan show interfaces Cleanup
REM No cleanup required — read-only enumeration commands Expected Telemetry
DeviceProcessEvents: ProcessCommandLine contains 'netsh wlan show networks' with parent process cmd.exe or PowerShell. SecurityEvent 4688 if process auditing enabled. Sysmon EventID 1 with CommandLine matching netsh wlan.
Expected Detection
WiFi Network Enumeration alert from KQL/SPL process detection rules. Should appear in both DeviceProcessEvents and SecurityEvent-based detection branches.
Creates a wireless network profile XML and attempts to connect to a specified SSID, simulating an adversary adding a new Wi-Fi profile (e.g., a rogue AP or target organization's network) to a compromised dual-homed system.
Command
$profileXml = @'
<?xml version="1.0"?>
<WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1">
<name>AtomicTestSSID</name>
<SSIDConfig><SSID><hex>41746f6d6963546573745353494</hex><name>AtomicTestSSID</name></SSID></SSIDConfig>
<connectionType>ESS</connectionType>
<connectionMode>manual</connectionMode>
<MSM><security><authEncryption><authentication>open</authentication><encryption>none</encryption></authEncryption></security></MSM>
</WLANProfile>
'@
$profileXml | Out-File -FilePath $env:TEMP\atomic_wifi.xml -Encoding utf8
netsh wlan add profile filename="$env:TEMP\atomic_wifi.xml"
netsh wlan connect name="AtomicTestSSID" Cleanup
netsh wlan delete profile name="AtomicTestSSID"
Remove-Item $env:TEMP\atomic_wifi.xml -Force Expected Telemetry
WLAN AutoConfig EventID 20019 (profile added) and EventID 8001 or 8002 (connect attempt). DeviceProcessEvents for netsh wlan add profile and netsh wlan connect. Temp file creation event for atomic_wifi.xml (Sysmon EventID 11).
Expected Detection
WiFi Profile Created alert and WiFi Connection Attempt alert from both KQL and SPL rules. WLAN AutoConfig log ingestion required for EventID 20019 detection path.
Uses nmcli and iwconfig to enumerate wireless networks and existing connection profiles on a Linux host, simulating wireless reconnaissance on a compromised Linux endpoint or dual-homed server.
Command
nmcli device wifi list && nmcli connection show && iwconfig 2>/dev/null || ip link show type wlan; cat /etc/NetworkManager/system-connections/*.nmconnection 2>/dev/null | grep -E '(ssid|psk)' | head -20 Cleanup
# No cleanup required — read-only commands Expected Telemetry
Linux auditd syscall audit for execve of nmcli, iwconfig, ip, cat processes with wireless-related arguments. Syslog entries from NetworkManager for scan requests. auditd EXECVE records if auditd is configured with -a always,exit -F arch=b64 -S execve rules.
Expected Detection
SPL detection via linux_secure or auditd sourcetype for nmcli wifi and iwconfig process executions. May require auditd rules targeting network enumeration commands for reliable telemetry on hardened Linux hosts.
Exports saved wireless profiles including pre-shared keys to a specified directory, simulating adversarial credential harvesting of Wi-Fi PSKs from a compromised endpoint. Exported profiles contain cleartext PSKs for WPA2-PSK networks.
Command
New-Item -Path $env:TEMP\wifi_export -ItemType Directory -Force
netsh wlan export profile folder=$env:TEMP\wifi_export\ key=clear
Get-ChildItem $env:TEMP\wifi_export\ | ForEach-Object { Write-Host "Exported: $($_.Name)"; Select-String -Path $_.FullName -Pattern 'keyMaterial' } Cleanup
Remove-Item $env:TEMP\wifi_export\ -Recurse -Force Expected Telemetry
DeviceProcessEvents for netsh wlan export profile with key=clear parameter. Sysmon EventID 11 (file create) for XML files written to TEMP directory. Possible DeviceFileEvents for subsequent file read if contents are further processed.
Expected Detection
WiFi Profile Exported alert from process detection rules. High-severity variant since key=clear exposes PSKs. Correlate with any subsequent file staging or exfiltration events (T1560, T1041) targeting the export directory.