T1016.002

Wi-Fi Discovery

Adversaries may search for information about Wi-Fi networks, such as network names and passwords, on compromised systems. On Windows, adversaries commonly use netsh wlan commands to enumerate saved Wi-Fi profiles and extract cleartext passwords. On Linux, Wi-Fi credentials may be found in /etc/NetworkManager/system-connections/. On macOS, the security command can retrieve Wi-Fi passwords. This technique is used by threat actors including Magic Hound (APT35), malware families such as Agent Tesla, CharmPower, PUBLOAD, Machete, and Emotet to support credential access, lateral movement to nearby wireless networks, and reconnaissance of the target environment.

Microsoft Sentinel / Defender
kusto
let WiFiDiscoveryPatterns = dynamic([
  "wlan show profiles",
  "wlan show profile",
  "wlan show networks",
  "wlan show interfaces",
  "wlan show",
  "key=clear",
  "wlanAPI",
  "NetworkManager/system-connections",
  "find-generic-password"
]);
let WiFiExecutables = dynamic(["netsh.exe", "cmd.exe", "powershell.exe", "pwsh.exe", "bash", "sh", "security"]);
DeviceProcessEvents
| where Timestamp > ago(24h)
| where (
    // Direct netsh wlan commands
    (FileName =~ "netsh.exe" and ProcessCommandLine has "wlan")
    // PowerShell or cmd calling netsh wlan
    or (ProcessCommandLine has "netsh" and ProcessCommandLine has "wlan")
    // Reading NM connection files on Linux via WSL or scripting
    or (ProcessCommandLine has "NetworkManager" and ProcessCommandLine has "system-connections")
    // macOS security command for Wi-Fi passwords
    or (ProcessCommandLine has "find-generic-password" and ProcessCommandLine has "-wa")
    // key=clear to extract plaintext Wi-Fi password
    or (ProcessCommandLine has "key=clear")
  )
| extend IsProfileEnum = ProcessCommandLine has "show profiles"
| extend IsPasswordExtract = ProcessCommandLine has "key=clear"
| extend IsNetworkScan = ProcessCommandLine has_any ("show networks", "show interfaces", "mode=bssid")
| extend IsMacOSQuery = ProcessCommandLine has "find-generic-password"
| extend IsLinuxQuery = ProcessCommandLine has "system-connections"
| extend SuspicionScore = toint(IsProfileEnum) + toint(IsPasswordExtract) + toint(IsNetworkScan) + toint(IsMacOSQuery) + toint(IsLinuxQuery)
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
         InitiatingProcessFileName, InitiatingProcessCommandLine,
         InitiatingProcessParentFileName,
         IsProfileEnum, IsPasswordExtract, IsNetworkScan, IsMacOSQuery, IsLinuxQuery,
         SuspicionScore
| sort by Timestamp desc
medium severity high confidence

Data Sources

Process: Process Creation Command: Command Execution Microsoft Defender for Endpoint

Required Tables

DeviceProcessEvents

False Positives

  • IT administrators running netsh wlan show profiles or netsh wlan show profile key=clear for legitimate network troubleshooting or documentation purposes
  • Network monitoring or configuration management tools that enumerate Wi-Fi profiles as part of inventory collection (e.g., Lansweeper, PDQ Inventory, SCCM hardware inventory)
  • Help desk or support technicians using netsh wlan commands to assist users with Wi-Fi connectivity issues
  • Automated onboarding or device provisioning scripts that query existing Wi-Fi profiles before deploying new connection configurations

Unlock Pro Content

Get the full detection package for T1016.002 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections