Account Discovery Command via SYSTEM Account
Identifies when the SYSTEM account uses an account discovery utility. This could be a sign of discovery activity after an adversary has achieved privilege escalation.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2020/03/18"
3integration = ["endpoint", "windows"]
4maturity = "production"
5updated_date = "2024/10/15"
6min_stack_version = "8.14.0"
7min_stack_comments = "Breaking change at 8.14.0 for the Windows Integration."
8
9[rule]
10author = ["Elastic"]
11description = """
12Identifies when the SYSTEM account uses an account discovery utility. This could be a sign of discovery activity after
13an adversary has achieved privilege escalation.
14"""
15from = "now-9m"
16index = ["winlogbeat-*", "logs-endpoint.events.process-*", "logs-windows.sysmon_operational-*"]
17language = "eql"
18license = "Elastic License v2"
19name = "Account Discovery Command via SYSTEM Account"
20note = """## Triage and analysis
21
22### Investigating Account Discovery Command via SYSTEM Account
23
24After successfully compromising an environment, attackers may try to gain situational awareness to plan their next steps. This can happen by running commands to enumerate network resources, users, connections, files, and installed security software.
25
26This rule looks for the execution of account discovery utilities using the SYSTEM account, which is commonly observed after attackers successfully perform privilege escalation or exploit web applications.
27
28#### Possible investigation steps
29
30- 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.
31 - If the process tree includes a web-application server process such as w3wp, httpd.exe, nginx.exe and alike, investigate any suspicious file creation or modification in the last 48 hours to assess the presence of any potential webshell backdoor.
32- Investigate other alerts associated with the user/host during the past 48 hours.
33- Determine how the SYSTEM account is being used. For example, users with administrator privileges can spawn a system shell using Windows services, scheduled tasks or other third party utilities.
34
35### False positive analysis
36
37- Discovery activities are not inherently malicious if they occur in isolation. As long as the analyst did not identify suspicious activity related to the user or host, such alerts can be dismissed.
38
39### Response and remediation
40
41- Initiate the incident response process based on the outcome of the triage.
42- Isolate the involved hosts to prevent further post-compromise behavior.
43- 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.
44- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
45- Determine the initial vector abused by the attacker and take action to prevent reinfection via the same vector.
46- 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).
47- Use the data collected through the analysis to investigate other machines affected in the environment.
48"""
49risk_score = 21
50rule_id = "2856446a-34e6-435b-9fb5-f8f040bfa7ed"
51setup = """## Setup
52
53If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2,
54events will not define `event.ingested` and default fallback for EQL rules was not added until version 8.2.
55Hence for this rule to work effectively, users will need to add a custom ingest pipeline to populate
56`event.ingested` to @timestamp.
57For more details on adding a custom ingest pipeline refer - https://www.elastic.co/guide/en/fleet/current/data-streams-pipeline-tutorial.html
58"""
59severity = "low"
60tags = [
61 "Domain: Endpoint",
62 "OS: Windows",
63 "Use Case: Threat Detection",
64 "Tactic: Discovery",
65 "Tactic: Privilege Escalation",
66 "Resources: Investigation Guide",
67 "Data Source: Elastic Defend",
68 "Data Source: Sysmon",
69]
70timestamp_override = "event.ingested"
71type = "eql"
72
73query = '''
74process where host.os.type == "windows" and event.type == "start" and
75 (?process.Ext.token.integrity_level_name : "System" or
76 ?winlog.event_data.IntegrityLevel : "System") and
77 (
78 process.name : "whoami.exe" or
79 (
80 process.name : "net1.exe" and not process.parent.name : "net.exe" and not process.args : ("start", "stop", "/active:*")
81 )
82 )
83'''
84
85
86[[rule.threat]]
87framework = "MITRE ATT&CK"
88[[rule.threat.technique]]
89id = "T1033"
90name = "System Owner/User Discovery"
91reference = "https://attack.mitre.org/techniques/T1033/"
92
93
94[rule.threat.tactic]
95id = "TA0007"
96name = "Discovery"
97reference = "https://attack.mitre.org/tactics/TA0007/"
98[[rule.threat]]
99framework = "MITRE ATT&CK"
100[[rule.threat.technique]]
101id = "T1078"
102name = "Valid Accounts"
103reference = "https://attack.mitre.org/techniques/T1078/"
104[[rule.threat.technique.subtechnique]]
105id = "T1078.003"
106name = "Local Accounts"
107reference = "https://attack.mitre.org/techniques/T1078/003/"
108
109
110
111[rule.threat.tactic]
112id = "TA0004"
113name = "Privilege Escalation"
114reference = "https://attack.mitre.org/tactics/TA0004/"
Triage and analysis
Investigating Account Discovery Command via SYSTEM Account
After successfully compromising an environment, attackers may try to gain situational awareness to plan their next steps. This can happen by running commands to enumerate network resources, users, connections, files, and installed security software.
This rule looks for the execution of account discovery utilities using the SYSTEM account, which is commonly observed after attackers successfully perform privilege escalation or exploit web applications.
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.
- If the process tree includes a web-application server process such as w3wp, httpd.exe, nginx.exe and alike, investigate any suspicious file creation or modification in the last 48 hours to assess the presence of any potential webshell backdoor.
- Investigate other alerts associated with the user/host during the past 48 hours.
- Determine how the SYSTEM account is being used. For example, users with administrator privileges can spawn a system shell using Windows services, scheduled tasks or other third party utilities.
False positive analysis
- Discovery activities are not inherently malicious if they occur in isolation. As long as the analyst did not identify suspicious activity related to the user or host, such alerts can be dismissed.
Response and remediation
- Initiate the incident response process based on the outcome of the triage.
- Isolate the involved hosts 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.
- 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 via 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).
- Use the data collected through the analysis to investigate other machines affected in the environment.
Related rules
- AdFind Command Activity
- Bypass UAC via Event Viewer
- Conhost Spawned By Suspicious Parent Process
- Disabling User Account Control via Registry Modification
- Enumerating Domain Trusts via DSQUERY.EXE