← Back to SOC feed Coverage →

wifikeys

kql MEDIUM Azure-Sentinel
DeviceProcessEvents
huntingmicrosoftofficial
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at Azure-Sentinel →
Retrieved: 2026-05-23T03:15:01Z · Confidence: medium

Hunt Hypothesis

An adversary may use netsh to extract WPA keys from the local machine, exposing sensitive wireless credentials in clear text. SOC teams should proactively hunt for this behavior in Azure Sentinel to identify potential credential exposure and unauthorized network access attempts.

KQL Query

DeviceProcessEvents 
| where Timestamp > ago(7d)
| where ProcessCommandLine startswith "netsh"
| where ProcessCommandLine has "key=clear"
| project Timestamp, DeviceName, InitiatingProcessFileName, FileName, ProcessCommandLine
| top 100 by Timestamp

Analytic Rule Definition

id: ad5c7f75-95e0-4eb9-93e5-b1793ef405d6
name: wifikeys
description: |
  Detect if someone run netsh and try to expose WPA keys in clear text
  @mattiasborg82.
  Blog.sec-labs.com.
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - DeviceProcessEvents
query: |
  DeviceProcessEvents 
  | where Timestamp > ago(7d)
  | where ProcessCommandLine startswith "netsh"
  | where ProcessCommandLine has "key=clear"
  | project Timestamp, DeviceName, InitiatingProcessFileName, FileName, ProcessCommandLine
  | top 100 by Timestamp

Required Data Sources

Sentinel TableNotes
DeviceProcessEventsEnsure this data connector is enabled

References

False Positive Guidance

Original source: https://github.com/Azure/Azure-Sentinel/blob/main/Hunting Queries/Microsoft 365 Defender/General queries/wifikeys.yaml