macOS Guest Account or Guest Access Enabled
Identifies attempts to enable the macOS built-in Guest account, or unauthenticated guest access to SMB or AFP file shares, via the sysadminctl or defaults command-line utilities. The Guest account does not require a password, and guest file sharing allows unauthenticated network access to shared folders. Adversaries may enable these default accounts to maintain access to a host or to stage and collect data without valid credentials.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2026/11/16"
3integration = ["endpoint"]
4maturity = "production"
5updated_date = "2026/11/16"
6
7[rule]
8author = ["Elastic"]
9description = """
10Identifies attempts to enable the macOS built-in Guest account, or unauthenticated guest access to SMB or AFP file
11shares, via the sysadminctl or defaults command-line utilities. The Guest account does not require a password, and
12guest file sharing allows unauthenticated network access to shared folders. Adversaries may enable these default
13accounts to maintain access to a host or to stage and collect data without valid credentials.
14"""
15from = "now-9m"
16index = ["logs-endpoint.events.process-*"]
17language = "eql"
18license = "Elastic License v2"
19name = "macOS Guest Account or Guest Access Enabled"
20note = """## Triage and analysis
21
22> **Disclaimer**:
23> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
24
25### Investigating macOS Guest Account or Guest Access Enabled
26
27macOS ships with a built-in Guest account that has no password, and it can also allow unauthenticated guest access to SMB and AFP file shares. These are disabled by default on most managed systems. They can be enabled from System Settings, or from the command line with `sysadminctl -guestAccount on`, `sysadminctl -smbGuestAccess on`, `sysadminctl -afpGuestAccess on`, or by writing the `GuestEnabled` or `AllowGuestAccess` preference keys with `defaults`. Adversaries with administrative access may enable these default accounts to keep a credential-less way back onto the host, or to expose shared folders to the network. This rule alerts when one of these commands is executed outside of common device management agents.
28
29### Possible investigation steps
30
31- Review the full command line (`process.command_line`) to determine which setting was changed: the local Guest login account, SMB guest access, or AFP guest access.
32- Identify the user that ran the command (`user.name`) and whether it was run through `sudo`, and confirm whether the change was requested or approved.
33- Review the parent (`process.parent.executable`) and effective parent (`process.Ext.effective_parent.executable`) to determine whether the change was interactive or came from a script, installer, or unexpected application.
34- Check whether File Sharing or Screen Sharing is enabled on the host, and whether there are inbound SMB/AFP connections or Guest logins after the change.
35- Look for other account or access changes on the same host around the same time, such as new or hidden local accounts, admin group additions, or remote access services being enabled.
36- Review recent process, file, and network activity on the host for signs of initial access or follow-on activity, such as downloads, script interpreters, or new LaunchAgents and LaunchDaemons.
37
38### False positive analysis
39
40- Device management solutions, configuration profiles, or provisioning scripts may enable or reset guest settings. Common management agents such as Jamf, JumpCloud, Addigy, Intune, Mosyle, Kandji, FileWave, NinjaOne, and Tanium are excluded; add exceptions for other approved management tools by their effective parent executable.
41- Shared or kiosk systems, labs, and classrooms may intentionally enable the Guest account. Confirm the host's role and create exceptions for those hosts.
42- Administrators may enable guest file sharing temporarily for troubleshooting. Verify the change with the administrator and confirm that the setting was reverted afterwards.
43
44### Response and remediation
45
46- If the change was not authorized, disable guest access with `sudo sysadminctl -guestAccount off`, `sudo sysadminctl -smbGuestAccess off`, and `sudo sysadminctl -afpGuestAccess off`.
47- Review shared folders and remove any that were created or exposed without authorization.
48- Investigate how the adversary obtained administrative privileges, and reset credentials for the account that performed the change.
49- Isolate the host if there is evidence of Guest logins, unauthenticated share access, or other malicious activity.
50- Enforce guest account and guest sharing settings through configuration profiles so that unauthorized changes are reverted.
51- Escalate to the incident response team and search for the same commands across other macOS hosts.
52"""
53references = [
54 "https://support.apple.com/guide/mac-help/set-up-other-users-on-your-mac-mtusr001/mac",
55]
56risk_score = 47
57rule_id = "127d103c-464a-4a16-89e6-1cedf074bac4"
58setup = """## Setup
59
60This rule requires data coming in from Elastic Defend.
61
62### Elastic Defend Integration Setup
63Elastic 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.
64
65#### Prerequisite Requirements:
66- Fleet is required for Elastic Defend.
67- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
68
69#### The following steps should be executed in order to add the Elastic Defend integration on a macOS System:
70- Go to the Kibana home page and click "Add integrations".
71- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
72- Click "Add Elastic Defend".
73- Configure the integration name and optionally add a description.
74- Select the type of environment you want to protect, for MacOS it is recommended to select "Traditional Endpoints".
75- 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).
76- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
77- 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.
78For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/current/agent-policy.html).
79- Click "Save and Continue".
80- 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.
81For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
82"""
83severity = "medium"
84tags = [
85 "Domain: Endpoint",
86 "OS: macOS",
87 "Use Case: Threat Detection",
88 "Tactic: Persistence",
89 "Tactic: Defense Evasion",
90 "Tactic: Privilege Escalation",
91 "Data Source: Elastic Defend",
92 "Resources: Investigation Guide",
93 "Rule Type: Event Correlation (EQL)",
94 "Platform: macOS",
95]
96timestamp_override = "event.ingested"
97type = "eql"
98
99query = '''
100process where host.os.type == "macos" and event.type == "start" and event.action == "exec" and
101 (
102 (process.name == "sysadminctl" and process.args like~ ("-guestAccount", "-smbGuestAccess", "-afpGuestAccess") and
103 process.args like~ "on") or
104 (process.name == "defaults" and process.args like~ "write" and
105 (
106 (process.args like~ "*com.apple.loginwindow*" and process.args like~ "GuestEnabled" and
107 process.args like~ ("true", "yes", "1", "*<true/>*")) or
108 (process.args like~ ("*com.apple.smb.server*", "*com.apple.AppleFileServer*") and
109 process.args like~ ("AllowGuestAccess", "guestAccess") and
110 process.args like~ ("true", "yes", "1", "*<true/>*")) or
111 (process.args like~ "*com.apple.MCX*" and
112 ((process.args like~ "EnableGuestAccount" and process.args like~ ("true", "yes", "1", "*<true/>*")) or
113 (process.args like~ "DisableGuestAccount" and process.args like~ ("false", "no", "0", "*<false/>*"))))
114 ))
115 ) and
116 not process.Ext.effective_parent.executable in ("/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon",
117 "/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfManagementService.app/Contents/MacOS/JamfManagementService",
118 "/usr/local/jamf/bin/jamf",
119 "/opt/jc/bin/jumpcloud-agent",
120 "/Library/Addigy/go-agent",
121 "/Library/Addigy/auditor",
122 "/Library/Intune/Microsoft Intune Agent.app/Contents/MacOS/IntuneMdmDaemon",
123 "/Library/Application Support/Mosyle/MosyleMDM.app/Contents/MacOS/MosyleMDM",
124 "/Library/Kandji/Kandji Agent.app/Contents/Helpers/Kandji Library Manager.app/Contents/MacOS/kandji-library-manager",
125 "/Library/Iru/Iru Agent.app/Contents/Helpers/Iru Library Manager.app/Contents/MacOS/kandji-library-manager",
126 "/usr/local/sbin/FileWave.app/Contents/MacOS/fwcld",
127 "/Applications/NinjaRMMAgent/programfiles/ninjarmm-macagent",
128 "/Library/Tanium/TaniumClient/TaniumClient",
129 "/Library/PrivilegedHelperTools/com.jigsaw24.Elevate24Helper.app/Contents/MacOS/com.jigsaw24.Elevate24Helper")
130'''
131
132
133[[rule.threat]]
134framework = "MITRE ATT&CK"
135
136[[rule.threat.technique]]
137id = "T1078"
138name = "Valid Accounts"
139reference = "https://attack.mitre.org/techniques/T1078/"
140
141[[rule.threat.technique.subtechnique]]
142id = "T1078.001"
143name = "Default Accounts"
144reference = "https://attack.mitre.org/techniques/T1078/001/"
145
146[rule.threat.tactic]
147id = "TA0003"
148name = "Persistence"
149reference = "https://attack.mitre.org/tactics/TA0003/"
150
151[[rule.threat]]
152framework = "MITRE ATT&CK"
153
154[[rule.threat.technique]]
155id = "T1078"
156name = "Valid Accounts"
157reference = "https://attack.mitre.org/techniques/T1078/"
158
159[[rule.threat.technique.subtechnique]]
160id = "T1078.001"
161name = "Default Accounts"
162reference = "https://attack.mitre.org/techniques/T1078/001/"
163
164[rule.threat.tactic]
165id = "TA0005"
166name = "Defense Evasion"
167reference = "https://attack.mitre.org/tactics/TA0005/"
168
169[[rule.threat]]
170framework = "MITRE ATT&CK"
171
172[[rule.threat.technique]]
173id = "T1078"
174name = "Valid Accounts"
175reference = "https://attack.mitre.org/techniques/T1078/"
176
177[[rule.threat.technique.subtechnique]]
178id = "T1078.001"
179name = "Default Accounts"
180reference = "https://attack.mitre.org/techniques/T1078/001/"
181
182[rule.threat.tactic]
183id = "TA0004"
184name = "Privilege Escalation"
185reference = "https://attack.mitre.org/tactics/TA0004/"
Triage and analysis
Disclaimer: This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
Investigating macOS Guest Account or Guest Access Enabled
macOS ships with a built-in Guest account that has no password, and it can also allow unauthenticated guest access to SMB and AFP file shares. These are disabled by default on most managed systems. They can be enabled from System Settings, or from the command line with sysadminctl -guestAccount on, sysadminctl -smbGuestAccess on, sysadminctl -afpGuestAccess on, or by writing the GuestEnabled or AllowGuestAccess preference keys with defaults. Adversaries with administrative access may enable these default accounts to keep a credential-less way back onto the host, or to expose shared folders to the network. This rule alerts when one of these commands is executed outside of common device management agents.
Possible investigation steps
- Review the full command line (
process.command_line) to determine which setting was changed: the local Guest login account, SMB guest access, or AFP guest access. - Identify the user that ran the command (
user.name) and whether it was run throughsudo, and confirm whether the change was requested or approved. - Review the parent (
process.parent.executable) and effective parent (process.Ext.effective_parent.executable) to determine whether the change was interactive or came from a script, installer, or unexpected application. - Check whether File Sharing or Screen Sharing is enabled on the host, and whether there are inbound SMB/AFP connections or Guest logins after the change.
- Look for other account or access changes on the same host around the same time, such as new or hidden local accounts, admin group additions, or remote access services being enabled.
- Review recent process, file, and network activity on the host for signs of initial access or follow-on activity, such as downloads, script interpreters, or new LaunchAgents and LaunchDaemons.
False positive analysis
- Device management solutions, configuration profiles, or provisioning scripts may enable or reset guest settings. Common management agents such as Jamf, JumpCloud, Addigy, Intune, Mosyle, Kandji, FileWave, NinjaOne, and Tanium are excluded; add exceptions for other approved management tools by their effective parent executable.
- Shared or kiosk systems, labs, and classrooms may intentionally enable the Guest account. Confirm the host's role and create exceptions for those hosts.
- Administrators may enable guest file sharing temporarily for troubleshooting. Verify the change with the administrator and confirm that the setting was reverted afterwards.
Response and remediation
- If the change was not authorized, disable guest access with
sudo sysadminctl -guestAccount off,sudo sysadminctl -smbGuestAccess off, andsudo sysadminctl -afpGuestAccess off. - Review shared folders and remove any that were created or exposed without authorization.
- Investigate how the adversary obtained administrative privileges, and reset credentials for the account that performed the change.
- Isolate the host if there is evidence of Guest logins, unauthenticated share access, or other malicious activity.
- Enforce guest account and guest sharing settings through configuration profiles so that unauthorized changes are reverted.
- Escalate to the incident response team and search for the same commands across other macOS hosts.
References
Related rules
- Local Account Creation via Sysadminctl
- Persistence via Suspicious Launch Agent or Launch Daemon
- Persistence via a Hidden Plist Filename
- Potential Privacy Control Bypass via Localhost Secure Copy
- Node.js Pre or Post-Install Script Execution