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