Creation of a Hidden Local User Account

Identifies the creation of a hidden local user account by appending the dollar sign to the account name. This is sometimes done by attackers to increase access to a system and avoid appearing in the results of accounts listing using the net users command.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2020/12/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 the creation of a hidden local user account by appending the dollar sign to the account name. This is
13sometimes done by attackers to increase access to a system and avoid appearing in the results of accounts listing using
14the net users command.
15"""
16from = "now-9m"
17index = ["winlogbeat-*", "logs-endpoint.events.registry-*", "logs-windows.sysmon_operational-*", "endgame-*"]
18language = "eql"
19license = "Elastic License v2"
20name = "Creation of a Hidden Local User Account"
21note = """## Triage and analysis
22
23### Investigating Creation of a Hidden Local User Account
24
25Attackers can create accounts ending with a `$` symbol to make the account hidden to user enumeration utilities and bypass detections that identify computer accounts by this pattern to apply filters.
26
27This rule uses registry events to identify the creation of local hidden accounts.
28
29#### Possible investigation steps
30
31- Identify the user account that performed the action and whether it should perform this kind of action.
32- 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.
33- Investigate other alerts associated with the user/host during the past 48 hours.
34
35### False positive analysis
36
37- This activity is unlikely to happen legitimately. Benign true positive (B-TPs) can be added as exceptions if necessary.
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- Delete the hidden account.
44- Review the privileges assigned to the involved users to ensure that the least privilege principle is being followed.
45- Determine the initial vector abused by the attacker and take action to prevent reinfection through 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"""
48references = [
49    "http://web.archive.org/web/20230329153858/https://blog.menasec.net/2019/02/threat-hunting-6-hiding-in-plain-sights_8.html",
50    "https://github.com/CyberMonitor/APT_CyberCriminal_Campagin_Collections/tree/master/2020/2020.12.15.Lazarus_Campaign",
51]
52risk_score = 73
53rule_id = "2edc8076-291e-41e9-81e4-e3fcbc97ae5e"
54setup = """## Setup
55
56If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2,
57events will not define `event.ingested` and default fallback for EQL rules was not added until version 8.2.
58Hence for this rule to work effectively, users will need to add a custom ingest pipeline to populate
59`event.ingested` to @timestamp.
60For more details on adding a custom ingest pipeline refer - https://www.elastic.co/guide/en/fleet/current/data-streams-pipeline-tutorial.html
61"""
62severity = "high"
63tags = ["Domain: Endpoint", "OS: Windows", "Use Case: Threat Detection", "Tactic: Persistence", "Resources: Investigation Guide", "Data Source: Elastic Endgame", "Data Source: Elastic Defend", "Data Source: Sysmon"]
64timestamp_override = "event.ingested"
65type = "eql"
66
67query = '''
68registry where host.os.type == "windows" and registry.path : (
69    "HKLM\\SAM\\SAM\\Domains\\Account\\Users\\Names\\*$\\",
70    "\\REGISTRY\\MACHINE\\SAM\\SAM\\Domains\\Account\\Users\\Names\\*$\\"
71)
72'''
73
74
75[[rule.threat]]
76framework = "MITRE ATT&CK"
77[[rule.threat.technique]]
78id = "T1136"
79name = "Create Account"
80reference = "https://attack.mitre.org/techniques/T1136/"
81[[rule.threat.technique.subtechnique]]
82id = "T1136.001"
83name = "Local Account"
84reference = "https://attack.mitre.org/techniques/T1136/001/"
85
86
87
88[rule.threat.tactic]
89id = "TA0003"
90name = "Persistence"
91reference = "https://attack.mitre.org/tactics/TA0003/"

Triage and analysis

Investigating Creation of a Hidden Local User Account

Attackers can create accounts ending with a $ symbol to make the account hidden to user enumeration utilities and bypass detections that identify computer accounts by this pattern to apply filters.

This rule uses registry events to identify the creation of local hidden accounts.

Possible investigation steps

  • Identify the user account that performed the action and whether it should perform this kind of action.
  • 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.

False positive analysis

  • This activity is unlikely to happen legitimately. Benign true positive (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 hosts to prevent further post-compromise behavior.
  • Delete the hidden account.
  • Review the privileges assigned to the involved users to ensure that the least privilege principle is being followed.
  • 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

to-top