Local Account Creation via Sysadminctl

Identifies the creation of a local user account via the sysadminctl utility on macOS. Adversaries may create a local account to maintain persistence on a compromised host. When the -admin flag is specified, the new account is added to the admin group, which also constitutes privilege escalation; account creation without -admin is persistence only.

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 the creation of a local user account via the sysadminctl utility on macOS. Adversaries may create a local
 11account to maintain persistence on a compromised host. When the -admin flag is specified, the new account is added to
 12the admin group, which also constitutes privilege escalation; account creation without -admin is persistence only.
 13"""
 14from = "now-9m"
 15index = ["logs-endpoint.events.process-*"]
 16language = "eql"
 17license = "Elastic License v2"
 18name = "Local Account Creation via Sysadminctl"
 19note = """## Triage and analysis
 20
 21> **Disclaimer**:
 22> 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.
 23
 24### Investigating Local Account Creation via Sysadminctl
 25
 26`sysadminctl` is a built-in macOS utility used to manage local user accounts, including creating users with `-addUser`. Passing `-admin` adds the new account to the `admin` group, granting `sudo` rights and the ability to change system-wide settings. Adversaries may abuse it to create a backdoor account, often with a password supplied in clear text on the command line, to retain access to a compromised Mac. This rule alerts on any `sysadminctl -addUser` execution that does not originate from a known device management agent.
 27
 28### Possible investigation steps
 29
 30- Review the command line to identify the account name (`-addUser`), full name (`-fullName`), whether `-admin` was specified, and whether a password was passed in clear text (`-password`).
 31- Examine the parent and effective parent processes (`process.parent.executable`, `process.Ext.effective_parent.executable`) to determine whether the account was created interactively, from a script interpreter such as `osascript`, `python`, or a shell, or by an unsigned or untrusted binary.
 32- Identify the user that ran the command and confirm whether they are authorized to create local accounts on the host.
 33- Check whether the new account is hidden (for example via `dscl . -create /Users/<name> IsHidden 1`) or uses an unusual UID, and whether it was subsequently added to other privileged groups.
 34- Search for activity following the account creation, such as logons with the new account over SSH or Screen Sharing, new LaunchAgents or LaunchDaemons, or changes to security settings.
 35- Review other alerts for the same host to identify the initial access or execution activity that preceded the account creation.
 36
 37### False positive analysis
 38
 39- IT administrators and device management or provisioning tools may legitimately create local accounts with `sysadminctl`. Verify the activity against change tickets or the expected management workflow and add exceptions for the specific management process rather than for `sysadminctl` itself.
 40- Security testing frameworks such as Atomic Red Team create test accounts with `sysadminctl`. Confirm the activity with the team running the test.
 41
 42### Response and remediation
 43
 44- If the account creation is unauthorized, disable or delete the account with `sysadminctl -deleteUser <name>` and remove it from any privileged groups.
 45- Terminate the process tree responsible for the account creation and quarantine any associated scripts or binaries.
 46- Review and revert changes made with the new account, such as persistence items, installed software, or modified security settings.
 47- Reset credentials of any legitimate account that was used to create the new account, as administrator credentials are required for this operation.
 48- Isolate the host if follow-on malicious activity is identified and escalate to the incident response team.
 49"""
 50references = ["https://ss64.com/mac/sysadminctl.html"]
 51risk_score = 47
 52rule_id = "b8ab618d-3f6b-49c1-a646-88bb6364a213"
 53setup = """## Setup
 54
 55This rule requires data coming in from Elastic Defend.
 56
 57### Elastic Defend Integration Setup
 58Elastic 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.
 59
 60#### Prerequisite Requirements:
 61- Fleet is required for Elastic Defend.
 62- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
 63
 64#### The following steps should be executed in order to add the Elastic Defend integration on a macOS System:
 65- Go to the Kibana home page and click "Add integrations".
 66- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
 67- Click "Add Elastic Defend".
 68- Configure the integration name and optionally add a description.
 69- Select the type of environment you want to protect, for MacOS it is recommended to select "Traditional Endpoints".
 70- 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).
 71- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
 72- 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.
 73For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/current/agent-policy.html).
 74- Click "Save and Continue".
 75- 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.
 76For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
 77"""
 78severity = "medium"
 79tags = [
 80    "Domain: Endpoint",
 81    "OS: macOS",
 82    "Use Case: Threat Detection",
 83    "Tactic: Persistence",
 84    "Tactic: Privilege Escalation",
 85    "Data Source: Elastic Defend",
 86    "Resources: Investigation Guide",
 87    "Rule Type: Event Correlation (EQL)",
 88    "Platform: macOS",
 89]
 90timestamp_override = "event.ingested"
 91type = "eql"
 92
 93query = '''
 94process where host.os.type == "macos" and event.type == "start" and event.action == "exec" and
 95  process.name == "sysadminctl" and process.args like~ "-addUser" and
 96  not process.Ext.effective_parent.executable like ("/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon",
 97                                                    "/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfManagementService.app/Contents/MacOS/JamfManagementService",
 98                                                    "/usr/local/jamf/bin/jamf",
 99                                                    "/opt/jc/bin/jumpcloud-agent",
100                                                    "/Library/Addigy/go-agent",
101                                                    "/Library/Addigy/auditor",
102                                                    "/Library/Intune/Microsoft Intune Agent.app/Contents/MacOS/IntuneMdmDaemon",
103                                                    "/Library/Application Support/Mosyle/MosyleMDM.app/Contents/MacOS/MosyleMDM",
104                                                    "/Library/Kandji/Kandji Agent.app/Contents/Helpers/Kandji Library Manager.app/Contents/MacOS/kandji-library-manager",
105                                                    "/Library/Iru/Iru Agent.app/Contents/Helpers/Iru Library Manager.app/Contents/MacOS/kandji-library-manager",
106                                                    "/usr/local/sbin/FileWave.app/Contents/MacOS/fwcld",
107                                                    "/Applications/NinjaRMMAgent/programfiles/ninjarmm-macagent",
108                                                    "/Library/Tanium/TaniumClient/TaniumClient",
109                                                    "/Library/PrivilegedHelperTools/com.jigsaw24.Elevate24Helper.app/Contents/MacOS/com.jigsaw24.Elevate24Helper")
110'''
111
112
113[[rule.threat]]
114framework = "MITRE ATT&CK"
115[[rule.threat.technique]]
116id = "T1136"
117name = "Create Account"
118reference = "https://attack.mitre.org/techniques/T1136/"
119[[rule.threat.technique.subtechnique]]
120id = "T1136.001"
121name = "Local Account"
122reference = "https://attack.mitre.org/techniques/T1136/001/"
123
124
125
126[rule.threat.tactic]
127id = "TA0003"
128name = "Persistence"
129reference = "https://attack.mitre.org/tactics/TA0003/"
130[[rule.threat]]
131framework = "MITRE ATT&CK"
132[[rule.threat.technique]]
133id = "T1098"
134name = "Account Manipulation"
135reference = "https://attack.mitre.org/techniques/T1098/"
136[[rule.threat.technique.subtechnique]]
137id = "T1098.007"
138name = "Additional Local or Domain Groups"
139reference = "https://attack.mitre.org/techniques/T1098/007/"
140
141
142
143[rule.threat.tactic]
144id = "TA0004"
145name = "Privilege Escalation"
146reference = "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 Local Account Creation via Sysadminctl

sysadminctl is a built-in macOS utility used to manage local user accounts, including creating users with -addUser. Passing -admin adds the new account to the admin group, granting sudo rights and the ability to change system-wide settings. Adversaries may abuse it to create a backdoor account, often with a password supplied in clear text on the command line, to retain access to a compromised Mac. This rule alerts on any sysadminctl -addUser execution that does not originate from a known device management agent.

Possible investigation steps

  • Review the command line to identify the account name (-addUser), full name (-fullName), whether -admin was specified, and whether a password was passed in clear text (-password).
  • Examine the parent and effective parent processes (process.parent.executable, process.Ext.effective_parent.executable) to determine whether the account was created interactively, from a script interpreter such as osascript, python, or a shell, or by an unsigned or untrusted binary.
  • Identify the user that ran the command and confirm whether they are authorized to create local accounts on the host.
  • Check whether the new account is hidden (for example via dscl . -create /Users/<name> IsHidden 1) or uses an unusual UID, and whether it was subsequently added to other privileged groups.
  • Search for activity following the account creation, such as logons with the new account over SSH or Screen Sharing, new LaunchAgents or LaunchDaemons, or changes to security settings.
  • Review other alerts for the same host to identify the initial access or execution activity that preceded the account creation.

False positive analysis

  • IT administrators and device management or provisioning tools may legitimately create local accounts with sysadminctl. Verify the activity against change tickets or the expected management workflow and add exceptions for the specific management process rather than for sysadminctl itself.
  • Security testing frameworks such as Atomic Red Team create test accounts with sysadminctl. Confirm the activity with the team running the test.

Response and remediation

  • If the account creation is unauthorized, disable or delete the account with sysadminctl -deleteUser <name> and remove it from any privileged groups.
  • Terminate the process tree responsible for the account creation and quarantine any associated scripts or binaries.
  • Review and revert changes made with the new account, such as persistence items, installed software, or modified security settings.
  • Reset credentials of any legitimate account that was used to create the new account, as administrator credentials are required for this operation.
  • Isolate the host if follow-on malicious activity is identified and escalate to the incident response team.

References

Related rules

to-top