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"
  5min_stack_comments = "New fields added: required_fields, related_integrations, setup"
  6min_stack_version = "8.3.0"
  7updated_date = "2024/03/28"
  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 = ["Domain: Endpoint", "OS: Windows", "Use Case: Threat Detection", "Tactic: Discovery", "Tactic: Privilege Escalation", "Resources: Investigation Guide", "Data Source: Elastic Defend", "Data Source: Sysmon"]
 61timestamp_override = "event.ingested"
 62type = "eql"
 63
 64query = '''
 65process where host.os.type == "windows" and event.type == "start" and
 66  (?process.Ext.token.integrity_level_name : "System" or
 67  ?winlog.event_data.IntegrityLevel : "System") and
 68  (
 69    process.name : "whoami.exe" or
 70    (
 71      process.name : "net1.exe" and not process.parent.name : "net.exe" and not process.args : ("start", "stop", "/active:*")
 72    )
 73  )
 74'''
 75
 76
 77[[rule.threat]]
 78framework = "MITRE ATT&CK"
 79[[rule.threat.technique]]
 80id = "T1033"
 81name = "System Owner/User Discovery"
 82reference = "https://attack.mitre.org/techniques/T1033/"
 83
 84
 85[rule.threat.tactic]
 86id = "TA0007"
 87name = "Discovery"
 88reference = "https://attack.mitre.org/tactics/TA0007/"
 89
 90[[rule.threat]]
 91framework = "MITRE ATT&CK"
 92[[rule.threat.technique]]
 93id = "T1078"
 94name = "Valid Accounts"
 95reference = "https://attack.mitre.org/techniques/T1078/"
 96[[rule.threat.technique.subtechnique]]
 97id = "T1078.003"
 98name = "Local Accounts"
 99reference = "https://attack.mitre.org/techniques/T1078/003/"
100
101
102
103[rule.threat.tactic]
104id = "TA0004"
105name = "Privilege Escalation"
106reference = "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

to-top