Wireless Credential Dumping using Netsh Command
Identifies attempts to dump Wireless saved access keys in clear text using the Windows built-in utility Netsh.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2022/11/01"
3integration = ["endpoint", "system", "windows", "m365_defender", "sentinel_one_cloud_funnel", "crowdstrike"]
4maturity = "production"
5updated_date = "2025/03/20"
6
7[transform]
8[[transform.osquery]]
9label = "Osquery - Retrieve DNS Cache"
10query = "SELECT * FROM dns_cache"
11
12[[transform.osquery]]
13label = "Osquery - Retrieve All Services"
14query = "SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services"
15
16[[transform.osquery]]
17label = "Osquery - Retrieve Services Running on User Accounts"
18query = """
19SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services WHERE
20NOT (user_account LIKE '%LocalSystem' OR user_account LIKE '%LocalService' OR user_account LIKE '%NetworkService' OR
21user_account == null)
22"""
23
24[[transform.osquery]]
25label = "Osquery - Retrieve Service Unsigned Executables with Virustotal Link"
26query = """
27SELECT concat('https://www.virustotal.com/gui/file/', sha1) AS VtLink, name, description, start_type, status, pid,
28services.path FROM services JOIN authenticode ON services.path = authenticode.path OR services.module_path =
29authenticode.path JOIN hash ON services.path = hash.path WHERE authenticode.result != 'trusted'
30"""
31
32
33[rule]
34author = ["Elastic"]
35description = "Identifies attempts to dump Wireless saved access keys in clear text using the Windows built-in utility Netsh."
36from = "now-9m"
37index = [
38 "endgame-*",
39 "logs-crowdstrike.fdr*",
40 "logs-endpoint.events.process-*",
41 "logs-m365_defender.event-*",
42 "logs-sentinel_one_cloud_funnel.*",
43 "logs-system.security*",
44 "logs-windows.forwarded*",
45 "logs-windows.sysmon_operational-*",
46 "winlogbeat-*",
47]
48language = "eql"
49license = "Elastic License v2"
50name = "Wireless Credential Dumping using Netsh Command"
51note = """## Triage and analysis
52
53### Investigating Wireless Credential Dumping using Netsh Command
54
55Netsh is a Windows command line tool used for network configuration and troubleshooting. It enables the management of network settings and adapters, wireless network profiles, and other network-related tasks.
56
57This rule looks for patterns used to dump credentials from wireless network profiles using Netsh, which can enable attackers to bring their own devices to the network.
58
59> **Note**:
60> This investigation guide uses the [Osquery Markdown Plugin](https://www.elastic.co/guide/en/security/current/invest-guide-run-osquery.html) introduced in Elastic Stack version 8.5.0. Older Elastic Stack versions will display unrendered Markdown in this guide.
61
62#### Possible investigation steps
63
64- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
65- Investigate other alerts associated with the user/host during the past 48 hours.
66- Inspect the host for suspicious or abnormal behavior in the alert timeframe:
67 - Observe and collect information about the following activities in the alert subject host:
68 - Attempts to contact external domains and addresses.
69 - Use the Elastic Defend network events to determine domains and addresses contacted by the subject process by filtering by the process' `process.entity_id`.
70 - Examine the DNS cache for suspicious or anomalous entries.
71 - $osquery_0
72 - Use the Elastic Defend registry events to examine registry keys accessed, modified, or created by the related processes in the process tree.
73 - Examine the host services for suspicious or anomalous entries.
74 - $osquery_1
75 - $osquery_2
76 - $osquery_3
77
78### False positive analysis
79
80- This activity is unlikely to happen legitimately. Benign true positives (B-TPs) can be added as exceptions if necessary.
81
82### Response and remediation
83
84- Initiate the incident response process based on the outcome of the triage.
85- Isolate the involved host to prevent further post-compromise behavior.
86- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
87- Review the privileges assigned to the user to ensure that the least privilege principle is being followed.
88- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
89- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
90- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
91"""
92references = [
93 "https://learn.microsoft.com/en-us/windows-server/networking/technologies/netsh/netsh-contexts",
94 "https://www.geeksforgeeks.org/how-to-find-the-wi-fi-password-using-cmd-in-windows/",
95]
96risk_score = 73
97rule_id = "2de87d72-ee0c-43e2-b975-5f0b029ac600"
98severity = "high"
99tags = [
100 "Domain: Endpoint",
101 "OS: Windows",
102 "Use Case: Threat Detection",
103 "Tactic: Credential Access",
104 "Tactic: Discovery",
105 "Data Source: Elastic Endgame",
106 "Resources: Investigation Guide",
107 "Data Source: Elastic Defend",
108 "Data Source: Windows Security Event Logs",
109 "Data Source: Microsoft Defender for Endpoint",
110 "Data Source: Sysmon",
111 "Data Source: SentinelOne",
112 "Data Source: Crowdstrike",
113]
114timestamp_override = "event.ingested"
115type = "eql"
116
117query = '''
118process where host.os.type == "windows" and event.type == "start" and
119 (process.name : "netsh.exe" or ?process.pe.original_file_name == "netsh.exe") and
120 process.args : "wlan" and process.args : "key*clear"
121'''
122
123
124[[rule.threat]]
125framework = "MITRE ATT&CK"
126[[rule.threat.technique]]
127id = "T1003"
128name = "OS Credential Dumping"
129reference = "https://attack.mitre.org/techniques/T1003/"
130
131[[rule.threat.technique]]
132id = "T1555"
133name = "Credentials from Password Stores"
134reference = "https://attack.mitre.org/techniques/T1555/"
135
136
137[rule.threat.tactic]
138id = "TA0006"
139name = "Credential Access"
140reference = "https://attack.mitre.org/tactics/TA0006/"
141[[rule.threat]]
142framework = "MITRE ATT&CK"
143[[rule.threat.technique]]
144id = "T1082"
145name = "System Information Discovery"
146reference = "https://attack.mitre.org/techniques/T1082/"
147
148
149[rule.threat.tactic]
150id = "TA0007"
151name = "Discovery"
152reference = "https://attack.mitre.org/tactics/TA0007/"
toml
Triage and analysis
Investigating Wireless Credential Dumping using Netsh Command
Netsh is a Windows command line tool used for network configuration and troubleshooting. It enables the management of network settings and adapters, wireless network profiles, and other network-related tasks.
This rule looks for patterns used to dump credentials from wireless network profiles using Netsh, which can enable attackers to bring their own devices to the network.
Note: This investigation guide uses the Osquery Markdown Plugin introduced in Elastic Stack version 8.5.0. Older Elastic Stack versions will display unrendered Markdown in this guide.
Possible investigation steps
- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
- Investigate other alerts associated with the user/host during the past 48 hours.
- Inspect the host for suspicious or abnormal behavior in the alert timeframe:
- Observe and collect information about the following activities in the alert subject host:
- Attempts to contact external domains and addresses.
- Use the Elastic Defend network events to determine domains and addresses contacted by the subject process by filtering by the process'
process.entity_id
. - Examine the DNS cache for suspicious or anomalous entries.
- $osquery_0
- Use the Elastic Defend network events to determine domains and addresses contacted by the subject process by filtering by the process'
- Use the Elastic Defend registry events to examine registry keys accessed, modified, or created by the related processes in the process tree.
- Examine the host services for suspicious or anomalous entries.
- $osquery_1
- $osquery_2
- $osquery_3
- Attempts to contact external domains and addresses.
- Observe and collect information about the following activities in the alert subject host:
False positive analysis
- This activity is unlikely to happen legitimately. Benign true positives (B-TPs) can be added as exceptions if necessary.
Response and remediation
- Initiate the incident response process based on the outcome of the triage.
- Isolate the involved host to prevent further post-compromise behavior.
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
- Review the privileges assigned to the user to ensure that the least privilege principle is being followed.
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
References
Related rules
- AdFind Command Activity
- Credential Acquisition via Registry Hive Dumping
- Enumerating Domain Trusts via DSQUERY.EXE
- Group Policy Discovery via Microsoft GPResult Utility
- Microsoft IIS Connection Strings Decryption