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/05/21"
6
7[rule]
8author = ["Elastic"]
9description = """
10Identifies when the SYSTEM account uses an account discovery utility. This could be a sign of discovery activity after
11an adversary has achieved privilege escalation.
12"""
13from = "now-9m"
14index = ["winlogbeat-*", "logs-endpoint.events.process-*", "logs-windows.sysmon_operational-*"]
15language = "eql"
16license = "Elastic License v2"
17name = "Account Discovery Command via SYSTEM Account"
18note = """## Triage and analysis
19
20### Investigating Account Discovery Command via SYSTEM Account
21
22After 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.
23
24This 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.
25
26#### Possible investigation steps
27
28- 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.
29 - 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.
30- Investigate other alerts associated with the user/host during the past 48 hours.
31- 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.
32
33### False positive analysis
34
35- 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.
36
37### Response and remediation
38
39- Initiate the incident response process based on the outcome of the triage.
40- Isolate the involved hosts to prevent further post-compromise behavior.
41- 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.
42- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
43- Determine the initial vector abused by the attacker and take action to prevent reinfection via the same vector.
44- 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).
45- Use the data collected through the analysis to investigate other machines affected in the environment.
46"""
47risk_score = 21
48rule_id = "2856446a-34e6-435b-9fb5-f8f040bfa7ed"
49setup = """## Setup
50
51If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2,
52events will not define `event.ingested` and default fallback for EQL rules was not added until version 8.2.
53Hence for this rule to work effectively, users will need to add a custom ingest pipeline to populate
54`event.ingested` to @timestamp.
55For more details on adding a custom ingest pipeline refer - https://www.elastic.co/guide/en/fleet/current/data-streams-pipeline-tutorial.html
56"""
57severity = "low"
58tags = [
59 "Domain: Endpoint",
60 "OS: Windows",
61 "Use Case: Threat Detection",
62 "Tactic: Discovery",
63 "Tactic: Privilege Escalation",
64 "Resources: Investigation Guide",
65 "Data Source: Elastic Defend",
66 "Data Source: Sysmon",
67]
68timestamp_override = "event.ingested"
69type = "eql"
70
71query = '''
72process where host.os.type == "windows" and event.type == "start" and
73 (?process.Ext.token.integrity_level_name : "System" or
74 ?winlog.event_data.IntegrityLevel : "System") and
75 (
76 process.name : "whoami.exe" or
77 (
78 process.name : "net1.exe" and not process.parent.name : "net.exe" and not process.args : ("start", "stop", "/active:*")
79 )
80 )
81'''
82
83
84[[rule.threat]]
85framework = "MITRE ATT&CK"
86[[rule.threat.technique]]
87id = "T1033"
88name = "System Owner/User Discovery"
89reference = "https://attack.mitre.org/techniques/T1033/"
90
91
92[rule.threat.tactic]
93id = "TA0007"
94name = "Discovery"
95reference = "https://attack.mitre.org/tactics/TA0007/"
96[[rule.threat]]
97framework = "MITRE ATT&CK"
98[[rule.threat.technique]]
99id = "T1078"
100name = "Valid Accounts"
101reference = "https://attack.mitre.org/techniques/T1078/"
102[[rule.threat.technique.subtechnique]]
103id = "T1078.003"
104name = "Local Accounts"
105reference = "https://attack.mitre.org/techniques/T1078/003/"
106
107
108
109[rule.threat.tactic]
110id = "TA0004"
111name = "Privilege Escalation"
112reference = "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
- Conhost Spawned By Suspicious Parent Process
- Disabling User Account Control via Registry Modification
- UAC Bypass via Windows Firewall Snap-In Hijack
- Command Prompt Network Connection
- Execution of File Written or Modified by PDF Reader