Enumeration of Users or Groups via Built-in Commands
Identifies the execution of macOS built-in commands related to account or group enumeration. Adversaries may use account and group information to orient themselves before deciding how to act.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2021/01/12"
3integration = ["endpoint"]
4maturity = "production"
5updated_date = "2024/05/21"
6
7[rule]
8author = ["Elastic"]
9description = """
10Identifies the execution of macOS built-in commands related to account or group enumeration. Adversaries may use account
11and group information to orient themselves before deciding how to act.
12"""
13from = "now-9m"
14index = ["logs-endpoint.events.*"]
15language = "eql"
16license = "Elastic License v2"
17name = "Enumeration of Users or Groups via Built-in Commands"
18risk_score = 21
19rule_id = "6e9b351e-a531-4bdc-b73e-7034d6eed7ff"
20setup = """## Setup
21
22This rule requires data coming in from Elastic Defend.
23
24### Elastic Defend Integration Setup
25Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
26
27#### Prerequisite Requirements:
28- Fleet is required for Elastic Defend.
29- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
30
31#### The following steps should be executed in order to add the Elastic Defend integration on a macOS System:
32- Go to the Kibana home page and click "Add integrations".
33- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
34- Click "Add Elastic Defend".
35- Configure the integration name and optionally add a description.
36- Select the type of environment you want to protect, for MacOS it is recommended to select "Traditional Endpoints".
37- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
38- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
39- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
40For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/current/agent-policy.html).
41- Click "Save and Continue".
42- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
43For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
44"""
45severity = "low"
46tags = [
47 "Domain: Endpoint",
48 "OS: macOS",
49 "Use Case: Threat Detection",
50 "Tactic: Discovery",
51 "Data Source: Elastic Defend",
52]
53timestamp_override = "event.ingested"
54type = "eql"
55
56query = '''
57process where host.os.type == "macos" and event.type in ("start", "process_started") and
58 (
59 process.name : ("ldapsearch", "dsmemberutil") or
60 (process.name : "dscl" and
61 process.args : ("read", "-read", "list", "-list", "ls", "search", "-search") and
62 process.args : ("/Active Directory/*", "/Users*", "/Groups*"))
63 ) and
64 ((process.Ext.effective_parent.executable : ("/Volumes/*", "/Applications/*") or process.parent.executable : ("/Volumes/*", "/Applications/*")) or
65 (process.Ext.effective_parent.name : ".*" or process.parent.name : ".*")) and
66 not process.Ext.effective_parent.executable : ("/Applications/QualysCloudAgent.app/Contents/MacOS/qualys-cloud-agent",
67 "/Applications/Kaspersky Anti-Virus For Mac.app/Contents/MacOS/kavd.app/Contents/MacOS/kavd",
68 "/Applications/ESET Endpoint Security.app/Contents/MacOS/esets_ctl",
69 "/Applications/NordVPN.app/Contents/MacOS/NordVPN",
70 "/Applications/Xcode.app/Contents/MacOS/Xcode",
71 "/Applications/ESET Endpoint Security.app/Contents/Helpers/Uninstaller.app/Contents/MacOS/Uninstaller",
72 "/Applications/Parallels Desktop.app/Contents/MacOS/prl_client_app",
73 "/Applications/Zscaler/Zscaler.app/Contents/MacOS/Zscaler",
74 "/Applications/com.avast.av.uninstaller.app/Contents/MacOS/com.avast.av.uninstaller",
75 "/Applications/NoMAD.app/Contents/MacOS/NoMAD",
76 "/Applications/ESET Management Agent.app/Contents/MacOS/ERAAgent")
77'''
78
79
80[[rule.threat]]
81framework = "MITRE ATT&CK"
82[[rule.threat.technique]]
83id = "T1069"
84name = "Permission Groups Discovery"
85reference = "https://attack.mitre.org/techniques/T1069/"
86[[rule.threat.technique.subtechnique]]
87id = "T1069.001"
88name = "Local Groups"
89reference = "https://attack.mitre.org/techniques/T1069/001/"
90
91
92[[rule.threat.technique]]
93id = "T1087"
94name = "Account Discovery"
95reference = "https://attack.mitre.org/techniques/T1087/"
96[[rule.threat.technique.subtechnique]]
97id = "T1087.001"
98name = "Local Account"
99reference = "https://attack.mitre.org/techniques/T1087/001/"
100
101
102
103[rule.threat.tactic]
104id = "TA0007"
105name = "Discovery"
106reference = "https://attack.mitre.org/tactics/TA0007/"
Related rules
- Virtual Machine Fingerprinting via Grep
- Access to Keychain Credentials Directories
- Apple Script Execution followed by Network Connection
- Attempt to Disable Gatekeeper
- Attempt to Enable the Root Account